https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r220873 | tilghman | 2009-09-29 12:59:26 -0500 (Tue, 29 Sep 2009) | 9 lines
Reduce CPU usage related to building a peer merely for devicestates.
This fixes a 100% CPU problem in the SIP driver, found by profiling
the driver while the problem was occurring.
(closes issue #14309)
Reported by: pkempgen
Patches:
20090924__issue14309.diff.txt uploaded by tilghman (license 14)
Tested by: pkempgen, vrban
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@220906 f38db490-d61c-443f-a65b-d21fe96a405b
Check for remotesecret option was unintentionally always true, which therefore
caused the secret option to never be used. Thanks to dvossel for pointing out
the exact fix.
(closes issue #15943)
Reported by: tpsast
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@220718 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r219450 | dvossel | 2009-09-18 11:19:15 -0500 (Fri, 18 Sep 2009) | 14 lines
via-header branches not updated correctly on INVITE
INVITE requests must always contain a new unique branch id. When
a new branch id is created for an INVITE, the dialog's invite_branch
variable must be updated so CANCEL requests use the correct branch id.
(closes issue #15262)
Reported by: maniax
Patches:
asterisk-1.6.1.0-sip-branch.patch uploaded by tweety (license 608)
invite_new_branch_trunk.diff uploaded by dvossel (license 671)
Tested by: maniax, dvossel
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@219451 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r219303 | dvossel | 2009-09-17 16:29:37 -0500 (Thu, 17 Sep 2009) | 21 lines
INVITE w/Replaces deadlock fix
This patch cleans up the locking logic in chan_sip.c's
handle_invite_replaces() function as well as making use
of ast_do_masquerade() rather than forcing the masquerade
on an ast_read(). The code had several redundant unlocks
that would result in 'freed more times than we've locked!'
errors. I cleaned these up as well as moving all the unlock
logic to the end of the function. This patch should also
resolve the issue people were having with the replacecall
channel never being unlocked with one legged calls.
(closes issue #15151)
Reported by: irroot
Patches:
invite_w_replaces_1.4.diff uploaded by dvossel (license 671)
Tested by: irroot, dvossel
Review: https://reviewboard.asterisk.org/r/371/
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@219304 f38db490-d61c-443f-a65b-d21fe96a405b
This way, we don't always write a null byte into
byte 1 of the buffer
(closes issue #15905)
Reported by: ebroad
Patches:
freadfix.patch uploaded by ebroad (license 878)
Tested by: ebroad
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@218933 f38db490-d61c-443f-a65b-d21fe96a405b
This was preventing responses from being properly processed because the packet was not being found
causing handle_response to return prematurely.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@218918 f38db490-d61c-443f-a65b-d21fe96a405b
In the course of this, I also found that the results of ast_gethostbyname
were being used incorrectly in both chan_iax2 and chan_sip, so both have
been fixed.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@217916 f38db490-d61c-443f-a65b-d21fe96a405b
Related to #12713
Patch by oej
A big thank you to file for finally fixing the transfer() dialplan application.
I've been waiting for years for this. Great work!
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@217482 f38db490-d61c-443f-a65b-d21fe96a405b
parse_uri was not being given the correct scheme's, as
a result, uri parsing did not parse the username correctly.
One of the side effects of this is an empty caller id.
(closes issue #15839)
Reported by: ebroad
Patches:
blank_cidv2.patch uploaded by ebroad (license 878)
parse_uri_fix.diff uploaded by dvossel (license 671)
Tested by: ebroad, dvossel
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216993 f38db490-d61c-443f-a65b-d21fe96a405b
Please follow the structure of the source code, thanks. Chan_sip is messy enough as it is :-)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216917 f38db490-d61c-443f-a65b-d21fe96a405b
- Remove unused string in sip_registry -- "random"
- Someone added a function in the middle of all forward declarations... Weird. Moved it out of that
section.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216905 f38db490-d61c-443f-a65b-d21fe96a405b
- Add variable for number of known media streams instead of hardcoding in definition of sip_pvt
- Rename "text" to "codecs" - beacuse it's what it is
- Add documentation for future developers so that we make sure that we define new sdp media types
for SRTP-variants
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216883 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r216430 | oej | 2009-09-04 15:45:48 +0200 (Fre, 04 Sep 2009) | 27 lines
Make apps send PROGRESS control frame for early media and fix too early media issue in SIP
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: http://svn.digium.com/svn/asterisk/trunk@216438 f38db490-d61c-443f-a65b-d21fe96a405b
There was a problem in the function responsible for doing peer matching by
IP address and port number such that during the second pass for checking for
a peer configured with insecure=port, it would end up treating every peer as
if it had been configured that way. These changes fix the logic in the peer
IP and port comparison callback to handle insecure=port checking properly.
This problem was introduced when SIP peers were converted to astobj2. Many
thanks to dvossel for noticing this while working on another peer matching
issue.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216368 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r215682 | twilson | 2009-09-02 16:41:22 -0500 (Wed, 02 Sep 2009) | 18 lines
Re-send non-100 provisional responses to prevent cancellation
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: http://svn.digium.com/svn/asterisk/trunk@215758 f38db490-d61c-443f-a65b-d21fe96a405b
There are several instances where a port is parsed
from a uri or some other source and converted to
an int value using atoi(), if for some reason the
port string is empty, then a standard port is used.
This logic is used over and over, so I created a function
to handle it in a safer way using sscanf().
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215681 f38db490-d61c-443f-a65b-d21fe96a405b
If we had this from the start, debugging the 'parking not using configured parkinglot'
bug would have been easier.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215665 f38db490-d61c-443f-a65b-d21fe96a405b
Now, the scheme passed to parse_uri can either be a
single scheme, or a list of schemes ',' delimited.
This gets rid of the whole problem of having to create
two buffers and calling parse_uri twice to check for
separate schemes.
Review: https://reviewboard.asterisk.org/r/343/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215522 f38db490-d61c-443f-a65b-d21fe96a405b
keep-alive events are used by Sipura/Linksys for NAT keepalive.
There currently don't appear to be any problems with NAT, but
everytime a keep-alive event is received, Asterisk responds with a
"489 Bad event". This error may indicate to a user that NAT
problems exist just because this even is not supported. Now,
rather than respond with an error, the packet is consumed and
a "200 ok" is sent just to indicate we received the packet.
(issue #15084)
Patches:
chan_sip.keepalive.v1.diff uploaded by IgorG (license 20)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215466 f38db490-d61c-443f-a65b-d21fe96a405b
Thank oej for pointing out the fact that sip_new did not copy parkinglot from the peer
into the newly created channel.
(closes issue #15538)
Reported by: gracedman
Patches:
2009090100_sipnewparkinglot-161.diff.txt uploaded by mvanbaak (license 7)
With mod by me to also fix callparking as well (this uploaded patch only fixed retrieving a parked call)
Tested by: gracedman, mvanbaak
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215462 f38db490-d61c-443f-a65b-d21fe96a405b
Allows characters that are otherwise used as delimiters to be used within
certain fields (like the secret).
(closes issue #15008, closes issue #15672)
Reported by: tilghman
Patches:
20090818__issue15008.diff.txt uploaded by tilghman (license 14)
Tested by: lmadsen, tilghman
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@213098 f38db490-d61c-443f-a65b-d21fe96a405b
This change uses separate values for the acceptable minimum expiry provided by the 423 error and the expiry value stored in the configuration file. Previously, the value pulled from the configuration file would be overwritten.
(closes issue #14366)
Reported by: Nick_Lewis
Patches:
sip-expiry-fix1.diff uploaded by mnicholson (license 96)
chan_sip.c-reqexpiry.patch uploaded by Nick (license 657)
Tested by: mnicholson
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@211876 f38db490-d61c-443f-a65b-d21fe96a405b
Discussion of this subject has yielded that it is not actually acceptable to change
T.38 parameters after the initial reinvite but declining is harsh and can cause the
fax to fail when it may be possible to allow it to continue. This patch changes things
so that additional T.38 reinvites are accepted but parameter changes ignored. This gives
the fax a fighting chance.
(closes issue #15610)
Reported by: huangtx2009
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@210817 f38db490-d61c-443f-a65b-d21fe96a405b
It is clear from multiple mailing list, forum, wiki and other sorts of posts
that users don't really understand the effects that the 'canreinvite' config
option actually has, and that in some cases they think that setting it to 'no'
will actually cause various other features (T.38, MOH, etc.) to not work properly,
when in fact this is not the case. This patch changes the proper name of the
option to what it should have been from the beginning ('directmedia'), but
preserves backwards compatibility for existing configurations.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@210190 f38db490-d61c-443f-a65b-d21fe96a405b
The previous effort here was to store what a peer is capable of receiving by parsing REGISTER
requests from the peer and keeping that information for as long as the registration was active.
The problem with this is that there are a great number of SIP devices which give no indication
of the methods allowed in their REGISTER requests, and it is unreasonable to try to guess what
the device may or may not support. In addition, some SIP devices have been found to claim support
for a specific method, but their handling the method is less than ideal, or they are actually
lying.
With this patch, we now determine what methods a device supports by parsing the Allow header we
receive from them, and we do this with each new dialog. In addition, a configuration option has
been added so that an administrator can essentially blacklist certain methods from being used
with certain peers if the admin knows that support for a specific method is dodgy or nonexistent.
ABE-1822
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@209673 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r208587 | mmichelson | 2009-07-24 13:26:50 -0500 (Fri, 24 Jul 2009) | 10 lines
Only send a BYE when hanging up a channel that is up.
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: http://svn.digium.com/svn/asterisk/trunk@208588 f38db490-d61c-443f-a65b-d21fe96a405b
The udptl-updates branch that was merged yesterday failed to properly send back
T.38 SDP responses with the correct error correction mode, if the incoming SDP
from the other end caused us to change error correction modes. This patch
corrects that situation.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@208548 f38db490-d61c-443f-a65b-d21fe96a405b
Over the past couple of months, a number of issues with Asterisk
negotiating (and successfully completing) T.38 sessions with various
endpoints have been found. This patch attempts to address many of
them, primarily focused around ensuring that the endpoints'
MaxDatagram size is honored, and in addition by ensuring that T.38
session parameter negotiation is performed correctly according to the
ITU T.38 Recommendation.
The major changes here are:
1) T.38 applications in Asterisk (app_fax) only generate/receive IFP
packets, they do not ever work with UDPTL packets. As a result of
this, they cannot be allowed to generate packets that would overflow
the other endpoints' MaxDatagram size after the UDPTL stack adds any
error correction information. With this patch, the application is told
the maximum *IFP* size it can generate, based on a calculation using
the far end MaxDatagram size and the active error correction mode on
the T.38 session. The same is true for sending *our* MaxDatagram size
to the remote endpoint; it is computed from the value that the
application says it can accept (for a single IFP packet) combined with
the active error correction mode.
2) All treatment of T.38 session parameters as 'capabilities' in
chan_sip has been removed; these parameters are not at all like
audio/video stream capabilities. There are strict rules to follow for
computing an answer to a T.38 offer, and chan_sip now follows those
rules, using the desired parameters from the application (or channel)
that wants to accept the T.38 negotiation.
3) chan_sip now stores and forwards ast_control_t38_parameters
structures for tracking 'our' and 'their' T.38 session parameters;
this greatly simplifies negotiation, especially for pass-through
calls.
4) Since T.38 negotiation without specifying parameters or receiving
the final negotiated parameters is not very worthwhile, the
AST_CONTROL_T38 control frame has been removed. A note has been added
to UPGRADE.txt about this removal, since any out-of-tree applications
that use it will no longer function properly until they are upgraded
to use AST_CONTROL_T38_PARAMETERS.
Review: https://reviewboard.asterisk.org/r/310/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@208464 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r208386 | mmichelson | 2009-07-23 14:24:21 -0500 (Thu, 23 Jul 2009) | 17 lines
Fix a problem where a 491 response could be sent out of dialog.
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: http://svn.digium.com/svn/asterisk/trunk@208388 f38db490-d61c-443f-a65b-d21fe96a405b
The registration string can contain an expanded user portion of the
form user@domain. This expanded user portion was stored in
reg->username and parsed each time there is a registration refresh.
Now, the domain portion of the user is parsed and stored separately
in the regdomain field.
(closes issue #14331)
Reported by: Nick_Lewis
Patches:
chan_sip.c.domainparse3.patch uploaded by Nick (license 657)
Tested by: Nick_Lewis, dvossel
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@207484 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r207423 | mmichelson | 2009-07-20 14:39:59 -0500 (Mon, 20 Jul 2009) | 33 lines
Answer video SDP offers properly when videosupport is not enabled.
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: http://svn.digium.com/svn/asterisk/trunk@207424 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r206938 | dvossel | 2009-07-17 11:05:06 -0500 (Fri, 17 Jul 2009) | 14 lines
SIP incorrect From: header information when callpres is prohib
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: http://svn.digium.com/svn/asterisk/trunk@206939 f38db490-d61c-443f-a65b-d21fe96a405b
A domain only sip uri <sip:123.123.123.123> would return
123.123.123.123 as callid num. Now, if the username is
missing from a uri, the callerid num field is left empty.
(closes issue #15476)
Reported by: viraptor
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@206702 f38db490-d61c-443f-a65b-d21fe96a405b
If callbackextension is defined for a peer it successfully causes
a registration to occur, but the registration ignores the
outboundproxy settings for the peer. This patch allows the
peer to be passed to obproxy_get() in transmit_register().
(closes issue #14344)
Reported by: Nick_Lewis
Patches:
callbackextension_peer_trunk.diff uploaded by dvossel (license 671)
Tested by: dvossel
Review: https://reviewboard.asterisk.org/r/294/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@205985 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r205804 | dvossel | 2009-07-10 11:23:59 -0500 (Fri, 10 Jul 2009) | 31 lines
SIP registration auth loop caused by stale nonce
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: http://svn.digium.com/svn/asterisk/trunk@205840 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r205775 | mmichelson | 2009-07-10 10:51:36 -0500 (Fri, 10 Jul 2009) | 10 lines
Ensure that outbound NOTIFY requests are properly routed through stateful proxies.
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: http://svn.digium.com/svn/asterisk/trunk@205776 f38db490-d61c-443f-a65b-d21fe96a405b
Recent changes in T.38 negotiation in Asterisk caused these applications to
not respond when the other endpoint initiated a switchover to T.38; this
resulted in the T.38 switchover failing, and the FAX attempt to be made
using an audio connection, instead of T.38 (which would usually cause the
FAX to fail completely).
This patch corrects this problem, and the applications will now correctly
respond to the T.38 switchover request. In addition, the response will include
the appopriate T.38 session parameters based on what the other end offered
and what our end is capable of.
(closes issue #14849)
Reported by: afosorio
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@205696 f38db490-d61c-443f-a65b-d21fe96a405b
First of all, the code was unnecessary. The goal was to lock a channel
which was already locked. Second, the assumption of the deadlock avoidance
loop was that the sip_pvt was already locked and we were trying to get the
channel lock. The problem is that the sip_pvt was unlocked a few lines above.
Basically, I'm removing 5 lines of no-op.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@204530 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r204300 | mmichelson | 2009-06-29 17:45:34 -0500 (Mon, 29 Jun 2009) | 9 lines
Add error message so that it is clear why a SIP peer was not processed when
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: http://svn.digium.com/svn/asterisk/trunk@204301 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r204243 | mmichelson | 2009-06-29 16:23:43 -0500 (Mon, 29 Jun 2009) | 22 lines
Fix a problem where chan_sip would ignore "old" but valid responses.
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
........
r204246 | mmichelson | 2009-06-29 16:37:05 -0500 (Mon, 29 Jun 2009) | 3 lines
Fix build oops.
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@204247 f38db490-d61c-443f-a65b-d21fe96a405b
CEL is the new system for logging channel events. This was inspired after
facing many problems trying to represent what is possible to happen to a call
in Asterisk using CDR records. For more information on CEL, see the built in
HTML or PDF documentation generated from the files in doc/tex/.
Many thanks to Steve Murphy (murf) and Brian Degenhardt (bmd) for their hard
work developing this code. Also, thanks to Matt Nicholson (mnicholson) and
Sean Bright (seanbright) for their assistance in the final push to get this
code ready for Asterisk trunk.
Review: https://reviewboard.asterisk.org/r/239/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@203638 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r203115 | russell | 2009-06-25 11:02:16 -0500 (Thu, 25 Jun 2009) | 11 lines
Resolve a crash related to a T.38 reinvite race condition.
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: http://svn.digium.com/svn/asterisk/trunk@203116 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r202341 | mmichelson | 2009-06-22 09:42:55 -0500 (Mon, 22 Jun 2009) | 26 lines
Fix a situation in which Asterisk would not stop retransmitting 487s.
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
........
r202342 | mmichelson | 2009-06-22 09:44:58 -0500 (Mon, 22 Jun 2009) | 3 lines
Remove an extra debug line left from previous commit.
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@202343 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r202336 | mmichelson | 2009-06-22 09:34:05 -0500 (Mon, 22 Jun 2009) | 25 lines
Fix a possible infinite loop in SDP parsing during glare situation.
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: http://svn.digium.com/svn/asterisk/trunk@202337 f38db490-d61c-443f-a65b-d21fe96a405b
If a transport type was specified, but no extension, parsing of the extension would return whatever was after the transport rather than defaulting to 's'.
(closes issue #15111)
Reported by: ffs
Patches:
chan_sip.c_register-parser.patch uploaded by ffs (license 730)
Tested by: ffs, dvossel
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@201570 f38db490-d61c-443f-a65b-d21fe96a405b
A recent change to our SDP version comparison made audio not function
on some calls. This was because of a test wherein we were trying to
see if an unsigned value was less than 0. This is a dumb comparison
and arguably the compiler should have warned about it. Alas, though,
it slipped past. Now it's fixed by changing the variable to be a
signed type.
Found by several developers. Tested by mnicholson and dbrooks.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@201462 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r201380 | dbrooks | 2009-06-17 13:45:50 -0500 (Wed, 17 Jun 2009) | 9 lines
Checks for NULL sip_pvt pointer in chan_sip.c->acf_channel_read()
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: http://svn.digium.com/svn/asterisk/trunk@201381 f38db490-d61c-443f-a65b-d21fe96a405b
During a sip reload, the list of sip_registry objects are
supposed to be traversed, unlinked, and destroyed, but
destruction never takes place due to a ref counting error.
This causes a memory leak when registry items are removed
from sip.conf and reloaded. While the registries are removed
from the global list, they are not removed from the scheduler.
Because of this, SIP register attempts continue to be sent
out for the item even though it may no longer be in the .conf.
(closes issue #15295)
Reported by: amorsen
Review: https://reviewboard.asterisk.org/r/282/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@201344 f38db490-d61c-443f-a65b-d21fe96a405b
Some applications (notably app_fax) do not need digit detection nor FAX tone
detection while they are running, and if Asterisk is using software DSPs to provide
the detection, this consumes extra CPU cycles that could be better spent on the
actual application. This patch allows applications to query and control the state
of digit and tone detection on a channel, and modifies app_fax to disable them
while the FAX operations are occurring (and re-enable digit detection afterwards).
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@201139 f38db490-d61c-443f-a65b-d21fe96a405b
What this patch addresses:
1. ast_sip_ouraddrfor() by default binds to the UDP address/port
reguardless if the sip->pvt is of type UDP or not. Now when no
remapping is required, ast_sip_ouraddrfor() checks the sip_pvt's
transport type, attempting to set the address and port to the
correct TCP/TLS bindings if necessary.
2. It is not necessary to send the port number in the Contact
header unless the port is non-standard for the transport type.
This patch fixes this and removes the todo note.
3. In sip_alloc(), the default dialog built always uses transport
type UDP. Now sip_alloc() looks at the sip_request (if present)
and determines what transport type to use by default.
4. When changing the transport type of a sip_socket, the file
descriptor must be set to -1 and in some cases the tcptls_session's
ref count must be decremented and set to NULL. I've encountered
several issues associated with this process and have created a function,
set_socket_transport(), to handle the setting of the socket type.
(closes issue #13865)
Reported by: st
Patches:
dont_add_port_if_tls.patch uploaded by Kristijan (license 753)
13865.patch uploaded by mmichelson (license 60)
tls_port_v5.patch uploaded by vrban (license 756)
transport_issues.diff uploaded by dvossel (license 671)
Tested by: mmichelson, Kristijan, vrban, jmacz, dvossel
Review: https://reviewboard.asterisk.org/r/278/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@200946 f38db490-d61c-443f-a65b-d21fe96a405b
This commit changes the 'incoming SDP version' check logic a bit more; when
'ignoresdpversion' is *not* set for a peer, if we initiate a re-INVITE to
switch to T.38, we'll always accept the peer's SDP response, even if they
don't properly increment the SDP version number as they should. If this situation
occurs, a warning message will be generated suggesting that the peer's
configuration be changed to include the 'ignoresdpversion' configuration option
(although ideally they'd fix their SIP implementation to be RFC compliant).
AST-221
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@200689 f38db490-d61c-443f-a65b-d21fe96a405b
These modules all contained variables that are module-global but not system-global,
but were not marked 'static'.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@200587 f38db490-d61c-443f-a65b-d21fe96a405b
Using the 'pahole' tool, it is now quite easy to see where structure fields
could be organized differently to keep the compiler from having to add
padding to satisfy alignment requirements. These changes reduced the sizes of
sip_pvt and sip_peer by a few bytes each (on 64-bit platforms), and also fixed
a spelling error in a field name.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@200584 f38db490-d61c-443f-a65b-d21fe96a405b
SIP's cli NOTIFY command only used UDP rather than copying the transport type from the peer.
(closes issue #15283)
Reported by: jthurman
Patches:
sip-notify-tcp-svn199728.patch uploaded by jthurman (license 614)
Tested by: jthurman, dvossel
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@199818 f38db490-d61c-443f-a65b-d21fe96a405b
When connected line updates are received or generated in the middle
of an application call, it is now possible to execute a macro to
manipulate the connected line data. This way, phone numbers may be
manipulated to be more presentable to users, names may be changed
for...whatever reason, or whatever else needs to be done may be.
Review: https://reviewboard.asterisk.org/r/256
AST-165
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@198727 f38db490-d61c-443f-a65b-d21fe96a405b
* Set the invitestate to INV_CALLING when we send a connected line reinvite.
This prevents us from potentially rapid-firing reinvites to a single peer.
* Use the astdb to store a peer's allowed methods. This prevents us from sending
an UPDATE during the interval between startup and the peer's first registration
if the peer does not support the UPDATE method.
* Handle Polycom's method of indicating allowed methods in REGISTER. Instead of
using an Allow header, they place the allowed methods in a methods= parameter
in the Contact header.
ABE-1873
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@197959 f38db490-d61c-443f-a65b-d21fe96a405b
This makes sure that we mark a method as being unallowed if we
receive a 405 response so that we don't continue to try to
send that same type of message.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@197740 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r197562 | eliel | 2009-05-28 11:21:32 -0400 (Thu, 28 May 2009) | 13 lines
Use the address we already know when reloading a peer with nat=yes.
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: http://svn.digium.com/svn/asterisk/trunk@197621 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r197466 | file | 2009-05-28 10:44:58 -0300 (Thu, 28 May 2009) | 8 lines
Fix a bug where the flag indicating the presence of rport would get overwritten by the nat setting.
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: http://svn.digium.com/svn/asterisk/trunk@197467 f38db490-d61c-443f-a65b-d21fe96a405b
Previously they always set hangupcause 0, which is generally wrong. With this
change, we're setting some generic hangup causes. For 5xx errors, which indicate
some sort of problem with the remote server, we're now setting CONGESTION.
EDVX002
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@197266 f38db490-d61c-443f-a65b-d21fe96a405b
In sip.conf the transport option allows for the configuration of what transport types (udp, tcp, and tls) a peer will accept, but only the first type listed was used for outbound connections. This patch changes this. Now the default transport type is only used until the peer registers. When registration takes place the transport type is parsed out of the Contact header. If the Contact header's transport type is equal to one that the peer supports, the peer's default transport type for outbound connections is set to match the Contact header's type. If the Contact header's transport type is not present, then the peer's default transport type is set to match the one the peer registered with. When a peer unregisters or the registration expires, the default transport type for that peer is reset.
(closes issue #12282)
Reported by: rjain
Patches:
reg_patch_1.diff uploaded by dvossel (license 671)
Tested by: dvossel
(closes issue #14727)
Reported by: pj
Patches:
reg_patch_3.diff uploaded by dvossel (license 671)
Tested by: pj, dvossel
Review: https://reviewboard.asterisk.org/r/249/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196416 f38db490-d61c-443f-a65b-d21fe96a405b
A new xml element was created to manage the AMI actions documentation,
using AstXML.
To register a manager action using XML documentation it is now possible
using ast_manager_register_xml().
The CLI command 'manager show command' can be used to show the parsed
documentation.
Example manager xml documentation:
<manager name="ami action name" language="en_US">
<synopsis>
AMI action synopsis.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(...)" /> <-- for ActionID
<parameter name="header1" required="true">
<para>Description</para>
</parameter>
...
</syntax>
<description>
<para>AMI action description</para>
</description>
<see-also>
...
</see-also>
</manager>
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196308 f38db490-d61c-443f-a65b-d21fe96a405b
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes:
- CLI command handlers
- CLI command handler arguments
- AGI command handlers
- AGI command handler arguments
- Dialplan application handler arguments
- Speech engine API function arguments
In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing.
Review: https://reviewboard.asterisk.org/r/251/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196072 f38db490-d61c-443f-a65b-d21fe96a405b
When receiving a 200 OK response to an INVITE, it was possible to transmit two
connected line updates instead of a single one. Furthermore, the second did not
have the proper information present.
Now the two have been combined into a single update and the correct information
is presented.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@195798 f38db490-d61c-443f-a65b-d21fe96a405b
SIP purists may want to look the other way...
When COLP/CONP support for SIP was committed, there was a condition under
which Asterisk may transmit a SIP UPDATE in order to communicate the change
in connected line information. The issue here is that while we could send a
SIP UPDATE message, we were not prepared to receive such an UPDATE and would
always responde with a 501 when we received an UPDATE.
The situation was a bit rough. We really want to be able to receive UPDATEs
having to do with connected line changes, but the amount of effort involved
in properly supporting RFC 3311 was staggering. This commit represents a
compromise.
First, it was decided that it is important to only send a SIP UPDATE to
an endpoint that is able to handle one. So, now we have added parsing of
the Allow header into SIP. We store the allowed methods on SIP peers so
that when we communicate with them, we already will know what we can and
cannot send to them. We will parse the peer's allowed methods when he registers
with us. If the peer is not the type to register with us, but the qualify option
is enabled, then we will use the response to the OPTIONS request we send
the peer to determine the peer's allowed methods. When the peer's registration
expires, or when qualify deems the peer to be unreachable, we clear the allowed
methods from the peer.
For an actual call, we will copy the peer's allowed methods to the sip_pvt
representing the call leg. If we are communicating with an endpoint which is
not a peer, then we will just parse the Allow header from the first message
we receive during the call and store the information in the sip_pvt.
If, during communication with a peer, we receive a 501 response, then we will
make sure to save the fact that we cannot use that method when communicating
with that peer.
Now, with all that infrastructure in place, the only actual place we use this
information currently is when attempting to send a connected line change using
an UPDATE request. If we cannot send the change immediately using an UPDATE,
we will set the SIP_NEEDREINVITE flag so that we can send a REINVITE as soon
as it is allowed.
The second part of the changes here is for Asterisk to accept UPDATE requests
that have connected line changes. Since we are not fully supporting RFC 3311,
Asterisk will NOT place the UPDATE method in Allow headers it sends. Instead,
if you are communicating with what you know to be another Asterisk box, you may
set the rpid_update parameter in sip.conf so that we will send UPDATEs to that
Asterisk box. When we send a connected line update, we set a custom header
called "X-Asterisk-rpid-update."
On the receiving end, if Asterisk receives an UPDATE that does not have the
"X-Asterisk-rpid-update" header present, then Asterisk will respond with a 501
since media-changing UPDATEs are not supported. We should never get such
UPDATEs, since as was stated earlier, Asterisk does not put UPDATE in its Allow
header. If the custom header is present in the received UPDATE, though, then we
will check the incoming request for connected line updates and queue the update
on the channel where the change occurred.
ABE-1840
ABE-1822
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@195589 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r194484 | mmichelson | 2009-05-14 17:17:55 -0500 (Thu, 14 May 2009) | 24 lines
Fix a race condition where a reinvite could trigger a 482 response.
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: http://svn.digium.com/svn/asterisk/trunk@194496 f38db490-d61c-443f-a65b-d21fe96a405b
In 1.4, a SIP spiral is treated the same way as a call forward. This
works much better than what is currently in trunk and 1.6.X. The code
in trunk and 1.6.X did not create a new call to the recipient of the spiral,
instead trying to continue the same call. In addition to just being plain
wrong, this also had the side effect of only being able to spiral calls
to other SIP channels.
With this in place, as long as call forwards are honored, SIP spirals
will work properly. This means that it will work for outbound calls
made by the Queue, Dial, and Page applications. For originated calls and
spool calls, however, the spiral will not work properly until a generic
call forward mechanism is introduced into Asterisk.
(relates to issue #13630)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@193954 f38db490-d61c-443f-a65b-d21fe96a405b
find_peer() does not find a valid peer when using pvt->recv as the sockaddr_in argument. Because of the way TCP works, the port number in pvt->recv is not what we're looking for at all. There is currently only one place that find_peer searches for a peer using the sockaddr_in argument. If the peer is not found after using pvt->recv (works for UDP since the port number will be correct), a temp sockaddr_in struct is made using the Contact header in the sip_request. This has the correct port number in it.
Review: http://reviewboard.digium.com/r/236/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@193387 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r192932 | tilghman | 2009-05-07 11:29:08 -0500 (Thu, 07 May 2009) | 10 lines
Eliminate repetition of fullcontact during reconstruction.
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: http://svn.digium.com/svn/asterisk/trunk@192933 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r192633 | file | 2009-05-06 10:30:51 -0300 (Wed, 06 May 2009) | 7 lines
Update some old logic to stop both begin and end DTMF frames from reaching the core if rfc2833 is not enabled.
(closes issue #15036)
Reported by: dimas
Patches:
v1-15036.patch uploaded by dimas (license 88)
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@192634 f38db490-d61c-443f-a65b-d21fe96a405b
The local struct ast_party_connected_line connected_caller variable
was uninitialized when the copy function was called.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@192590 f38db490-d61c-443f-a65b-d21fe96a405b
If an incoming call authenticated as a user or peer and t38pt_udptl was
not set to yes in general then no UDPTL session would be present and any
T38 related things would fail. This commit changes it so that if after
authenticating T38 is enabled but no UDPTL session is present one will be
created.
(issue AST-215)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@192387 f38db490-d61c-443f-a65b-d21fe96a405b
ast_tls_read_conf() is a new api call for handling SSL/TLS options across all conf files. Before this change, SSL/TLS options were not consistent. http.conf and manager.conf required the 'ssl' prefix while sip.conf used options with the 'tls' prefix. While the options had different names in different conf files, they all did the exact same thing. Now, instead of mixing 'ssl' or 'tls' prefixes to do the same thing depending on what conf file you're in, all SSL/TLS options use the 'tls' prefix. For example. 'sslenable' in http.conf and manager.conf is now 'tlsenable' which matches what already existed in sip.conf. Since this has the potential to break backwards compatibility, previous options containing the 'ssl' prefix still work, but they are no longer documented in the sample.conf files. The change is noted in the CHANGES file though.
Review: http://reviewboard.digium.com/r/237/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@191028 f38db490-d61c-443f-a65b-d21fe96a405b
Adds option to specify a private key .pem file when configuring TLS or SSL in AMI, HTTP, and SIP. Before this, the certificate file was used for both the public and private key. It is possible for this file to hold both, but most configurations allow for a separate private key file to be specified. Clarified in .conf files how these options are to be used. The current conf files do not explain how the private key is handled at all, so without knowledge of Asterisk's TLS implementation, it would be hard to know for sure what was going on or how to set it up.
Review: http://reviewboard.digium.com/r/234/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@190545 f38db490-d61c-443f-a65b-d21fe96a405b
There is a lot that could be said about this, but the patch is a big
improvement for performance, stability, code maintainability,
and ease of future code development.
The channel list is no longer an unsorted linked list. The main container
for channels is an astobj2 hash table. All of the code related to searching
for channels or iterating active channels has been rewritten. Let n be
the number of active channels. Iterating the channel list has gone from
O(n^2) to O(n). Searching for a channel by name went from O(n) to O(1).
Searching for a channel by extension is still O(n), but uses a new method
for doing so, which is more efficient.
The ast_channel object is now a reference counted object. The benefits
here are plentiful. Some benefits directly related to issues in the
previous code include:
1) When threads other than the channel thread owning a channel wanted
access to a channel, it had to hold the lock on it to ensure that it didn't
go away. This is no longer a requirement. Holding a reference is
sufficient.
2) There are places that now require less dealing with channel locks.
3) There are places where channel locks are held for much shorter periods
of time.
4) There are places where dealing with more than one channel at a time becomes
_MUCH_ easier. ChanSpy is a great example of this. Writing code in the
future that deals with multiple channels will be much easier.
Some additional information regarding channel locking and reference count
handling can be found in channel.h, where a new section has been added that
discusses some of the rules associated with it.
Mark Michelson also assisted with the development of this patch. He did the
conversion of ChanSpy and introduced a new API, ast_autochan, which makes it
much easier to deal with holding on to a channel pointer for an extended period
of time and having it get automatically updated if the channel gets masqueraded.
Mark was also a huge help in the code review process.
Thanks to David Vossel for his assistance with this branch, as well. David
did the conversion of the DAHDIScan application by making it become a wrapper
for ChanSpy internally.
The changes come from the svn/asterisk/team/russell/ast_channel_ao2 branch.
Review: http://reviewboard.digium.com/r/203/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@190423 f38db490-d61c-443f-a65b-d21fe96a405b
If transport in sip.conf is switched from UDP to TCP, Asterisk segfaults right after issuing a sip reload. The problem is the socket type is changed to TCP but the fd may still be present for UDP. Later, when the TCP session should be created or set using an existing one, it isn't because the old file descriptor is still present. Now every time transport is changed during a sip.conf reload, the file descriptor is set to -1, signifying it must be created or found.
(closes issue #14727)
Reported by: pj
Tested by: dvossel
Review: http://reviewboard.digium.com/r/229/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@189771 f38db490-d61c-443f-a65b-d21fe96a405b
This issue crept up because of a reference count issue on non-UDP based dialogs.
The dialog reference count was increased when transmitting a packet reliably but never
decreased. This caused the dialog structure to hang around despite being unlinked from
the dialogs container.
(closes issue #14919)
Reported by: vrban
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@189350 f38db490-d61c-443f-a65b-d21fe96a405b
If one attempts to use the attended transfer button on a SIP phone
to transfer an unbridged call (such as a call to an IVR) but hangs
up while the target of the transfer is still ringing, we need to not
crash.
The problem was that ast_hangup was called from outside the channel
thread.
AST-211
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@189097 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r188946 | file | 2009-04-17 11:41:25 -0300 (Fri, 17 Apr 2009) | 15 lines
Fix a bug where a value used to create the channel name was bogus.
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: http://svn.digium.com/svn/asterisk/trunk@188947 f38db490-d61c-443f-a65b-d21fe96a405b
What I've done here is simply break up how a state NOTIFY is built. Originally both the XML and sip header information were built within the same function. While this does work, it does not allow for the creation of multipart/related message bodies that can contain multiple XML entries with only one sip header. Now a separate function builds the XML for each notify. This patch also makes maintaining and modifying state notifications in the future much less of a pain.
Review: http://reviewboard.digium.com/r/224/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@188742 f38db490-d61c-443f-a65b-d21fe96a405b
Per discussion with oej on IRC we need the actual IP address, not the
outbound proxy IP address, in the sa field. This change matches the already
existing code for all other uses of the outbound proxy setting.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@188247 f38db490-d61c-443f-a65b-d21fe96a405b
Copy the outbound proxy IP address into the SIP dialog structure as the IP address we will
be sending to. This has to be done because the logic that determines what local IP address to use
in the SIP messages is not aware of an outbound proxy being in place. It only knows what IP address
we are sending to.
(closes issue #12006)
Reported by: mnicholson
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@188067 f38db490-d61c-443f-a65b-d21fe96a405b
This allows for you to change the From header for outgoing MWI
NOTIFY requests. Prior to this, the best you could do was to
set a callerid in the general section of sip.conf. The problem
was that this was used for all outbound requests, not just
MWI NOTIFY requests.
AST-201
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@187560 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r187484 | mmichelson | 2009-04-09 13:51:20 -0500 (Thu, 09 Apr 2009) | 18 lines
Handle a SIP race condition (reinvite before an ACK) properly.
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: http://svn.digium.com/svn/asterisk/trunk@187488 f38db490-d61c-443f-a65b-d21fe96a405b
This was accomplished using a set of options and the setoption channel callback.
The core calls into the channel driver using these options and the channel driver
either returns success or failure.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@187360 f38db490-d61c-443f-a65b-d21fe96a405b
While browsing chan_sip the other day, I noticed this dangerous code in
dialog_needdestroy(). This function is an ao2_callback. It is absolutely
_not_ okay to unlock the container from within this function. It's also not
clear why it was useful. Given that it could cause memory corruption, I have
removed it.
There was also a TODO comment left describing a potential implementation of
an improvement to the needdestroy handling. I'm not convinced that what was
described is the best choice here, so I have briefly described the way that
this function is used today that could be improved.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@186928 f38db490-d61c-443f-a65b-d21fe96a405b
a dialplan variable.
This adds a dialplan variable (SIP_CODEC_OUTBOUND) which controls
the codec offered for an outgoing SIP call. This is much like the
SIP_CODEC dialplan variable and has the same restrictions. The codec
set must be one that is configured for the call.
(closes issue #13243)
Reported by: samdell3
Patches:
13243.diff uploaded by file (license 11)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@186624 f38db490-d61c-443f-a65b-d21fe96a405b
The channel drivers which have been most heavily tested with these enhancements are
chan_sip and chan_misdn. Further work is being done to add Q.SIG support and will be
introduced in a later commit. chan_skinny has code added to it here, but according
to user pj, the support on chan_skinny is not working as of now. This will be fixed in
a later commit.
A special thanks goes out to bugtracker user gareth for getting the ball rolling and
providing the initial support for this work. Without his initial work on this, this would
not have been nearly as painless as it was.
This functionality has been tested by Digium's product quality department, as well as a
customer site running thousands of calls every day. In addition, many many many many bugtracker
users have tested this, too.
(closes issue #8824)
Reported by: gareth
Review: http://reviewboard.digium.com/r/201
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@186525 f38db490-d61c-443f-a65b-d21fe96a405b
This API call now waits for a special frame from the underlying channel driver to
indicate success or failure. This allows the return value to truly convey whether
the transfer worked or not. In the case of the Transfer() dialplan application this
means the value of the TRANSFERSTATUS dialplan variable is actually true.
(closes issue #12713)
Reported by: davidw
Tested by: file
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@186382 f38db490-d61c-443f-a65b-d21fe96a405b
This API provides a generic way for multiple RTP stacks to be
integrated into Asterisk. Right now there is only one present, res_rtp_asterisk,
which is the existing Asterisk RTP stack. Functionality wise this commit
performs the same as previously. API documentation can be viewed in the
rtp_engine.h header file.
Review: http://reviewboard.digium.com/r/209/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@186078 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r185845 | dvossel | 2009-04-01 14:02:00 -0500 (Wed, 01 Apr 2009) | 10 lines
Fixes issue with dropped calles due to re-Invite glare and re-Invites never executing after a 491
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: http://svn.digium.com/svn/asterisk/trunk@185846 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r184947 | file | 2009-03-30 11:35:47 -0300 (Mon, 30 Mar 2009) | 14 lines
Improve our handling of T38 in the initial INVITE from a device.
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: http://svn.digium.com/svn/asterisk/trunk@184948 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r184565 | file | 2009-03-27 10:06:45 -0300 (Fri, 27 Mar 2009) | 9 lines
Fix an issue where nat=yes would not always take effect for the RTP session on outgoing calls.
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: http://svn.digium.com/svn/asterisk/trunk@184566 f38db490-d61c-443f-a65b-d21fe96a405b
This code comes from svn/asterisk/team/russell/event_performance/.
Here is a summary of the changes that have been made, in order of both
invasiveness and performance impact, from smallest to largest.
1) Asterisk 1.6.1 introduces some additional logic to be able to handle
distributed device state. This functionality comes at a cost.
One relatively minor change in this patch is that the extra processing
required for distributed device state is now completely bypassed if
it's not needed.
2) One of the things that I noticed when profiling this code was that a
_lot_ of time was spent doing string comparisons. I changed the way
strings are represented in an event to include a hash value at the front.
So, before doing a string comparison, we do an integer comparison on the
hash.
3) Finally, the code that handles the event cache has been re-written.
I tried to do this in a such a way that it had minimal impact on the API.
I did have to change one API call, though - ast_event_queue_and_cache().
However, the way it works now is nicer, IMO. Each type of event that
can be cached (MWI, device state) has its own hash table and rules for
hashing and comparing objects. This by far made the biggest impact on
performance.
For additional details regarding this code and how it was tested, please see the
review request.
(closes issue #14738)
Reported by: russell
Review: http://reviewboard.digium.com/r/205/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184339 f38db490-d61c-443f-a65b-d21fe96a405b
If we receive a T38 request negotiate control frame we should only attempt to do so
if the option is enabled on the dialog.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184280 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r183115 | mmichelson | 2009-03-19 11:04:02 -0500 (Thu, 19 Mar 2009) | 14 lines
Fix an issue where cancelled outgoing SIP calls would erroneously report the device as "in use."
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: http://svn.digium.com/svn/asterisk/trunk@183117 f38db490-d61c-443f-a65b-d21fe96a405b
Previously we reached across the channel bridge to get the other party's SIP dialog
structure in order to trigger an outgoing reinvite. This is extremely dangerous to do
and only works if bridged to another SIP channel. This patch changes this to use the
T38 control frame method of requesting a switchover. This change also causes the SIP
channel driver to propogate back whether the switchover worked or not instead of blindly
accepting the incoming T38 reinvite.
Review: http://reviewboard.digium.com/r/200/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@183108 f38db490-d61c-443f-a65b-d21fe96a405b
The code responsible for sending the T38 reinvite did not check if an INVITE was
already being handled. This caused things to get confused and the call to fail.
The code now defers sending the T38 reinvite until the current INVITE is done being
handled.
(issue AST-191)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@182022 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r181768 | mmichelson | 2009-03-12 13:29:48 -0500 (Thu, 12 Mar 2009) | 22 lines
Properly send a 487 on an INVITE we have not responded to if we receive a BYE.
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: http://svn.digium.com/svn/asterisk/trunk@181769 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r181328 | file | 2009-03-11 14:22:52 -0300 (Wed, 11 Mar 2009) | 14 lines
Fix issue where an attended transfer could not be completed under a rare scenario.
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: http://svn.digium.com/svn/asterisk/trunk@181345 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r181295 | file | 2009-03-11 13:36:50 -0300 (Wed, 11 Mar 2009) | 9 lines
Fix a problem with inband DTMF detection on outgoing SIP calls when dtmfmode=auto.
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: http://svn.digium.com/svn/asterisk/trunk@181296 f38db490-d61c-443f-a65b-d21fe96a405b
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.
A few other issues were addressed:
- There were a few instances of functions improperly passing ast_free instead
of ast_free_ptr.
- Some clean up was done to avoid the debug macros intentionally being redefined.
(copied below from Kevin's commit, appreciate the help)
- disable astmm.h from doing anything when STANDALONE is defined, which is used
by the tools in the utils/ directory that use parts of Asterisk header files in
hackish ways; also ensure that utils/extconf.c and utils/conf2ael.c are
compiled with STANDALONE defined.
(closes issue #13593)
Reported by: pj
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@181135 f38db490-d61c-443f-a65b-d21fe96a405b
Previously, chan_sip had both sip_peer and sip_user objects in memory. A
patch went in to remove sip_user to simplify the code, since everything
could be done with just sip_peer. This patch resolves some regressions
found that were introduced by those changes.
This code comes from svn/asterisk/team/group/sip-object-matching/.
Here is a list of the changes that have been made:
1) When doing a match by name with the find_peer() function, make it much
easier to specify which objects should be matched by having a parameter
that specifies exactly which object types should be considered. Also,
update find_by_name() to handle this parameter. Finally, update all
code to use the new option values.
2) When looking up an object for an outbound request by name, consider
peers only. (create_addr())
3) Only match peers on an incoming registration request.
4) When doing authentication (except for SUBSCRIBE), look up users
by name, instead of all objects by name.
5) When doing authentication (except for SUBSCRIBE), after looking for
a user by name, look for a peer by IP address, instead of all objects
by IP address.
6) When handling the SIP qualify CLI command or manager action, look for
a peer by name, instead of any object by name.
7) When handling the SIP unregister CLI command, look for a peer by name,
instead of any object by name.
9) In sip_do_debug_peer(), search for a peer by name, instead of any object
by name.
9) When handling the SIPPEER() dialplan function, search for a peer by name,
instead of any object by name.
10) In the following session timer related functions, st_get_se(),
st_get_refresher(), and st_get_mode(), when looking for an object for a
given sip_pvt using pvt->peername, look for a peer by name, instead of any
object by name.
11) Fix build_peer() to properly handle the case where separate type=peer and
type=user entries were specified in sip.conf.
(closes issue #14505)
Reported by: lmadsen
Review: http://reviewboard.digium.com/r/172/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@180261 f38db490-d61c-443f-a65b-d21fe96a405b
When the subscription context for a call pickup subscription differs
from the context of the call pickup target, there's not an easy way
to divine what context should be used for the pickup. The way to work
around this is to use PICKUPMARK as the context for the pickup.
This has been documented in the sip.conf.sample file
(ABE-1708)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@180155 f38db490-d61c-443f-a65b-d21fe96a405b
Previously, only the "data" field of the sip_pkt created during __sip_reliable_xmit
was freed when XMIT_ERROR was returned by __sip_xmit. When retrans_pkt was called,
this inevitably resulted in the reading and writing of freed memory.
XMIT_ERROR is a condition meaning that we don't want to attempt resending the packet
at all. The proper action to take is to remove the scheduler entry we just created,
free the packet's data as well as the packet itself, and unlink it from the list of
packets on the sip_pvt structure.
(closes issue #14455)
Reported by: Nick_Lewis
Patches:
14455.patch uploaded by mmichelson (license 60)
Tested by: Nick_Lewis
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@179219 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r178205 | file | 2009-02-24 11:16:07 -0400 (Tue, 24 Feb 2009) | 9 lines
Skip check for extension when subscribing for MWI.
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: http://svn.digium.com/svn/asterisk/trunk@178213 f38db490-d61c-443f-a65b-d21fe96a405b
The previous implementation of T38 faxdetect resulted in both sides of the
call jumping to a fax extension when both sides had 't38pt_udptl=yes' and
'faxdetect=yes' in sip.conf and a 'fax' extension in the current context.
This revision will jump to a 'fax' extension on incoming calls only.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@176869 f38db490-d61c-443f-a65b-d21fe96a405b
This is required to create a UDPTL structure in create_addr_from_peer() to handle the
scenario where 't38pt_udptl=yes' is not defined in the [general] section of sip.conf but
is defined the peer's context. I tested this patch by enabling t38pt_udptl in the
[general] section on one system and only enabling t38pt_udptl in a peer's context on
the system sending a fax. Without the patch, the sending system will fail to initiate
T38 negotiation with the warning message, "No way to add SDP without an UDPTL structure".
When this patch is applied the sending side will successfully initiate T38 negotiation.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@176705 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r176426 | tilghman | 2009-02-16 18:49:22 -0600 (Mon, 16 Feb 2009) | 10 lines
After a 'sip reload', qualifies for realtime peers weren't immediately
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: http://svn.digium.com/svn/asterisk/trunk@176459 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r176029 | file | 2009-02-16 11:33:53 -0400 (Mon, 16 Feb 2009) | 9 lines
Don't have the Via header stored as a stringfield as it can change often during the lifetime of a dialog.
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: http://svn.digium.com/svn/asterisk/trunk@176030 f38db490-d61c-443f-a65b-d21fe96a405b
1) It had numerous coding guidelines violations with regards to formatting.
2) It allocated memory using ast_calloc() that was never freed.
3) It didn't check for failure from the allocation.
4) It used sprintf() and strcat() to build the result, doing zero checking to
prevent writing past the end of the provided buffer.
The function also lacks API documentation, but that has not been addressed in
this commit.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@175829 f38db490-d61c-443f-a65b-d21fe96a405b
This patch adds passthrough, file recording and file playback support for the codecs listed above, with negotiation over SIP/SDP supported. Due to Asterisk's current limitation of treating a codec/bitrate combination as a unique codec, only G.722.1 at 32 kbps and G.722.1C at 48 kbps are supported.
Along the way, some related work was done:
1) The rtpPayloadType structure definition, used as a return result for an API call in rtp.h, was moved from rtp.c to rtp.h so that the API call was actually usable. The only previous used of the API all was chan_h323.c, which had a duplicate of the structure definition instead of doing it the right way.
2) The hardcoded SDP sample rates for various codecs in chan_sip.c were removed, in favor of storing these sample rates in rtp.c along with the codec definitions there. A new API call was added to allow retrieval of the sample rate for a given codec.
3) Some basic 'a=fmtp' parsing for SDP was added to chan_sip, because chan_sip *must* decline any media streams offered for these codecs that are not at the bitrates that we support (otherwise Bad Things (TM) would result).
Review: http://reviewboard.digium.com/r/158/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@175508 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r174282 | mmichelson | 2009-02-09 11:11:05 -0600 (Mon, 09 Feb 2009) | 12 lines
Don't do an SRV lookup if a port is specified
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: http://svn.digium.com/svn/asterisk/trunk@174301 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r174082 | dhubbard | 2009-02-06 17:36:03 -0600 (Fri, 06 Feb 2009) | 5 lines
check ast_strlen_zero() before calling ast_strdupa() in sip_uri_headers_cmp()
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: http://svn.digium.com/svn/asterisk/trunk@174084 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r173967 | file | 2009-02-06 13:14:15 -0400 (Fri, 06 Feb 2009) | 4 lines
Some clients do not put the call-id for replaces at the beginning, so support it being anywhere in the string.
(closes issue #14350)
Reported by: fhackenberger
........
r173968 | file | 2009-02-06 13:15:01 -0400 (Fri, 06 Feb 2009) | 2 lines
Remove a debug message I put in by accident.
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@173974 f38db490-d61c-443f-a65b-d21fe96a405b
supporting devices. The devices (snoms, specifically) need to receive a SIP
URI instead of just an extension. This adds that functionality.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@172778 f38db490-d61c-443f-a65b-d21fe96a405b
Also, implement a private cause code (as suggested by Tilghman). This works with
chan_sip, but doesn't propagate through chan_local.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@172318 f38db490-d61c-443f-a65b-d21fe96a405b
- Also, change a function in app.c to return a userful value instead of always returning 0.
Patch by fnordian, changed by Corydon76 and myself.
This does not close the bug report, as fnordian had an additional change we're still discussing.
(related to issue #14059)
Reported by: fnordian
Patches:
chan_sip_hfield.patch uploaded by fnordian (license 110)
20090116__bug14059.diff.txt uploaded by Corydon76 (license 14)
Tested by: fnordian, Corydon76, oej
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@172268 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r172169 | oej | 2009-01-29 09:48:18 +0100 (Tor, 29 Jan 2009) | 16 lines
Make sure that we always add the hangupcause headers. In some cases, the owner was disconnected before we checked for the cause.
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: http://svn.digium.com/svn/asterisk/trunk@172173 f38db490-d61c-443f-a65b-d21fe96a405b
Merged revisions 171527 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r171527 | oej | 2009-01-27 15:33:20 +0100 (Tis, 27 Jan 2009) | 13 lines
Use the same branch tag in CANCEL as in INVITE
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: http://svn.digium.com/svn/asterisk/trunk@171528 f38db490-d61c-443f-a65b-d21fe96a405b
Default setting is set before we activate the channel or at reloads, not where we declare the variable.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@171364 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r170504 | file | 2009-01-23 14:04:08 -0400 (Fri, 23 Jan 2009) | 4 lines
Use the on hold flag to see if the call is on hold or not. It is possible that our address for them will still be valid even though they are on hold.
(closes issue #14295)
Reported by: klaus3000
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@170505 f38db490-d61c-443f-a65b-d21fe96a405b
ccesario on IRC pointed out that his sip peers were not displayed
properly when he would issue the command "sip show peers." The problem
was that the onlymatchonip field was used to determine if the endpoint
was a "peer" or "user." The tricky part is that a "friend" is supposed
to be treated as both a "user" and a "peer" but the logic would not allow
"friends" to show up as "peers" since onlymatchonip was set to FALSE
for friends.
I have modified the sip_peer structure to more explicitly keep track of
what type endpoint it is so that the various manager and CLI commands
will display the expected information
Reported by ccesario via IRC
Tested by ccesario
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@169791 f38db490-d61c-443f-a65b-d21fe96a405b
When an ast_str expands to hold more data, any pointers that were pointing
to the data prior to the expansion will be pointing at invalid memory. This
change makes such pointers used in chan_sip.c instead be offsets from the
beginning of the string so that the same math may be applied no matter where
in memory the string resides.
To help ease this transition, a macro called REQ_OFFSET_TO_STR has been added
to chan_sip.c so that given a sip_request and an offset, the string at that
offset is returned.
(closes issue #14220)
Reported by: riksta
Tested by: putnopvut
Review http://reviewboard.digium.com/r/126/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@169557 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r168975 | mmichelson | 2009-01-16 16:42:13 -0600 (Fri, 16 Jan 2009) | 18 lines
Account for possible NULL pointer when we receive a 408 in response to a REGISTER
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: http://svn.digium.com/svn/asterisk/trunk@168976 f38db490-d61c-443f-a65b-d21fe96a405b
In Asterisk 1.4 and 1.6.0, the sip_request structure had a statically
allocated buffer to hold the text of the request. There was a check in the
add_line function to not attempt to write the line into the buffer if we
did not have room for it.
In trunk and Asterisk versions starting with 1.6.1, an expandable ast_str
structure is used to hold the text. Since it may grow to fit an arbitrarily
sized string, this check in add_line is no longer valid.
I found this oddity while attempting to fix issue #14220; however, I do not
believe that this is the fix for that issue since the output supplied by the
reporter did not contain the warning message that would be printed had this
condition been satisfied.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@168725 f38db490-d61c-443f-a65b-d21fe96a405b