summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
AgeCommit message (Collapse)Author
2012-07-23Add separate configuration options for subscription and registration ↵Mark Michelson
minexpiry and maxexpiry. This offers more fine-grained control over how long subscriptions last without negatively affecting the expiration range for registrations. Uploaded by: Guenther Kelleter(license #6372) Review: https://reviewboard.asterisk.org/r/2051 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370386 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-22Prevent multiple local candidates from being added with the same information ↵Joshua Colp
and add support for disabling ICE on a per-peer basis. (closes issue ASTERISK-20088) Reported by: wimpy Review: https://reviewboard.asterisk.org/r/2044/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370347 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-20Add hangupcause translation supportKinsey Moore
The HANGUPCAUSE hash (trunk only) meant to replace SIP_CAUSE has now been replaced with the HANGUPCAUSE and HANGUPCAUSE_KEYS dialplan functions to better facilitate access to the AST_CAUSE translations for technology-specific cause codes. The HangupCauseClear application has also been added to remove this data from the channel. (closes issue SWP-4738) Review: https://reviewboard.asterisk.org/r/2025/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-19Add the ability to specify technology specific documentationMatthew Jordan
A number of applications/AMI commands in Asterisk have specific behavioral differences depending on the resource or channel technology those applications are executed on. For example, the MessageSend application/ command is technology agnostic, but how the channel drivers that support that functionality behave is dependant on the protocols and channel driver implementation. Prior to this patch, those details were either documented in the application/command documentation itself, or were left undocumented. This patch adds a new element to the documentation schema, <info/>. An info node is essentially a piece of technology specific reference information that can be included by any top level XML documentation node. For example, the MessageSend application can now include XMPP/SIP specific information, where that technology specific information can be defined in chan_motif/res_xmpp/ chan_sip. Likewise, that information can also be included in the MessageSend AMI command. Review: https://reviewboard.asterisk.org/r/2049 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-18Fix a crash occurring as a result of excess stack usage.Joshua Colp
This fix involves moving the allocation of some temporary codec structures to the heap and also reduces the number of maximum payloads to something more sane for both regular and low memory builds. (closes issue ASTERISK-20140) Reported by: jonnt git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-16Code cleanup and bugfix in chan_sip outboundproxy parsing.Walter Doekes
The bug was clearing the global outboundproxy when a peer-specific outboundproxy was bad. The cleanup reduces duplicate code. Review: https://reviewboard.asterisk.org/r/2034/ Reviewed by: Mark Michelson ........ Merged revisions 370131 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 370132 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370133 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-16Fix a bug exposed by the testsuite where text streams would no longer be ↵Joshua Colp
parsed correctly. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-16Add support for SIP over WebSocket.Joshua Colp
This allows SIP traffic to be exchanged over a WebSocket connection which is useful for rtcweb. Review: https://reviewboard.asterisk.org/r/2008 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-13Add support for parsing SDP attributes, generating SDP attributes, and ↵Joshua Colp
passing it through. This support includes codecs such as H.263, H.264, SILK, and CELT. You are able to set up a call and have attribute information pass. This should help considerably with video calls. Review: https://reviewboard.asterisk.org/r/2005/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370055 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-12Include Expires header for SIP PUBLISH requestsKinsey Moore
RFC3903 requres SIP PUBLISH requests to have Expires headers, so add them. Review: https://reviewboard.asterisk.org/r/2003/ Patch-by: gareth ........ Merged revisions 370014 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 370015 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370016 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-12Prevent double uri_escaping in chan_sip when pedantic is enabledKinsey Moore
If pedantic mode is enabled, outbound invites will have double-escaped contacts. This avoids setting an already-escaped string into a field where it is expected to be unescaped. (closes issue ASTERISK-20023) Reported by: Walter Doekes ........ Merged revisions 369993 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369994 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369995 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-11Named ACLs: Introduces a system for creating and sharing ACLsJonathan Rose
This patch adds Named ACL functionality to Asterisk. This allows system administrators to define an ACL and refer to it by a unique name. Configurable items can then refer to that name when specifying access control lists. It also includes updates to all core supported consumers of ACLs. That includes manager, chan_sip, and chan_iax2. This feature is based on the deluxepine-trunk by Olle E. Johansson and provides a subset of the Named ACL functionality implemented in that branch. For more information on this feature, see acl.conf and/or the Asterisk wiki. Review: https://reviewboard.asterisk.org/r/1978/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-10Fix failing SDP_offer_answer testKinsey Moore
Asterisk now generates image stream declinations with the same transport case that it used to before the stream declination improvements. (udptl vs UDPTL) (closes issue SWP-4736) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369900 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-09Add support for exposing the received contact URI and also for setting the ↵Joshua Colp
request URI in messages. (closes issue AST-911) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-09chan_sip: Fix small behavioral change accidentally introduced in r369750Jonathan Rose
When removing the warning for AST_CONTROL_FLASH from sip_indicate, I also inadvertently changed the return value, which would likely make the indication not be sent in audio. This fixes that while still removing the warning message. ........ Merged revisions 369792 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369793 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369794 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-06chan_sip: Add case for FLASH control frames so that we don't display a warning.Jonathan Rose
chan_sip channels can receive flash control frames when connected to analog phones and possibly for other reasons. There really isn't a reason to warn when these frames are received, we can safely ignore them. Patches: dahdi_sip_flash.diff uploaded by Jonathan Rose (license 6182) ........ Merged revisions 369750 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369751 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-05Do not send a BYE when a provisional response arrives during a re-INVITEMatthew Jordan
Commits r369557 and r369579 were done to improve handling of re-INVITEs when the UA that was supposed to receive the re-INVITE fails to respond. A limitation of those patches occurred when a UA sent a provisional response to the re-INVITE. This triggered a sending of a BYE in check_pending. This patch tweaks the handling of the re-INVITE such that a BYE is not sent in response to those messages. (issue ASTERISK-19992) Reported by: Steve Davies Tested by: Steve Davies patches: (reinvite_tweak.diff license #5012 by Steve Davies) ........ Merged revisions 369626 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369627 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-03More improvements to re-INVITEs timing out after a provisional responseTerry Wilson
There is no need to call check_pendings() on a final response to an INVITE when destroying the scheduler entry as it will be done later during normal processing. (issue ASTERISK-19992) ........ Merged revisions 369579 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369580 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-03Better handle re-INVITEs with provisional but no final repsonsesTerry Wilson
A previous attempt at fixing this issue had negative side effects related to attended transfers which this patch should resolve. Many thanks to Steve Davies for all of the good suggestions and testing. (closes issue ASTERISK-19992) Reported by: Steve Davies Tested by: Steve Davies, Terry Wilson Review: https://reviewboard.asterisk.org/r/2009/ ........ Merged revisions 369557 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369558 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-01Add support for ICE/STUN/TURN in res_rtp_asterisk and chan_sip.Joshua Colp
Review: https://reviewboard.asterisk.org/r/1891/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-29With some configurations a transport is not actually specified so assume UDP ↵Joshua Colp
in these cases. ........ Merged revisions 369490 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369491 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369492 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-29Make the address family filter specific to the transport.Joshua Colp
(closes issue ASTERISK-16618) Reported by: Leif Madsen Review: https://reviewboard.asterisk.org/r/1667/ ........ Merged revisions 369471 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369472 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369473 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-27AST-2012-010: Clean up after a reinvite that never gets a final responseTerry Wilson
The basic problem is that if a re-INVITE is sent by Asterisk and it receives a provisional response, but no final response, then the dialog is never torn down. In addition to leaking memory, this also leaks file descriptors and will eventually lead to Asterisk no longer being able to process calls. This patch just keeps track of whether there is an outstanding re-INVITE, and if there is goes ahead and cleans up everything as though there was no outstanding reinvite. Review: https://reviewboard.asterisk.org/r/2009/ (closes issue ASTERISK-19992) Reported by: Steve Davies Tested by: Steve Davies, Terry Wilson ........ Merged revisions 369436 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369437 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369449 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-25Re-fix how local tag is generated when sending a 481 to an INVITE.Mark Michelson
Match our local tag to whatever to-tag was sent in the initial INVITE. Because the size of the to-tag may not fit in the buffer in the sip_pvt, it has been changed to a string field. (closes issue ASTERISK-19892) reported by Walter Doekes Review: https://reviewboard.asterisk.org/r/1977 ........ Merged revisions 369352 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369353 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-25Be more consistent with the return code for requests received from invalid ↵Mark Michelson
domain. When Asterisk receives an INVITE from an external domain when allowexternaldomains=no send a 403 instead of a 404. This is consistent with Asterisk's behavior when receiving a REGISTER in this situation. (Closes issue ASTERISK-19601) Reported by Matthew Jordan Patches: ASTERISK-19601-no401.patch uploaded by Mark Michelson (License #5049) ........ Merged revisions 369302 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369303 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-22Change incorrect chan_sip zombie hangup debug message. They are all zombies ↵Richard Mudgett
now. ........ Merged revisions 369235 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369236 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369237 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-22Don't crash on a guest directmedia callTerry Wilson
A sip_pvt may not have relatedpeer set if a call doesn't match up with a peer. If there is no relatedpeer, there is no direct media ACL to apply, so just return that it is allowed. (closes issue ASTERISK-20040) Reported by: Terry Wilson ........ Merged revisions 369214 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369215 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369217 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-22Don't parse media stream state for SIP video streamsKinsey Moore
The sendonly/recvonly/sendrecv/inactive media stream attributes were parsed for video, but nothing was ever done with them. With this code removed, an UNSUPPORTED message is produced when these attributes are used in conjunction with a video stream which is the better behavior since they were never really supported in the first place. ........ Merged revisions 369195 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369206 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369207 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-19Fix request routing issue when outboundproxy is used.Mark Michelson
Asterisk was incorrectly setting the destination of CANCELs and ACKs for error responses to the URI of the initial INVITE. This resulted in further requests, such as INVITEs with authentication credentials, to be routed incorrectly. Instead, when these CANCEL or ACKs are to be sent, we should simply keep the destination the same as what it previously was. There is no need to alter it any. (closes issue ASTERISK-20008) Reported by Marcus Hunger Patches: ASTERISK-20008.patch uploaded by Mark Michelson (license #5049) ........ Merged revisions 369066 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369067 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369068 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15Allow chan_sip to decline unwanted media streamsKinsey Moore
This change replaces the static array of four representable media streams with an AST_LIST so that chan_sip can keep track of offered media streams. This allows chan_sip to deal with offers containing multiple same-type streams and many other situations without rejecting the SDP offer in its entirety, yet still generating a valid response. This also covers cases where Asterisk can not comprehend the offer if it is in the correct format. Previously, chan_sip would reject SDP offers or entirely ignore individual stream offers in an effort to be more compatible which would often result in invalid SDP responses. Review: https://reviewboard.asterisk.org/r/1988/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-12Set the Caller ID "tag" on peers even if remote party information is present.Mark Michelson
On incoming calls, we were setting the cid_tag on the dialog only if there was no remote party information (Remote-Party-ID or P-Asserted-Identity) present. The Caller ID tag is an invented parameter, though, and should be set no matter the circumstance. (closes issue ASTERISK-19859) Reported by Thomas Arimont (closes issue AST-884) Reported by Trey Blancher ........ Merged revisions 368807 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 368808 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-12Fix deadlock in SIP transfers that involve a REFER requestMatthew Jordan
In r367163, "send to voicemail" functionality was added to the SIP channel driver. This required updating the party redirecting information for the channel based on the headers provided in the REFER request. When the redirecting party information is updated on the channel, a call to ast_indicate_data occurs. Because handle_request_refer still had the sip_pvt locked, a deadlock could occur between the pbx_thread and the do_monitor thread servicing the REFER request. This patch preserves the proper locking order between the channel and the sip_pvt by ensuring that the sip_pvt is unlocked prior to updating the party redirecting information on the channel. (closes issue AST-903) Reported by: Matt Jordan patches: jira_ast_903_trunk.patch by rmudgett (license 5621) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368793 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-12Parse ANI2 information from SIP From header parametersKinsey Moore
ANI2 information is now parsed out of SIP From headers when present in the oli, isup-oli, and ss7-oli parameters and is available via the CALLERID(ani2) dialplan function. (closes issue ASTERISK-19912) Patch-by: Rob Gagnon Review: https://reviewboard.asterisk.org/r/1947/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368784 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-11Fix deadlock potential with ast_set_hangupsource() calls.Richard Mudgett
Calling ast_set_hangupsource() with the channel lock held can result in a deadlock because the function also locks the bridged channel. (issue ASTERISK-19537) (closes issue AST-891) Reported by: Guenther Kelleter Tested by: Guenther Kelleter (closes issue ASTERISK-19801) Reported by: Alec Davis ........ Merged revisions 368759 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 368760 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-11Fix coverity UNUSED_VALUE findings in core support level filesKinsey Moore
Most of these were just saving returned values without using them and in some cases the variable being saved to could be removed as well. (issue ASTERISK-19672) ........ Merged revisions 368738 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 368739 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-06Fix a specific scenario where ACKs are not matched.Mark Michelson
If a dialog-starting INVITE contains a to-tag, then Asterisk will respond with a 481. In this case, the resulting incoming ACK would not be matched, so Asterisk would continue retransmitting the 481 until the transaction times out. There were two issues. Asterisk, upon creating a sip_pvt would generate a local tag. However, when the time came to transmit the 481, since there was a to-tag in the INVITE, Asterisk would place this original to-tag in the 481 response. When the ACK came in, Asterisk would attempt to match the to-tag in the ACK to the generated local tag. Unfortunately, Asterisk never actually transmitted a response with the generated local tag, so the to-tag in the ACK would not match. The other problem was that when the 481 was sent, nothing was set on the sip_pvt to indicate what CSeq is expected in the ACK. To fix the first problem, we zero out the to-tag seen in the incoming INVITE. This way, Asterisk, when time to send a response, will send its generated local tag instead. To fix the second problem, we set the sip_pvt's pendinginvite to the CSeq of the INVITE when we send a 481. (closes issue ASTERISK-19892) Reported by Mark Michelson ........ Merged revisions 368625 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 368629 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-06Ensure overlapping hold flags do not conflictKinsey Moore
When changing between different modes of hold, the flags were not being cleared out properly causing a failure to change hold states. (closes issue ASTERISK-19919) Patch-by: Morten Tryfoss Reported-by: Morten Tryfoss ........ Merged revisions 368586 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 368587 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-05Convert AST_FLAG_ANSWERED_ELSEWHERE usage to AST_CAUSE_ANSWERED_ELSEWHEREKinsey Moore
This was essentially duplicated functionality where normal channels used AST_CAUSE_ANSWERED_ELSEWHERE while local channels and queues used AST_FLAG_ANSWERED_ELSEWHERE. This removes the flag and converts that usage into AST_CAUSE_ANSWERED_ELSEWHER usage. Review: https://reviewboard.asterisk.org/r/1944 (closes issue ASTERISK-19865) Patch-by: Birger Harzenetter git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-04Relay proper SIP responses on calling side.Mark Michelson
Revision 351130 broke corect HANGUPCAUSE setting for the 404 case in chan_sip. Other cases were also potentially broken. This patch fixes the relaying of causes to be what they used to be. (closes issue ASTERISK-19914) Reported by Pavel Troller Tested by Walter Doekes (via a reviewboard test to be committed later) Patches: chan_sip.diff uploaded by Pavel Troller (license #6302) ........ Merged revisions 368498 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 368499 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-04Merge changes dealing with support for Digium phones.Mark Michelson
Presence support has been added. This is accomplished by allowing for presence hints in addition to device state hints. A dialplan function called PRESENCE_STATE has been added to allow for setting and reading presence. Presence can be transmitted to Digium phones using custom XML elements in a PIDF presence document. Voicemail has new APIs that allow for moving, removing, forwarding, and playing messages. Messages have had a new unique message ID added to them so that the APIs will work reliably. The state of a voicemail mailbox can be obtained using an API that allows one to get a snapshot of the mailbox. A voicemail Dialplan App called VoiceMailPlayMsg has been added to be able to play back a specific message. Configuration hooks have been added. Configuration hooks allow for a piece of code to be executed when a specific configuration file is loaded by a specific module. This is useful for modules that are dependent on the configuration of other modules. chan_sip now has a public method that allows for a custom SIP INFO request to be sent mid-dialog. Digium phones use this in order to display progress bars when files are played. Messaging support has been expanded a bit. The main visible difference is the addition of an AMI action MessageSend. Finally, a ParkingLots manager action has been added in order to get a list of parking lots. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-01Improve SDP offer/answer RFC complianceKevin P. Fleming
Asterisk should not accept SDP offers that contain unknown RTP profiles (for audio/video streams) or unknown top-level media types. When it does, it answers with an SDP that does not match the offer properly, and this will nearly always result in a broken call. This patch causes such offers to be rejected. Review: https://reviewboard.asterisk.org/r/1811/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-01Improve SDP parsing warning messagesKevin P. Fleming
* 'Unsupported media type' is only reported when that is in fact the case, not when a supported media type is included in an 'm' line that has an invalid format. * All warning messages related to parsing 'm' lines now include the 'm' line contents. * (minor bugfix) newline added to port-number-zero warning messages. * Warning messages improved to use RFC-specified terminology for various items. * Warnings for offers that include more than one port for a single media type now include the media type. Review: https://reviewboard.asterisk.org/r/1811/ ........ Merged revisions 368218 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 368267 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-01Help mitigate potential reinvite glare scenarios.Mark Michelson
When Asterisk servers are set up back-to-back, and direct media is to be used betweeen endpoints, it is fairly common for the two Asterisk servers to send direct media reinvites to each other simultaneously. This results in 491s and ACKs being exchanged between the servers. While the media eventually gets set up properly, the problem is that there can be a noticeable delay for the streams to stabilize. This patch adds a new directmedia option called "outgoing". With this set, an immediate direct media reinvite will only be sent if the call direction is outgoing. For incoming dialogs, an immediate direct media reinvite will not be sent, but further "reactionary" direct media reinvites may be sent. Review: https://reviewboard.asterisk.org/r/1954 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-31Coverity Report: Fix issues for error type REVERSE_INULL (core modules)Richard Mudgett
* Fixes findings: 0-2,5,7-15,24-26,28-31 (issue ASTERISK-19648) Reported by: Matt Jordan ........ Merged revisions 368039 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 368042 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-25Fix pvt_sip for inbound call to use peer's allowtransfer settingMichael L. Young
The pvt_sip allowtransfer was not being set to that of the peer's setting. Therefore, the global allowtransfer setting was being used instead which would lead to calls not being transfered if the global setting was set to 'no' despite the setting on the peer being 'yes' and vice versa, calls would be allowed to transfer even if the peer's setting was 'no' but the global setting was 'yes'. (Closes issue ASTERISK-19856) Reported by: Jacek Tested by: Michael L. Young, Jacek Patches: issue-asterisk-19856-branch10-v3.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/1923/ ........ Merged revisions 367730 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 367731 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-24chan_sip: fix problem directmediapermit/deny uses the wrong addressJonathan Rose
When remotely bridging calls with directmedia, Asterisk would check the address of the peers/users holding directmedia ACLs (set via directmediapermit/directmediadeny) instead of the bridged peer. This is similar to r366547, but trunk specific and involves changes to the rtpengine instead of just chan_sip. (closes issue AST-876) review: https://reviewboard.asterisk.org/r/1924/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-23Re-add LastMsgsSent value for SIP peersMatthew Jordan
Previously, MWI logic utilized a counter called 'lastmsgssent' to know whether or not MWI NOTIFY requests had been sent to a specific peer. When MWI notifications were changed to use the internal event framework, this value was no longer needed for its original purpose. Hence, it was no longer updated with the new/old message counts for a peer. The value was previously removed for Asterisk 10; however, since it was still present in Asterisk 1.8 and still useful for reporting purposes, it was decided to re-add the value. This patch re-adds the 'LastMsgsSent' field in the response to an AMI/CLI 'sip show peer [peer]' command, and makes it so that the value of lastmsgssent is updated appropriately. The value should now display the new/old message counts for a particular peer. (closes issue ASTERISK-17866) Reported by: Steve Davies patches by: ast-17866-rb1272.patch (License #5041 by irroot) Modified slightly for this commit Review: https://reviewboard.asterisk.org/r/1939 ........ Merged revisions 367362 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 367369 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367376 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-22Resolve crash in subscribing for MWI notificationsTerry Wilson
ASTOBJ_UNREF sets the variable to NULL after unreffing it, so the variable should definitely not be used after that. To solve this in the two cases that affect subscribing for MWI notifications, we instead save the ref locally, and unref them in the error conditions. (closes issue ASTERISK-19827) Reported by: B. R Review: https://reviewboard.asterisk.org/r/1940/ ........ Merged revisions 367266 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 367267 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-21Revert revision 367163.Mark Michelson
This should have been committed to my team trunk-digiumphones branch instead of trunk. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-21Add "send to voicemail" Digium phone functionality to Asterisk.Mark Michelson
This change accommodates two methods by which calls can be directed to a user's voicemail. * Incoming calls can be redirected to any user's voicemail. * Established calls can be blind transferred to any user's voicemail. Digium phones indicate the desire to direct a call to voicemail by using a Diversion header with a reason parameter of "send_to_vm". This patch adds the "send_to_vm" reason as a valid redirecting reason. In addition, chan_sip.c has been modified to update redirecting information on the transferred channel by reading a Diversion header on a REFER request. (closes issue AST-871) Reported by Malcolm Davenport Review: https://reviewboard.asterisk.org/r/1925 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367163 65c4cc65-6c06-0410-ace0-fbb531ad65f3