After talking to rmudgett about some of his recent iflist locking changes, it
was determined that the only place that would destroy a channel without being
explicitly to do so was in handle_init_event. The loop to walk the interface
list has been modified to wait to destroy the channel until the dahdi_pvt of
the channel to be destroyed is no longer needed.
(closes issue #15378)
Reported by: samy
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@218401 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The IAX2 Call Token security patch inadvertently broke the use of
encryption due to the reorganization of code in the socket_process()
function. When encryption is used, an incoming full frame must first
be decrypted before the information elements can be parsed. The
security release mistakenly moved IE parsing before decryption in
order to process the new Call Token IE. To resolve this, decryption
of full frames is once again done before looking into the frame. This
involves searching for an existing callno, checking the pvt to see if
encryption is turned on, and decrypting the packet before the internal
fields of the full frame are accessed.
associated with AST-2009-006
(closes issue #15834)
Reported by: karesmakro
Patches:
iax2_encryption_fix_1.4.diff uploaded by dvossel (license 671)
Tested by: dvossel, karesmakro
Review: https://reviewboard.asterisk.org/r/355/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@217806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Remove code that causes loops in registrations.
We have agreed that the patch that this code was part of was bad. I am ripping out the code that causes
the issue. putnopvut needs to check the rest of the patch, if it needs to be changed as well.
This solves the issue reported in #15540, but needs more work before we close it (as described above).
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@217668 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The issue at hand is that some legacy (dying) PBX systems send empty media frames on PRI
links *before* any call progress. The SIP channel receives these frames and by default
signals 183 Session progress and starts sending media. This will cause phones to
play silence and ignore the later 180 ringing message. A bad user experience.
The fix is twofold:
- We discovered that asterisk apps that support early media ("noanswer") did not send
any PROGRESS frame to indicate early media. Fixed.
- We introduce a setting in chan_sip so that users can disable any relay of media frames
before the outbound channel actually indicates any sort of call progress.
In 1.4, 1.6.0 and 1.6.1, this will be disabled for backward compatibility. In later versions
of Asterisk, this will be enabled. We don't assume that it will change your Asterisk
phone experience - only for the better.
We encourage third-party application developers to make sure that if they have applications
that wants to send early media, add a PROGRESS control frame transmission to make sure that
all channel drivers actually will start sending early media. This has not been the default
in Asterisk previous to this patch, so if you got inspiration from our code, you need to
update accordingly. Sorry for the trouble and thanks for your support.
This code has been running for a few months in a large scale installation (over 250
servers with PRI and/or BRI links to old PBX systems).
That's no proof that this is an excellent patch, but, well, it's tested :-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@216430 65c4cc65-6c06-0410-ace0-fbb531ad65f3
From section 13.3.1.1 of RFC 3261:
If the UAS desires an extended period of time to answer the INVITE,
it will need to ask for an "extension" in order to prevent proxies
from canceling the transaction. A proxy has the option of canceling
a transaction when there is a gap of 3 minutes between responses in a
transaction. To prevent cancellation, the UAS MUST send a non-100
provisional response at every minute, to handle the possibility of
lost provisional responses.
(closes issue #11157)
Reported by: rjain
Tested by: twilson
Review: https://reviewboard.asterisk.org/r/315/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@215682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
If more ports were specified than configured in misdn.conf a reload would crash
asterisk. The problem was the unconfigured port was using data from the
previously configured port. When the data for an unconfigured port was freed a
crash would result from the double free.
(closes issue #12113)
Reported by: agupta
Patches:
bug12113.patch uploaded by jpeeler (license 325)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@212498 65c4cc65-6c06-0410-ace0-fbb531ad65f3
There already was code present to be sure that a CANCEL will contain the same branch-id
as the INVITE it is cancelling. However, for INVITES which are challenged downstream,
this mechanism did not work properly. Now this is taken care of.
This is a backport of a fix already present in all 1.6.X branches and in trunk. It also
fixes ABE-1907.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@211807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Issue 15655: For the case where dialing is complete for an incoming
call, dahdi_new() was asked to start the PBX and then the code set more
channel variables. If the dialplan hungup before these channel variables
got set, asterisk would likely crash.
* Fixed potential for overlap incoming call to erroneously set channel
variables as global dialplan variables if the ast_channel structure failed
to get allocated.
* Added missing set of CALLINGSUBADDR in the dialing is complete case.
(closes issue #15655)
Reported by: alecdavis
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@210575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Prior to this patch, a wildcard extension in the dialplan (for example, _*.) would take
precedence over picking up a call in the channel's pickup group. This patch simply moves
the block of code handling pickup group matching to above the extension matching code.
(closes issue #14735)
Reported by: stevedavies
Review: https://reviewboard.asterisk.org/r/319/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@210067 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The latest GCC (what will become 4.5.x) has a few new warnings, that in these
cases found some either downright buggy code, or at least seriously poorly
designed code that could be improved.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@209759 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Mostly trivial changes, but I did not know of any other way to fix the
"dereferencing type-punned pointer will break strict-aliasing rules" error
without creating a tmp variable in chan_skinny.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@208746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
For cases where Asterisk sends an INVITE and receives a non 2XX final
response, Asterisk would follow the INVITE transaction by immediately
sending a BYE, which was unnecessary.
(closes issue #14575)
Reported by: chris-mac
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@208587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This generalizes the fix for issue 13849. The initial fix corrected the
problem that Asterisk would reply with a 491 if a reinvite were received
from an endpoint and we had not yet received an ACK from that endpoint
for the initial INVITE it had sent us. This expansion also allows Asterisk
to appropriately handle an INVITE with authorization credentials if Asterisk
had not received an ACK from the previous transaction in which Asterisk had
responded to an unauthorized INVITE with a 407.
(closes issue #14239)
Reported by: klaus3000
Patches:
14239.patch uploaded by mmichelson (license 60)
Tested by: klaus3000
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@208386 65c4cc65-6c06-0410-ace0-fbb531ad65f3
There was already code for other signaling types in dahdi_handle_event to
handle dialing if a dial operation dial string was present. Simply add
SIG_EMWINK to the list.
(closes issue #14434)
Reported by: araasch
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@207827 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit changes the build system so that user-provided flags (in ASTCFLAGS
and ASTLDFLAGS) are supplied to the compiler/linker *after* all flags provided
by the build system itself, so that the user can effectively override the
build system's flags if desired. In addition, ASTCFLAGS and ASTLDFLAGS can now
be provided *either* in the environment before running 'make', or as variable
assignments on the 'make' command line. As a result, the use of COPTS and LDOPTS
is no longer necessary, so they are no longer documented, but are still supported
so as not to break existing build systems that supply them when building Asterisk.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@207647 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch adds a new dahdi_wait function to specifically wait for the wink
event. If the wink is not eventually received the channel is hung up.
(closes issue #14434)
Reported by: araasch
Patches:
emwinkmod uploaded by araasch (license 693)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@207573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Copied from Review board:
In issue 12434, the reporter describes a situation in which audio and video
is offered on the call, but because videosupport is disabled in sip.conf,
Asterisk gives no response at all to the video offer. According to RFC 3264,
all media offers should have a corresponding answer. For offers we do not
intend to actually reply to with meaningful values, we should still reply
with the port for the media stream set to 0.
In this patch, we take note of what types of media have been offered and
save the information on the sip_pvt. The SDP in the response will take into
account whether media was offered. If we are not otherwise going to answer
a media offer, we will insert an appropriate m= line with the port set to 0.
It is important to note that this patch is pretty much a bandage being
applied to a broken bone. The patch *only* helps for situations where video
is offered but videosupport is disabled and when udptl_pt is disabled but
T.38 is offered. Asterisk is not guaranteed to respond to every media offer.
Notable cases are when multiple streams of the same type are offered.
The 2 media stream limit is still present with this patch, too.
In trunk and the 1.6.X branches, things will be a bit different since Asterisk
also supports text in SDPs as well.
(closes issue #12434)
Reported by: mnnojd
Review: https://reviewboard.asterisk.org/r/311
Review: https://reviewboard.asterisk.org/r/313
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@207423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Previously overlap dialing could only be turned on or off for both incoming and
outgoing calls. New parameters incoming, outgoing, and both have been added to
allow further control. There is no change in default behavior with these new
options and allows in band DTMF to be accepted in one direction if required.
(closes issue #14471)
Reported by: eboscani
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@207092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Some ITSP make use of the "Anonymous" display name to detect a
requirement to withhold caller id across the PSTN. This does
not work if the display name is "Unknown".
(closes issue #14465)
Reported by: Nick_Lewis
Patches:
chan_sip.c-callerpres.patch uploaded by Nick (license 657)
chan_sip.c-callerpres_trunk.patch uploaded by dvossel (license 671)
Tested by: Nick_Lewis, dvossel
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@206938 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/be/branches/C.2-...
..........
Fixed chan_misdn crash because mISDNuser library is not thread safe.
With Asterisk the mISDNuser library is driven by two threads concurrently:
1. channels/misdn/isdn_lib.c::manager_event_handler()
2. channels/misdn/isdn_lib.c::misdn_lib_isdn_event_catcher()
Calls into the library are done concurrently and recursively from
isdn_lib.c.
Both threads can fiddle with the master/child layer3_proc_t lists. One
thread may traverse the list when the other interrupts it and then removes
the list element which the first thread was currently handling. This is
exactly what caused the crash. About 60 calls were needed to a Gigaset
CX475 before it occurred once.
This patch adds locking when calling into the mISDNuser library.
This also fixes some cb_log calls with wrong port parameter.
JIRA ABE-1913
Patches: misdn-locking.patch (Modified with mostly cosmetic changes)
..........
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@206706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* issue #14355 - Crash if attempt to transfer a call to an application.
Masquerade the other pair of the four asterisk channels involved in the
two calls. The held call already must be a bridged call (not an
applicaton) or it would have been rejected.
* issue #14692 - Held calls are not automatically cleared after transfer.
Allow the core to initate disconnect of held calls to the ISDN port. This
also fixes a similar case where the party on hold hangs up before being
transferred or taken off hold.
* JIRA ABE-1903 - Orphaned held calls left in music-on-hold.
Do not simply block passing the hangup event on held calls to asterisk
core.
* Fixed to allow held calls to be transferred to ringing calls.
Previously, held calls could only be transferred to connected calls.
* Eliminated unused call states to simplify hangup code.
* Eliminated most uses of "holded" because it is not a word.
(closes issue #14355)
(closes issue #14692)
Reported by: sodom
Patches:
misdn_xfer_v14_r205839.patch uploaded by rmudgett (license 664)
Tested by: rmudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@206487 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r206384 | russell | 2009-07-14 09:45:47 -0500 (Tue, 14 Jul 2009) | 6 lines
Ensure apathetic replies are sent out on the proper socket.
chan_iax2 supports multiple address bindings. The send_apathetic_reply()
function did not attempt to send its response on the same socket that the
incoming message came in on.
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@206385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
From the review board request:
The fix from review 298 has exposed a new bug in chan_sip.
When we hang up an outgoing call, we first will dump all the outstanding
packets on the sip_pvt using __sip_pretend_ack. Then, if we can, we send
a CANCEL. The problem with this is that since destroyed all the outstanding
packets on the dialog, we cannot match the incoming 487 response to our
INVITE. Because we cannot match the response, we do not send an ACK.
To correct this, instead of using __sip_pretend_ack, I have changed the code
to loop through the list of packets and call __sip_semi_ack on each one
instead. This causes us to stop retransmitting the requests, but we still have
them around in case we get responses for them.
When discussing this earlier today with Josh Colp, we both agreed that in the
majority of cases, this would be enough of a fix. However, we also agreed that
we should have a safety net in place in case we never receive a response to
our initial INVITE. To handle this, I have modified __sip_autodestruct to
behave similar to the way it does in Asterisk 1.4. If there are outstanding
packets on the sip_pvt, the needdestroy flag is not set, and the last request
on the dialog was either a CANCEL or BYE, then we set the needdestroy flag and
reschedule destruction for 10 seconds in the future. If, though, the
needdestroy flag is set, then we use __sip_pretend_ack to kill the remaining
outstanding packets so that the monitor thread can destroy the sip_pvt.
I ran two separate tests. First, I placed a call from my Aastra phone to my
Polycom phone. I hung up the Aastra before the Polycom answered. I verified
through sip debug output that Asterisk properly ACKed the 487 received from the
Polycom.
For my second test, I set up a SIPp UAS scenario so that it would send a 200 OK
in response to a CANCEL but would not send a 487 for the original INVITE. I
verified that after about 40 seconds, Asterisk properly cleans up the outgoing
sip_pvt for the call.
Review: https://reviewboard.asterisk.org/r/308
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@205877 65c4cc65-6c06-0410-ace0-fbb531ad65f3
If an endpoint sends two registration requests in a very short
period of time with the same nonce, both receive 401 responses
from Asterisk, each with a different nonce (the second 401
containing the current nonce and the first one being stale).
If the endpoint responds to the first 401, it does not match
the current nonce so Asterisk sends a third 401 with a newly
generated nonce (which updates the current nonce)... Now if
the endpoint responds to the second 401, it does not match the
current nonce either and Asterisk sends a fourth 401 with a
newly generated nonce... This loop goes on and on.
There appears to be a simple fix for this. If the nonce from
the request does not match our nonce, but is a good response
to a previous nonce, instead of sending a 401 with a newly
generated nonce, use the current one instead. This breaks
the loop as the nonce is not updated until a response is
received. Additional logic has been added to make sure no
nonce can be responded to twice though.
(closes issue #15102)
Reported by: Jamuel
Patches:
patch-bug_0015102 uploaded by Jamuel (license 809)
nonce_sip.diff uploaded by dvossel (license 671)
Tested by: Jamuel
Review: https://reviewboard.asterisk.org/r/289/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@205804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
With this change, we make note of Record-Route headers present in any SUBSCRIBE
request that we receive so that our outbound NOTIFY requests will have the proper
Route headers in them.
(closes issue #14725)
Reported by: ibc
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@205775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Add missing clearing of the dialing flag when the ISDN call is CONNECTED.
(i.e. When libpri generates the event PRI_EVENT_ANSWER.)
(closes issue #15420)
Reported by: scottbmilne
Patches:
bug15420-1.4.25.1-diff2.txt uploaded by alecdavis (license 585)
Tested by: scottbmilne, alecdavis
(closes issue #15416)
Reported by: avinoash
(closes issue #15389)
Reported by: alecdavis
This patch should also fix the following issue:
(issue #15205)
Reported by: vinsik
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@205728 65c4cc65-6c06-0410-ace0-fbb531ad65f3
If an incoming mISDN call is answered with the Answer application and a
subsequent Dial gets a busy endpoint then it is valid for that already
connected channel to get the busy indication. Asterisk will play the busy
tones until the dialplan plays something else or hangs up the call.
(closes issue #11974)
Reported by: fvdb
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@204834 65c4cc65-6c06-0410-ace0-fbb531ad65f3
a DNS lookup fails on a host or outboundproxy.
(closes issue #13432)
Reported by: p_lindheimer
Patches:
outboundproxy.patch uploaded by p (license 558)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@204300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
chan_sip has had a problem for quite a long time that would manifest when
Asterisk would send multiple SIP responses on the same dialog before receiving
a response. The problem occurred because chan_sip only kept track of the highest
outgoing sequence number used on the dialog. If Asterisk sent two requests out,
and a response arrived for the first request sent, then Asterisk would ignore
the response. The result was that Asterisk would continue retransmitting the
requests and ignoring the responses until the maximum number of retransmissions
had been reached.
The fix here is to rearrange the code a bit so that instead of simply comparing
the sequence number of the response to our latest outgoing sequence number, we
walk our list of outstanding packets and determine if there is a match. If there is,
we continue. If not, then we ignore the response.
In doing this, I found a few completely useless variables that I have now removed.
(closes issue #11231)
Reported by: flefoll
Review: https://reviewboard.asterisk.org/r/298
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@204243 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Using the SPINLOCK schedule delete macro can result in the iax_pvt lock
being given up. This makes it possible for the iax_pvt to dissappear
when we thought we held the mutex the entire time. To resolve this, the
iax_pvt's ref count is incremented.
(closes issue #15377)
Reported by: aragon
Patches:
iax_spin_issue_1.4.diff uploaded by dvossel (license 671)
Tested by: aragon, dvossel
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@204067 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Before this patch, Asterisk unconditionally picked B channels exclusively
on the CPE side and normally allowed alternative B channels on the network
side. Now Asterisk does the opposite.
Reasons for the CPE side to normally not pick B channels exclusively:
* For CPE point-to-multipoint mode (i.e. phone side), the CPE side does
not have enough information to exclusively pick B channels. (There may be
other devices on the line.)
* Q.931 gives preference to the network side picking B channels.
* Some telcos require the CPE side to not pick B channels exclusively.
(closes issue #14383)
Reported by: mbrancaleoni
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@203908 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This change resolves a crash observed locally during some T.38 testing.
A call was set up using a call file, and when the T.38 reinvite came in,
the channel state was still AST_STATE_DOWN. The reason is explained by
a comment in the code that previously lived in the handling of
AST_STATE_RINGING. This change modifies the logic to handle the same
race condition for any channel state that is not UP.
(closes ABE-1895)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@203115 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Valid format is: pritimer=timer_name,timer_value
* Fixed segfault if the ',' is missing.
* Completely check the range returned by pri_timer2idx() to prevent
possible access outside array bounds.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@203036 65c4cc65-6c06-0410-ace0-fbb531ad65f3
If a CANCEL were received by Asterisk, we would send a 487 in response
to the original INVITE and a 200 OK for the CANCEL. If there were a network
hiccup which caused the 200 OK and the 487 to be lost, then the UA communicating
with Asterisk may try to retransmit its CANCEL. Asterisk's response to this used
to be to try sending another 487 to the canceled INVITE and another 200 OK to the
CANCEL.
The problem here is that the originally-sent 487 was sent "reliably" meaning that
it will be retransmitted until it is received properly. So when we receive the second
CANCEL it is likely that the first batch of 487s we sent is still going strong and
reaches the UA. The result was that the second set of 487s would be retransmitted
constantly until the maximum number of retries had been reached.
The fix for this is that if we receive a second CANCEL for an INVITE, then we cancel
the retransmission of the first set of 487s and start a second set. This causes the
dialog to be terminated reasonably.
(closes issue #14584)
Reported by: klaus3000
Patches:
14584_v2.patch uploaded by mmichelson (license 60)
Tested by: klaus3000
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@202341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
There was a while loop in get_ip_and_port_from_sdp which was controlled
by a call to get_sdp_iterate. The loop would exit either if what we were
searching for was found or if the return was NULL. The problem is that
get_sdp_iterate never returns NULL. This means that if what we were searching
for was not present, the loop would run infinitely. This modification of the
loop fixes the problem.
(closes issue #15213)
Reported by: schmidts
(closes issue #15349)
Reported by: samy
(closes issue #14464)
Reported by: pj
(closes issue #15345)
Reported by: aragon
Patches:
sip_inf_loop.patch uploaded by mmichelson (license 60)
Tested by: aragon
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@202336 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Zombie channels could be passed, and chan_sip.c wasn't checking for it.
Could crash Asterisk. Now checking for NULL pointer.
(closes issue #15330)
Reported by: okrief
Tested by: dbrooks
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@201380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When we receive a SIP reinvite, it is possible that we may not be able to process the
reinvite immediately since we have also sent a reinvite out ourselves. The problem is
that whoever sent us the reinvite may have also sent a reinvite out to another party,
and that reinvite may have succeeded.
As a result, even though we are not going to accept the reinvite we just received, it
is important for us to not have problems if we suddenly start receiving RTP from a new
source. The fix for this is to grab the media source information from the SDP of the
reinvite that we receive. This information is passed to the RTP layer so that it will
know about the alternate source for media.
Review: https://reviewboard.asterisk.org/r/252
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@197588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
If we already have an address for a peer, and we are reloading the sip
configuration, try to use that address to contact the peer, instead of
getting it from the Contact.
(closes issue #15194)
Reported by: ibc
Patches:
sip.patch uploaded by eliel (license 64)
Tested by: manwe
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@197562 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The presence of rport is now stored as a separate flag. Once the dialog is setup and authenticated
(or it passes through unauthenticated) the proper nat flag is set.
(closes issue #13823)
Reported by: dimas
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@197466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
There are rare cases in which a frame's delivery timestamp is slightly less than the iax2_pvt's offset. This causes the pvt's timestamp to be a small negative number, but since the timestamp value is unsigned it looks like a huge positive number. This patch checks for this negative case and sets the ms to zero. A similar check is already done right below this one in the 'else' statement.
(closes issue #15032)
Reported by: guillecabeza
Patches:
chan_iax2.c.patch_timestamp uploaded by guillecabeza (license 380)
Tested by: guillecabeza
(closes issue #14216)
Reported by: Andrey Sofronov
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@195991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
IAX was not sending REGREJ to terminate invalid registrations. Instead it sent another REGAUTH if the authentication challenge failed. This caused a loop of REGREQ and REGAUTH frames.
(Related to Security fix AST-2009-001)
(closes issue #14867)
Reported by: aragon
Tested by: dvossel
(closes issue #14717)
Reported by: mobeck
Patches:
regauth_loop_update_patch.diff uploaded by dvossel (license 671)
Tested by: dvossel
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@194873 65c4cc65-6c06-0410-ace0-fbb531ad65f3
There is a bug tracker issue where people are reporting "Ghost" channels in their 'iax2 show channels' output. The confusion is caused by channels being listed as "(NONE)" with format "unknown". These are not channels of coarse. They are usually just pending registration or poke requests, but it is confusing output. To help make sense of this I have added two columns to 'iax2 show channels'. One shows the first message which started the transaction, and the second shows the last message sent by either side of the call. This helps diagnose why the entry exists and why it may not go away.
(closes issue #14207)
Reported by: clive18
Review: https://reviewboard.asterisk.org/r/246/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@194557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The loop detection/spiral detection code in chan_sip used the owner
channel's state as a criterion for determining if the incoming INVITE
is a looped request. The problem with this is that the INVITE-handling
code happens in a different thread than the thread that marks the owner
channel as being up. As a result, if a reinvite were to come in very quickly,
say from another Asterisk on the same LAN, it was possible for the reinvite
to arrive before the owner channel had been set to the up state.
This patch corrects the problem by using the invitestate of the sip_pvt
instead, since that can be guaranteed to be set correctly by the time
the reinvite arrives. Since there is a switch statement further in the
INVITE-handling code, the AST_STATE_RINGING state also checks the invitestate
of the sip_pvt in case we should actually be treating the channel as if it were
up already.
(closes issue #12215)
Reported by: jpyle
Patches:
12215_confirmed.patch uploaded by mmichelson (license 60)
Tested by: lmadsen
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@194484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The problem was that the hangup code was setting the invitestate too early. The result of
this was that we would always send a CANCEL request, even if it was not an appropriate
time to do so (e.g. we have not yet received a provisional response for our INVITE).
Note that this same fix had been applied to trunk and the 1.6.X branches starting with
revision 155467. This is why you will see this revision being blocked from those places.
AST-216
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@193880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
In the state MISDN_CALLING (i.e. SETUP was sent but no answer has arrived yet),
it is not allowed to clear the call with RELEASE_COMPLETE. It must be
cleared with DISCONNECT. A RELEASE_COMPLETE is only allowed as an answer
to a SETUP. (See Q.931 ch. 5.3.2, 5.3.2.a, 5.3.2.b)
Patches:
chan-misdn-ccstate7.patch uploaded by customer.
JIRA ABE-1862
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@193613 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Added the dialed extension and context to the chan_misdn messages warning
that the dialed number cannot be matched in the dialplan.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@193050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
If the fullcontact field appears in both the sippeers and the
sipregs table, then during reconstruction of the field, it will
otherwise be doubled.
(closes issue #14754)
Reported by: Alexei Gradinari
Patches:
20090506__bug14754.diff.txt uploaded by tilghman (license 14)
Tested by: lmadsen
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@192932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
mohinterpret and mohsuggest global variables were not copied over during build_users and build_peers.
(closes issue #14728)
Reported by: dimas
Patches:
v1-14728.patch uploaded by dimas (license 88)
Tested by: dimas, dvossel
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@192213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
If both sides of a Local channel were hung up at around the same time it was
possible for one thread to destroy the local private structure and have the other thread
immediately try to remove the already freed structure from the local channel list.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@190286 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Previously, packetization settings were ignored and now they are not. A new
config option 'autoframing' has been added to mirror the way chan_sip handles
it. Turning on the autoframing option (available both as a global option or per
peer) overrides the local settings with the remote packetization settings.
Testing was performed with varying packetization levels with the following
codecs: ulaw, alaw, gsm, and g729.
(closes issue #12415)
Reported by: pj
Patches:
2009012200_h323packetization.diff.txt uploaded by mvanbaak (license 7),
modified by me
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@189991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
An agent logs in by calling an extension that calls the AgentLogin app. In agents.conf ackcall=always is set, so when they get a call they have the choice to either acknowledge it or ignore it. autologoff=10 is set as well, so if the agent ignores the call over 10sec one may assume that the agent should be logged out (and in this case hungup on as well), but this was not happening.
(closes issue #14091)
Reported by: evandro
Patches:
autologoff.diff uploaded by dvossel (license 671)
Review: http://reviewboard.digium.com/r/225/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@189203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit fixes the scenario where an incoming call is authenticated
using a peer entry. Previously the channel name was created using either
the username setting from the sip.conf entry or the IP address that the
call came from. Now the channel name will be created using the peer name
itself. This commit will not change the way the channel name is generated
for users or friends.
(closes issue #14256)
Reported by: Nick_Lewis
Patches:
chan_sip.c-chname.patch uploaded by Nick (license 657)
Tested by: Nick_Lewis, file
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@188946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When the caller ID is restricted, the expected behavior is for the caller id to be blank. In chan_dahdi, the national prefix is placed onto the callers number even if its restricted (empty) causing the caller id to be the national prefix rather than blank.
(closes issue #13207)
Reported by: shawkris
Patches:
national_prefix.diff uploaded by dvossel (license 671)
Review: http://reviewboard.digium.com/r/220/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@188646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
RFC 5047 explains the proper course of action to take if a
reINVITE is received before the ACK from a previous invite
transaction. What we are to do is to treat the reINVITE as
if it were both an ACK and a reINVITE and process it normally.
Later, when we receive the ACK we had been expecting, we will
ignore it since its CSeq is less than the current iseqno of
the sip_pvt representing this dialog.
(closes issue #13849)
Reported by: klaus3000
Patches:
13849_v2.patch uploaded by mmichelson (license 60)
Tested by: mmichelson, klaus3000
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@187484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Don't offer AST_FORMAT_SLINEAR on DAHDI/Zaptel channels... while it could provide a slight performance benefit, the translation core in Asterisk has some flaws when a channel driver offers multiple raw formats. this fix is much simpler than fixing the translation core to solve that issue (although that will be done later).
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@186458 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Acknowledgement for 491 responses were never being processed because it didn't match our pending invite's seqno. Since the ACK was never processed, the 491 frame would continue to be retransmitted until eventually the call was dropped due to max retries. Now during a pending invite, if we receive another invite, we send an 491 and hold on to that glare invite's seqno in the "glareinvite" variable for that sip_pvt struct. When ACK's are received, we first check to see if it is in response to our pending invite, if not we check to see if it is in response to a glare invite. In this case, it is in response to the glare invite and must be dealt with or the call is dropped. I've changed the wait time for resending the re-Invite after receving a 491 response to comply with RFC 3261. Before this patch the scheduled re-Invite would only change a flag indicating that the re-Invite should be sent out, now it actually sends it out as well.
(closes issue #12013)
Reported by: alx
Review: http://reviewboard.digium.com/r/213/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@185845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
To drill into the xmpp to find the capabilities between channels, chan_gtalk
calls iks_child() and iks_next(). iks_child() and iks_next() are functions in
the iksemel xml parsing library that traverse xml nodes. The bug here is that
both iks_child() and iks_next() will return the next iks_struct node
*regardless* of type. chan_gtalk expects the next node to be of type IKS_TAG,
which in most cases, it is, but in this case (a call being made from the
Empathy IM client), there exists iks_struct nodes which are not IKS_TAG data
(they are extraneous whitespaces), and chan_gtalk doesn't handle that case,
so capabilities don't match, and a call cannot be made.
iks_first_tag() and iks_next_tag(), on the other hand, will not return the
very next iks_struct, but will check to see if the next iks_struct is of
type IKS_TAG. If it isn't, it will be skipped, and the next struct of type
IKS_TAG it finds will be returned. This assures that chan_gtalk will find
the iks_struct it is looking for.
This fix simply changes all calls to iks_child() and iks_next() to become
calls to iks_first_tag() and iks_next_tag(), which resolves the capability
matching.
The following is a payload listing from Empathy, which, due to the extraneous
whitespace, will not be parsed correctly by iksemel:
<iq from='dbrooksjab@235-22-24-10/Telepathy' to='astjab@235-22-24-10/asterisk' type='set' id='542757715704'> <session xmlns='http://www.google.com/session' initiator='dbrooksjab@235-22-24-10/Telepathy' type='initiate' id='1837267342'> <description xmlns='http://www.google.com/session/phone'> <payload-type clockrate='16000' name='speex' id='96'/>
<payload-type clockrate='8000' name='PCMA' id='8'/>
<payload-type clockrate='8000' name='PCMU' id='0'/>
<payload-type clockrate='90000' name='MPA' id='97'/>
<payload-type clockrate='16000' name='SIREN' id='98'/>
<payload-type clockrate='8000' name='telephone-event' id='99'/>
</description>
</session>
</iq>
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@185362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Channel allocation collisions are not handled by chan_misdn very well.
This patch simply avoids the problem for BRI only.
For PRI, allocation collisions are still possible but less likely since
there are simply more channels available and each end could use a different
allocation strategy.
misdn.conf options available:
te_choose_channel - Use to force the TE side to allocate channels.
method - Specify the channel allocation strategy.
(closes issue #13488)
Reported by: Christian_Pinedo
Patches:
isdn_lib.patch.txt uploaded by crich
Tested by: crich, siepkes, festr
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@185120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
We now answer with matching media streams to what is requested. If an INVITE
is received with both a T38 and RTP media stream this means we answer with both.
For any outgoing calls created as a result of this inbound one no T38 is requested
in the initial INVITE. Instead if we start receiving udptl packets we trigger a
reinvite on the outbound side.
(closes issue #12437)
Reported by: marsosa
Tested by: pinga-fogo, okrief, file, afu
Review: http://reviewboard.digium.com/r/208/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@184947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
If calls were placed using an IP address or hostname the global nat setting was copied over
but was not set on the RTP session itself. This caused the RTP stack to not perform symmetric RTP
actions.
(closes issue #14546)
Reported by: acunningham
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@184565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
A user was having an issue where if an outgoing SIP call was canceled, the SIP device
would remain in use if we had not received any response to the initial INVITE we sent out.
The SIP device would remain in use until the autocongestion timer was exhausted.
I tracked down the cause of this to be the section of code I am removing here. I asked several
people what the purpose of this code was meant to be, but no one could give me any sort of
answer as to why this was here. The person who was having this issue has been using this patch
for several months and it has stopped the problems they have had.
AST-196
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@183115 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Chan_h323 can now be compiled against both the previously supported versions of
OpenH323 as well as the current H.323 Plus (version 1.20.2). The configure
script has been modified to look in the default install location of h323 to
hopefully help avoid using the environment variables OPENH323DIR and PWLIBDIR.
Also, the CLI command "h323 show version" has been added which indicates which
version of h323 is in use.
(closes issue 0011261)
Reported by: vhatz
Patches:
asterisk-1.6.0.6-h323plus.patch uploaded by jthurman (license 614)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@182963 65c4cc65-6c06-0410-ace0-fbb531ad65f3
We have seen a number of problems caused by poll() not working properly on
Mac OSX. If you search around, you'll find a number of references to using
select() instead of poll() to work around these issues. In Asterisk, we've
had poll.c which implements poll() using select() internally. However, we
were still getting reports of problems.
vadim investigated a bit and realized that at least on his system, even
though we were compiling in poll.o, the system poll() was still being used.
So, the primary purpose of this patch is to ensure that we're using the
internal poll() when we want it to be used.
The changes are:
1) Remove logic for when internal poll should be used from the Makefile.
Instead, put it in the configure script. The logic in the configure
script is the same as it was in the Makefile. Ideally, we would have
a functionality test for the problem, but that's not actually possible,
since we would have to be able to run an application on the _target_
system to test poll() behavior.
2) Always include poll.o in the build, but it will be empty if AST_POLL_COMPAT
is not defined.
3) Change uses of poll() throughout the source tree to ast_poll(). I feel
that it is good practice to give the API call a new name when we are
changing its behavior and not using the system version directly in all cases.
So, normally, ast_poll() is just redefined to poll(). On systems where
AST_POLL_COMPAT is defined, ast_poll() is redefined to ast_internal_poll().
4) Change poll() in main/poll.c to be ast_internal_poll().
It's worth noting that any code that still uses poll() directly will work fine
(if they worked fine before). So, for example, out of tree modules that are
using poll() will not stop working or anything. However, for modules to work
properly on Mac OSX, ast_poll() needs to be used.
(closes issue #13404)
Reported by: agalbraith
Tested by: russell, vadim
http://reviewboard.digium.com/r/198/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@182810 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The 16-32 byte random padding at the beginning of an encrypted IAX2 frame turns out to not be all that random at all. This patch calls ast_random to fill the padding buffer with random data. The padding is randomized at the beginning of every encrypted call and for every encrypted retransmit frame.
Review: http://reviewboard.digium.com/r/193/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@182281 65c4cc65-6c06-0410-ace0-fbb531ad65f3
If we receive an INVITE from an endpoint and then later receive a BYE from that
same endpoint before we have sent a final response for the INVITE, then we need
to respond to the INVITE with a 487.
There was logic in the code prior to this commit which seemed to exist solely to
handle this situation, but there was one condition in an if statement which
was incorrect. The only way we would send a 487 was if the sip_pvt had no owner
channel. This made no sense since we created the owner channel when we received
the INVITE, meaning that the majority of the time we would never send the 487.
The 487 being sent should not rely on whether we have created a channel. Its
delivery should be dependent on the current state of the initial INVITE transaction.
With this commit, that logic is now correctly in place.
(closes issue #14149)
Reported by: legranjl
Patches:
14149.patch uploaded by mmichelson (license 60)
Tested by: legranjl
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
If an iax channel is encrypted, and a retransmit frame is sent, that packet's iseqno is updated while it is encrypted. This causes the entire frame to be corrupted. When the corrupted frame is sent, the other side decrypts it and sends a VNAK back because the decrypted frame doesn't make any sense. When we get the VNAK, we look through the sent queue and send the same corrupted frame causing a loop. To fix this, encrypted frames requiring retransmission are decrypted, updated, then re-encrypted. Since key-rotation may change the key held by the pvt struct, the keys used for encryption/decryption are held within the iax_frame to guarantee they remain correct.
(closes issue #14607)
Reported by: stevenla
Tested by: dvossel
Review: http://reviewboard.digium.com/r/192/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181340 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When completing an attended transfer chan_sip does a check to make sure the extension
in the URI portion of the Refer-To header is a local valid extension. We don't actually
need to check this since we know for sure the other channel is already up and talking to
the extension. Some devices do not put the extension in the Refer-To header either, which
can cause the extension check to fail. We now no longer do this check if it is an attended
transfer.
(closes issue #14628)
Reported by: sverre
Patches:
14628.diff uploaded by file (license 11)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181328 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When dtmfmode was set to auto the inband DTMF detector was not setup
on outgoing SIP calls. This caused inband DTMF detection to fail.
The inband DTMF detector is now setup for both dtmfmode inband and auto.
(closes issue #13713)
Reported by: makoto
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The main problem here was that cstdlib was undefining free thereby causing the
proper debug macros to not be used. ast_h323.cxx has been changed to call
ast_free instead to avoid the issue. Because using the ast prefix calls are
a better choice, ast_free_ptr is the new wrapper for free to pass to functions.
Also, a little bit of clean up was done to avoid the debug macros intentionally
being redefined.
(closes issue #13593)
Reported by: pj
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181133 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Now prune_users() and prune_peers() are called instead of reload_config() to prune all users/peers that are realtime. These functions remove all users/peers with the rtfriend and delme flags set. iax2_prune_realtime() also lacked the code to properly delete a single friend. For example. if iax2 prune realtime <friend> was called, only the peer instance would be removed. The user would still remain.
(closes issue #14479)
Reported by: mousepad99
Review: http://reviewboard.digium.com/r/176/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178838 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Since the remote side is not actually subscribing to a specific extension when
subscribing for MWI just skip the check to see if the extension exists. They can't use it
to specify the mailbox either since we require configuration of that in sip.conf
(closes issue #14531)
Reported by: festr
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178205 65c4cc65-6c06-0410-ace0-fbb531ad65f3
During iax2 call negotiation, supported codecs are passed in an Information Element containing a 2 byte field where each bit correlates to a specific codec. In 1.4 only audio codec bits 0-12 are defined, leaving bits 13-15 undefined. By default all bits are enabled unless specified otherwise. Since its a 2 byte field and 13-15 are not defined, these bits are never turned off. In trunk, bits 13-15 are defined, which means 1.4 is advertising support for codecs it does not have when talking to trunk. I fixed this by adding #define for undefined audio codec bits. These bits are then removed from iax2's full bandwidth capabilities.
(closes issue #14283)
Reported by: jcovert
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177696 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Several changes in PTLib have occurred requiring build time detection. Changes
accounted for include the library name change, config option change, install
location change, and a boolean type change which is handled by ast_ptlib.h.
Also, the sed check has been modified to properly work with autoconf >= 2.62.
(closes issue #14224)
Reported by: bergolth
Patches:
asterisk-autoconf-sed.patch uploaded by bergolth (license 661)
asterisk-pwlib-v3.patch uploaded by bergolth (license 661)
Tested by: jpeeler
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177160 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Prior to masquerade, move the group definitions to the channel performing the
masq, so that the group count lingers past the bridge.
(closes issue #14275)
Reported by: kowalma
Patches:
20090216__bug14275.diff.txt uploaded by Corydon76 (license 14)
Tested by: kowalma
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176661 65c4cc65-6c06-0410-ace0-fbb531ad65f3
restarted, instead waiting until the next registration. We're now
caching the qualify across a reload/restart and starting the qualify
immediately upon loading the peer.
(closes issue #14196)
Reported by: pdf
Patches:
20090120__bug14196_1.4.diff.txt uploaded by pdf (license 663)
Tested by: pdf
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176426 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This should have been committed with rev176247, but I missed it. srcupdate frames no longer break out of the native bridge, but are not being sent to the other call leg either. This fixs that.
issue #13749
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176354 65c4cc65-6c06-0410-ace0-fbb531ad65f3
In iax2, when a AST_CONTROL_SRCUPDATE is received it breaks from the native bridge, but since there is no code path to handle srcupdate it just goes to be beginning of the loop. This was causing packet storms of srcupdate frames between servers. Now srcupdate frames do not break the native bridge for processing.
(closes issue #13749)
Reported by: adiemus
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176247 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This issue crept up with subscriptions on the AA50. When an outgoing NOTIFY is sent a new branch value
is created and the Via header is changed to reflect it. Since this was a stringfield a new spot in the
pool was used for the value while the old was left untouched/unused. If the current pool was full a new
pool was created. This would cause memory usage to increase steadily.
(issue #AA50-2332)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This attribute contains a JID that identifies the initiator of the GoogleTalk
voice session. The GoogleTalk client discards Asterisk's replies if the
initiator attribute contains uppercase characters.
(closes issue #13984)
Reported by: jcovert
Patches:
chan_gtalk.2.patch uploaded by jcovert (license 551)
Tested by: jcovert
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
RFC 3263 says to do A record lookups on a hostname
if a port has been specified, so that's what we're
going to do. See section 4.2.
(closes issue #14419)
Reported by: klaus3000
Patches:
patch_chan_sip_nosrvifport_1.4.23.txt uploaded by klaus3000 (license 65)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174282 65c4cc65-6c06-0410-ace0-fbb531ad65f3
and sip_uri_params_cmp()
The reporter didn't actually upload a properly-formed patch, instead a
modified chan_sip.c file was uploaded. I created a patch to determine the
changes, then modified the suggested changes to create a proper fix. The
summary above is a complete description of the changes.
(closes issue #13547)
Reported by: tecnoxarxa
Patches:
chan_sip.c.gz uploaded by tecnoxarxa (license 258)
Tested by: tecnoxarxa
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
With this fix, we only will perform an SRV lookup at the following times:
* The first time we register with a remote registrar
* If we send a REGISTER but do not receive a response
* If the sendto() function returns an error
While I wrote the patch that fixes this issue, a huge amount of credit is due
to Brett Bryant, who wrote the initial patch on which I based this one.
(closes issue #12312)
Reported by: jrast
Patches:
12312.patch uploaded by putnopvut (license 60)
Tested by: blitzrage
Review: http://reviewboard.digium.com/r/132/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Fixes issue with IAX2 transfers not taking place. As it was, a call that was being transfered would never be handed off correctly to the call ends because of how call numbers were stored in a hash table. The hash table, "iax_peercallno_pvt", storing all the current call numbers did not take into account the complications associated with transferring a call, so a separate hash table was required. This second hash table "iax_transfercallno_pvt" handles calls being transfered, once the call transfer is complete the call is removed from the transfer hash table and added to the peer hash table resuming normal operations. Addition functions were created to handle storing, removing, and comparing items in the iax_transfercallno_pvt table.
(issue #13468)
Review: http://reviewboard.digium.com/r/140/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173248 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Added doxygen comments to the major dahdi structures.
* Fixed PRI using an incorrect string value if the extension
delimiter is not present in the Dial() function.
* Fixed some uninitialized string variables on FXS ports.
configs/chan_dahdi.conf.sample
* Updated some documentation.
These changes are already in trunk -r172400
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@172962 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch implements a temporary storage in the pvt and use that instead.
The code is based on ideas from code from Adomjan in issue #13385 (Add support for Reason: header)
Thanks to Klaus Darillion for testing!
(closes issue #14294)
related to issue #13385
Reported by: klaus3000 and adomjan
Patches:
bug14294b.diff uploaded by oej (license 306)
Based on 20080829_chan_sip.c-q850reason_header.patch uploaded by adomjan (license 487)
Tested by: oej, klaus3000
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@172169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
A revision to chan_agent attempted to "inherit" the device
state of the underlying channel in order to report the
device state of an agent channel more accurately.
The problem with the logic here is that it makes no sense to
use this for always-on agents. If the agent is logged in, then
to the underlying channel, the agent will always appear to be
"in use," no matter if the agent is on a call or not. The reason
is that to the underlying channel, the channel is currently in use
on a call to the AgentLogin application.
The most common cause that I found for this issue to occur was for
a SIP channel to be the underlying channel type for an Agent channel.
If the SIP phone re-registers, then the registration will cause the
device state core to query the device state of the SIP channel. Since the
SIP channel is in use, the Agent channel would also inherit this status.
Once the agent channel was set to "in use" there was no way that the device
state could change on that channel unless the agent logged out.
The solution for this problem is a bit different in 1.4 than it is in the
other branches. In 1.4, there will be a one-line fix to make sure that only
callback agents will inherit device state from their underlying channel type.
For the other branches of Asterisk, since callback support has been removed, there
is also no need for device state inheritance in chan_agent, so I will simply be
removing it from the code.
In addition, the 1.4 source is getting a new comment to help the next person who
edits chan_agent.c. I'm adding a comment that a agent_pvt's loginchan field may be
used to determine if the agent is a callback agent or not.
(closes issue #14173)
Reported by: nathan
Patches:
14173.patch uploaded by putnopvut (license 60)
Tested by: nathan, aramirez
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Originally putnopvut implemented some changes in revision 142079 that according to the bug report seemed to have worked then, but somehow fails now.
I guess code, as humans, get old and forget stuff. Anyway, this bug caused CANCEL not to work with picky systems.
Thanks Fredrik for pointing out where the bug in the SIP messaging was.
(closes issue #14346)
Reported by: oej
Patches:
bug14346.diff uploaded by oej (license 306)
Tested by: oej
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The important changes here are related to the synchronization between threads
adding items into the scheduler and the scheduler handling thread. By adjusting
the lock and condition handling, we ensure that the scheduler thread sleeps no
longer and no less than it is supposed to. We also ensure that it does not
wake up more often than it has to.
There is no bug report associated with this. It is just something that I found
while putting scheduler thread handling into a reusable form (review 129).
Review: http://reviewboard.digium.com/r/131/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Move the check for if both channels on a local_pvt have generators to below
where p->chan is checked for NULLity (NULLness?). This prevents a crash from
occurring if p->chan is NULL.
(closes issue #14189)
Reported by: sascha
Patches:
14189.patch uploaded by putnopvut (license 60)
Tested by: sascha
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@169210 65c4cc65-6c06-0410-ace0-fbb531ad65f3
It may be that by the time we receive a reply to a REGISTER request, the attempt has
timed out and thus the registry structure pointed to by the corresponding sip_pvt has
gone away. This situation was handled properly for a 200 OK response, but the 408
case assumed that the sip_registry struct was non-NULL, thus potentially causing a crash
This commit fixes this assumption and prints out a message to the console if we should
receive a late 408 response to a REGISTER
(closes issue #14211)
Reported by: aborghi
Patches:
14211.diff uploaded by putnopvut (license 60)
Tested by: aborghi
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
I found that the allow_multiple_logins function would never return
0 due to an incorrect comparison being used when traversing the
list of agents. While I was modifying this function, I also did
a little bit of coding guidelines cleanup, too.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Reported by: IgorG
Tested by: denisgalvao
This gits rid of the notion of an owning_app allowing the request and hangup to be initiated by different threads. Originating from an active agent channel requires this. The implementation primarily changes __login_exec to wait on a condition variable rather than a lock.
Review: http://reviewboard.digium.com/r/35/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
INFO, NOTIFY, OPTIONS, REFER, and MESSAGE requests
were not checking the topmost Via to determine where
to send the response. Adding check_via calls to those
request handlers solves this.
(closes issue #13071)
Reported by: baron
Patches:
check_via.patch uploaded by baron (license 531)
Tested by: baron
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168128 65c4cc65-6c06-0410-ace0-fbb531ad65f3
There are some boolean attributes for T.38 such
as T38FaxFillBitRemoval, T38FaxTranscodingMMR, and
T38FaxTranscodingJBIG. By simply being present, we
should treat these as a "true" value. The current
code, however, was requiring a 1 or 0 as the value
of the attribute in order to parse it. This is due
to the fact that there are some T.38 endpoints and
gateways that also transmit this information
incorrectly. This patch follows the "be liberal in
what you accept and strict in what you send"
philosophy by accepting both the correctly- and
incorrectly-formatted attributes, but only sending
information as it is supposed to be sent.
It was also discovered that a particular type of
T.38 gateway sends some non-standard T.38 SDP
attributes. Instead of using T38FaxMaxDatagram
and T38MaxBitRate, it used T38MaxDatagram and
T38FaxMaxRate respectively. We now will properly
accept these attributes as well.
Note that there are a lot of patches cited in
the below commit message template. This is
because the person who submitted these patches is
an awesome person and wrote 1.4, 1.6.0, and 1.6.1
variants.
(closes issue #13976)
Reported by: linulin
Patches:
chan_sip.c.1.4-update1.diff uploaded by arcivanov (license 648)
chan_sip.c.1.6.0-update1.diff uploaded by arcivanov (license 648)
chan_sip.c.1.6.1-update1.diff uploaded by arcivanov (license 648)
chan_sip.c.1.4-relaxedT38_update1.diff uploaded by arcivanov (license 648)
chan_sip.c.1.6.0-relaxedT38_update1.diff uploaded by arcivanov (license 648)
chan_sip.c.1.6.1-relaxedT38_update1.diff uploaded by arcivanov (license 648)
Tested by: arcivanov
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167179 65c4cc65-6c06-0410-ace0-fbb531ad65f3
It has been discovered that if a channel is locked prior
to a call to ast_autoservice_stop, then it is likely that
a deadlock will occur. The reason is that the call to
ast_autoservice_stop has a check built into it to be sure
that the thread running autoservice is not currently trying
to manipulate the channel we are about to pull out of
autoservice.
The autoservice thread, however, cannot advance beyond where
it currently is, though, because it is trying to acquire
the lock of the channel for which autoservice is attempting
to be stopped.
The gist of all this is that a channel MUST NOT be locked
when attempting to stop autoservice on the channel.
In this particular case, the channel was locked by a call
to ast_read. A call to ast_exists_extension led to autoservice
being started and stopped due to the existence of dialplan
switches.
It may be that there are future commits which handle the same
symptoms but in a different location, but based on my looks through
the code, it is very rare to see a construct such as this one.
(closes issue #14057)
Reported by: rtrauntvein
Patches:
14057v3.patch uploaded by putnopvut (license 60)
Tested by: rtrauntvein
Review: http://reviewboard.digium.com/r/107/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Reported by: tzafrir
Replace a bunch of if defined checks for Zaptel/DAHDI through several new defines in dahdi_compat.h. This removes a lot of code duplication. Example from bug:
#ifdef HAVE_ZAPTEL
fd = open("/dev/zap/pseudo", O_RDWR);
#else
fd = open("/dev/dahdi/pseudo", O_RDWR);
#endif
is replaced with:
fd = open(DAHDI_FILE_PSEUDO, O_RDRW);
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@165991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
is one of the few things I could find that was just plain wrong.
Even though it probably isn't possible for it to happen, it seems weird
to have code that checks if a pointer is NULL and then immediately dereferences
that pointer if it was NULL.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164977 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The problem was that these variables were being appended to the list of vars
on the sip_pvt every time a re-registration or re-subscription came in.
Since it's just a waste of memory to put them there unless the request was an
INVITE, then the fix is to check the request type before copying the vars.
(closes issue #14037)
Reported by: marvinek
Tested by: russell
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164672 65c4cc65-6c06-0410-ace0-fbb531ad65f3
was initiated but not yet completed. If the bridge is immediately retried,
then we may send a storm of TXREQ packets, even though the first set is sent
reliably (retransmitted). Fixes AST-137.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160570 65c4cc65-6c06-0410-ace0-fbb531ad65f3
"I guess that having only ip-phones in mind is not a good approach. Since it is
possible to have a sip proxy connected to asterisk we could receive a 407
(unauthorized) or 483 (too many hops) as response and dialog ending would not be
a good behavior."
So modified.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160480 65c4cc65-6c06-0410-ace0-fbb531ad65f3
fails, and the resulting integer is garbage. Thus, we must initialize the
integer and check it afterwards for success.
(closes issue #14000)
Reported by: folke
Patches:
asterisk-sipbg-sscanf-1.4.22.diff uploaded by folke (license 626)
asterisk-sipbg-sscanf-1.6.0.1.diff uploaded by folke (license 626)
asterisk-sipbg-sscanf-trunk-r159896.diff uploaded by folke (license 626)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
both have the potential to send control frames in the middle of call setup. We
have to wait until we have received a message back from the remote end before
we try to send any more frames. Otherwise, the remote end will consider it
invalid, and we'll get stuck in an INVAL/VNAK storm.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
since this branch already had some printf format attributes, enable checking for them and tag functions that didn't have them
format attributes in a consistent way
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159808 65c4cc65-6c06-0410-ace0-fbb531ad65f3