summaryrefslogtreecommitdiff
path: root/channels
AgeCommit message (Collapse)Author
2014-06-26res_http_websocket: Close websocket correctly and use careful fwriteMatthew Jordan
When a client takes a long time to process information received from Asterisk, a write operation using fwrite may fail to write all information. This causes the underlying file stream to be in an unknown state, such that the socket must be disconnected. Unfortunately, there are two problems with this in Asterisk's existing websocket code: 1. Periodically, during the read loop, Asterisk must write to the connected websocket to respond to pings. As such, Asterisk maintains a reference to the session during the loop. When ast_http_websocket_write fails, it may cause the session to decrement its ref count, but this in and of itself does not break the read loop. The read loop's write, on the other hand, does not break the loop if it fails. This causes the socket to get in a 'stuck' state, preventing the client from reconnecting to the server. 2. More importantly, however, is that the fwrite in ast_http_websocket_write fails with a large volume of data when the client takes awhile to process the information. When it does fail, it fails writing only a portion of the bytes. With some debugging, it was shown that this was failing in a similar fashion to ASTERISK-12767. Switching this over to ast_careful_fwrite with a long enough timeout solved the problem. Note that this version of the patch, unlike r417310 in Asterisk 11, exposes configuration options beyond just chan_sip's sip.conf. Configuration options to configure the write timeout have also been added to pjsip.conf and ari.conf. #ASTERISK-23917 #close Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3624/ ........ Merged revisions 417310 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 417311 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-26chan_sip: Fix handling of "From" headers longer than 256 charactersCorey Farrell
From headers were processed using a 256 character buffer on the stack. This change replaces that with a heap allocation by ast_strdup. ASTERISK-23790 #close Reported by: uniken1 Tested by: uniken1 Review: https://reviewboard.asterisk.org/r/3669/ Patches: chan_sip-large-from-header-1.8-r3.patch uploaded by wdoekes (license 5674) ........ Merged revisions 417248 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 417249 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 417250 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417251 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-25Skinny: cleanup some log messages around sessions.Damien Wedhorn
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417193 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-23suspended destructions of pri spans on eventsTzafrir Cohen
If a DAHDI span disappears, we wish for its representation in Asterisk to be destroyed as well. The information about the span's removal may come from several paths: 1. DAHDI sends DAHDI_EVENT_REMOVE on every channel. 2. An extra DAHDI_EVENT_REMOVED is sent on every subsequent call to DAHDI_GET_EVENT. 3. Every read (including the internal one by libpri on the D-channel) returns -ENODEV. Asterisk responsds to DAHDI_EVENT_REMOVE on a channel by destroying it. Destroying a channel requires holding the channel list lock (iflock). Destroying a channel that is part of a span requires holding the span's lock. Destroying a channel from a context that holds the span lock, while at the same time another channel is destroyed directly, leads to a deadlock. Solution: don't destroy span while holding the channels list lock. Thus changes in this patch: * Deferring removal of PRI spans in response to events: doomed spans are collected on a list. * Doomed spans are removed periodically by the monitor thread. * ENODEV reads from the D-channel will warant the same deferred removal. Review: https://reviewboard.asterisk.org/r/3548/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417059 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-19Fix build warnings with TEST_FRAMEWORK enabledKinsey Moore
........ Merged revisions 416732 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 416733 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 416734 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416736 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-16chan_dahdi: Adds support for major update to libss7.Richard Mudgett
* SS7 support now requires libss7 v2.0 or later. The new libss7 is not backwards compatible. * Added SS7 support for connected line and redirecting. * Most SS7 CLI commands are reworked as well as new SS7 commands added. See online CLI help. * Added several SS7 config option parameters described in chan_dahdi.conf.sample. * ISUP timer support reworked and now requires explicit configuration. See ss7.timers.sample. Special thanks to Kaloyan Kovachev for his support and persistence in getting the original patch by adomjan updated and ready for release. SS7-27 #close Reported by: adomjan git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-16channels/chan_sip: Forbid remote bridging if T.38 is negotiatedMatthew Jordan
When a framehook is removed - such as the fax gateway framehook - the bridge framework will re-evaluate the bridge mixing technologies to see if it can improve the bridging. When this occurs, get_rtp_info will be called to determine if local or remote bridging can be used. Using remote bridging will cause a fax to fail, as direct media negotiation will cause some small number of packets to not arrive at the remote endpoint. This patch forces local native bridging if T.38 negotiation is in progress or has been established. ........ Merged revisions 416318 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416319 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-13AST-2014-007: Fix of fix to allow AMI and SIP TCP to send messages.Richard Mudgett
ASTERISK-23673 #close Reported by: Richard Mudgett Review: https://reviewboard.asterisk.org/r/3617/ ........ Merged revisions 416066 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 416067 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 416070 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-12AST-2014-007: Fix DOS by consuming the number of allowed HTTP connections.Richard Mudgett
Simply establishing a TCP connection and never sending anything to the configured HTTP port in http.conf will tie up a HTTP connection. Since there is a maximum number of open HTTP sessions allowed at a time you can block legitimate connections. A similar problem exists if a HTTP request is started but never finished. * Added http.conf session_inactivity timer option to close HTTP connections that aren't doing anything. Defaults to 30000 ms. * Removed the undocumented manager.conf block-sockets option. It interferes with TCP/TLS inactivity timeouts. * AMI and SIP TLS connections now have better authentication timeout protection. Though I didn't remove the bizzare TLS timeout polling code from chan_sip. * chan_sip can now handle SSL certificate renegotiations in the middle of a session. It couldn't do that before because the socket was non-blocking and the SSL calls were not restarted as documented by the OpenSSL documentation. * Fixed an off nominal leak of the ssl struct in handle_tcptls_connection() if the FILE stream failed to open and the SSL certificate negotiations failed. The patch creates a custom FILE stream handler to give the created FILE streams inactivity timeout and timeout after a specific moment in time capability. This approach eliminates the need for code using the FILE stream to be redesigned to deal with the timeouts. This patch indirectly fixes most of ASTERISK-18345 by fixing the usage of the SSL_read/SSL_write operations. ASTERISK-23673 #close Reported by: Richard Mudgett ........ Merged revisions 415841 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 415854 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 415896 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-06chan_sip: Fix order of variables specified in SIPNotify actionJonathan Rose
Prior to this patch, sequential variables would be ordered in reverse from the order specified in the manager action. Review: https://reviewboard.asterisk.org/r/3588/ ........ Merged revisions 415359 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 415390 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 415410 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415411 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-05PJSIP: Send initial connected line informationKinsey Moore
This makes chan_pjsip send connected line information when it is called so that connected line information is available on the connected channel. (closes issue DPMA-442) Reported by: John Bigelow Review: https://reviewboard.asterisk.org/r/3584/ ........ Merged revisions 415191 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415192 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-04chan_pjsip: Add debug in RTP Engine glue callbackMatthew Jordan
This patch adds some debug statements that aid with determining why a direct media request may or may not be initiated. ........ Merged revisions 415117 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-28Logger/CLI/etc.: Fix some aesthetic issues; reduce chatty verbose messagesMatthew Jordan
This patch addresses some aesthetic issues in Asterisk. These are all just minor tweaks to improve the look of the CLI when used in a variety of settings. Specifically: * A number of chatty verbose messages were removed or demoted to DEBUG messages. Verbose messages with a verbosity level of 5 or higher were - if kept as verbose messages - demoted to level 4. Several messages that were emitted at verbose level 3 were demoted to 4, as announcement of dialplan applications being executed occur at level 3 (and so the effects of those applications should generally be less). * Some verbose messages that only appear when their respective 'debug' options are enabled were bumped up to always be displayed. * Prefix/timestamping of verbose messages were moved to the verboser handlers. This was done to prevent duplication of prefixes when the timestamp option (-T) is used with the CLI. * Verbose magic is removed from messages before being emitted to non-verboser handlers. This prevents the magic in multi-line verbose messages (such as SIP debug traces or the output of DumpChan) from being written to files. * _Slightly_ better support for the "light background" option (-W) was added. This includes using ast_term_quit in the output of XML documentation help, as well as changing the "Asterisk Ready" prompt to bright green on the default background (which stands a better chance of being displayed properly than bright white). Review: https://reviewboard.asterisk.org/r/3547/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-28chan_unistim: Unlock mutex in rare OOM condition.Walter Doekes
#ASTERISK-23792 #close Reported by: Peter Whisker Review: https://reviewboard.asterisk.org/r/3567/ ........ Merged revisions 414677 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 414678 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-27chan_sip: Start session timer at 200, not at INVITE.Walter Doekes
Asterisk started counting the session timer at INVITE while the other end correctly started at 200. This meant that for short session-expiries (90 seconds) combined with long ringing times (e.g. 30 seconds), asterisk would wrongly assume that the timer was hit before the other end thought it was time to send a session refresh. This resulted in prematurely ended calls. This changes the session timer to start counting first at 200 like RFC says it should. (Also removed a few excess NULL checks that would never hit, because if they did, asterisk would have crashed already.) ASTERISK-22551 #close Reported by: i2045 Review: https://reviewboard.asterisk.org/r/3562/ ........ Merged revisions 414620 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 414628 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 414636 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414643 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-22res_pjsip_refer: Fix bugs involving Parking/PJSIP/transfersJonathan Rose
PJSIP would never send the final 200 Notify for a blind transfer when transferring to parking. This patch fixes that. In addition, it fixes a reference leak when performing blind transfers to non-bridging extensions. Review: https://reviewboard.asterisk.org/r/3485/ ........ Merged revisions 414400 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414403 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-16chan_dahdi: Fix analog dialtone detection.Richard Mudgett
* Check if waitingfordt (waitfordialtone) is enabled in dahdi_read() to allow the DSP to operate early enough to detect dialtone. * Made use the correct variable in my_check_waitingfordt(). ASTERISK-23709 #close Reported by: Steve Davies Patches: dialtone_detect_fix (license #5012) patch uploaded by Steve Davies Review: https://reviewboard.asterisk.org/r/3534/ ........ Merged revisions 414067 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 414068 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 414069 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-16sig_pri.c: Pull the pri_dchannel() PRI_EVENT_RING case into its own function.Richard Mudgett
* Populate the CALLERID(ani2) value (and the special CALLINGANI2 channel variable) with the ANI2 value in addition to the PRI specific ANI2 channel variable. * Made complete snapshot staging with the channel lock held. All channel snapshots need to be done while the channel lock is held. ........ Merged revisions 414050 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 414051 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-13chan_sip: Add TLS and SRTP status to CLI command 'sip show channel'Jonathan Rose
ASTERISK-23564 #close Reported by: Patrick Laimbock Review: https://reviewboard.asterisk.org/r/3474/ ........ Merged revisions 413876 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413877 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413878 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-13chan_dahdi/sig_pri: Prevent unnecessary PROGRESS events when overlap dialing ↵Richard Mudgett
is enabled. When overlap dialing is enabled, the lack of inband audio available information in the SETUP_ACKNOWLEDGE events causes an interoperability problem with SIP. sig_pri doesn't know if there is dialtone present when a SETUP_ACKNOWLEDGE is received so it assumes it is there and posts an AST_CONTROL_PROGRESS frame. The SIP channel driver then sends out a 183 Session Progress and blocks the desired 180 Ringing message when the ALERTING message comes in. * Made the configure script detect if the installed version of libpri supports the SETUP_ACKNOWLEDGE enhancements. * Using the new API, made generate an AST_CONTROL_PROGRESS frame on an incoming SETUP_ACKNOWLEDGE message when the message indicates inband audio is present instead of assuming that dialtone is present. * Using the new API, made SETUP_ACKNOWLEDGE send out an inband audio available indication only if dialtone is expected. The change also makes the fallback behaviour of sending the PROGRESS message better by sending it only if dialtone is expected. * Changed receiving a PROCEEDING message to not generate an AST_CONTROL_PROGRESS frame if the progress indication ie indicates non-end-to-end-ISDN. This helps interoperability with SIP. * Changed sending a PROCEEDING message in response to an AST_CONTROL_PROCEEDING frame to not indicate inband audio available. It was silly to do so anyway because the channel driver doesn't know if inband audio is even available. This helps interoperability with SIP. This patch and a corresponding change in libpri work together to allow Asterisk to control the inband audio available progress indication ie on the SETUP_ACKNOWLEDGE message when dialtone is present. AST-1338 #close Reported by: Tyler Stewart Review: https://reviewboard.asterisk.org/r/3521/ ........ Merged revisions 413714 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413765 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413771 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-13Fix compiler warning from GCC 4.10 fixup.Richard Mudgett
........ Merged revisions 413766 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-09Allow Asterisk to compile under GCC 4.10Kinsey Moore
This resolves a large number of compiler warnings from GCC 4.10 which cause the build to fail under dev mode. The vast majority are signed/unsigned mismatches in printf-style format strings. ........ Merged revisions 413586 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413587 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413588 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-02res_pjsip_refer: Add Referred-By header on INVITE for blind transfers.Richard Mudgett
Per rfc3892, the Referred-By header in a REFER must be copied into the referenced request (IE. The outgoing INVITE to the transfer target). * Automatically put the Referred-By header in the outgoing INVITE message if the SIPREFERREDBYHDR channel variable is defined with a value. * Made chan_sip.c:get_refer_info() set SIPREFERREDBYHDR for inheritance so chan_pjsip has a better chance to interoperate. * Fixed refer_blind_callback() and refer_incoming_refer_request() to not modify the data in the pointer returned by pjsip_msg_find_hdr_by_name(). It seems wrong to modify that data since the calling routine doesn't own the buffer. ASTERISK-23501 #close Reported by: John Bigelow Review: https://reviewboard.asterisk.org/r/3514/ ........ Merged revisions 413210 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-30chan_sip.c: Fixed off-nominal message iterator ref count and alloc fail issues.Richard Mudgett
* Fixed early exit in sip_msg_send() not destroying the message iterator. * Made ast_msg_var_iterator_next() and ast_msg_var_iterator_destroy() tolerant of a NULL iter parameter in case ast_msg_var_iterator_init() fails. * Made ast_msg_var_iterator_destroy() clean up any current message data ref. * Made struct ast_msg_var_iterator, ast_msg_var_iterator_init(), ast_msg_var_iterator_next(), ast_msg_var_unref_current(), and ast_msg_var_iterator_destroy() use iter instead of i. * Eliminated RAII_VAR usage in res_pjsip_messaging.c:vars_to_headers(). ........ Merged revisions 413139 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413142 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413144 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-30chan_pjsip: Fix deadlock when retrieving call-id of channel.Joshua Colp
If a task was in-flight which required the channel or bridge lock it was possible for the synchronous task retrieving the call-id to deadlock as it holds those locks. After discussing with Mark Michelson the synchronous task was removed and the call-id accessed directly. This should be safe as each object involved is guaranteed to exist and the call-id will never change. ........ Merged revisions 413140 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413141 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-30chan_pjsip: Add support for picking up calls in the configured pickup group.Joshua Colp
AST-1363 Review: https://reviewboard.asterisk.org/r/3478/ ........ Merged revisions 413117 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-29chan_pjsip: Implement core ability to get Call-ID of a channel.Joshua Colp
This changes implement the "get_pvt_uniqueid" which is used to return the technology specific unique identifier. In the case of SIP this is the Call-ID of the dialog. Review: https://reviewboard.asterisk.org/r/3480/ ........ Merged revisions 413088 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-28Introducing changes proposed to chan_unistim driver:Igor Goncharovskiy
1) Added the unistim.conf variable dtmf_duration which can select the DTMF playback duration from 0ms to 150ms (0 is off and is the new default) 2) Enabled the transmission of month names, which are sent with the date and changed the dateformat variable to accept the values 0-3 as per the UNISTIM standard (2 & 3 match the previous 1 & 2 formats). 3) Enabled the "Mute" packet so muting microphone works as expected and microphone muted for all calls while LED light on 4) Changed Duree to Timer on i2004 display (closes issue ASTERISK-23592) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413048 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-21chan_sip: Add sendrpid trust optionsJonathan Rose
In r411189, some behavior was changed which made sendrpid behavior act in a more trusting manner by sending full user data for peers set with private caller presence in P-Asserted-Identity headers. Since this changed long time expected behaviors, we decided to pull that patch when that was pointed out by the community. Instead, this patch provides a trust_id_outbound setting which will expose the data per RFC-3325 if set to 'yes' and simply not send the PAI/RPID headers at all if set to 'no'. By default trust_id_outbound will be set to 'legacy' which will preserve the behavior prior to these patches. Extra special thanks to Walter Doekes for providing advice and feedback. (closes issue AST-1301) (closes issue ASTERISK-19465) Reported by: Krzysztof Chmielewski Review: https://reviewboard.asterisk.org/r/3447/ ........ Merged revisions 412744 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 412746 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 412747 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412759 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-21Fix wrong dialtone. The "modulation" should not be referenced for tone+tone ↵Igor Goncharovskiy
as it refers to the on-off characteristic - this often resulted in a single tone rather than the multitone as in the UK. ........ Merged revisions 412712 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 412713 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-17main/Makefile: Fix build failure on SmartOS/Illumos/SunOSMatthew Jordan
This patch fixes two issues when building on SmartOS: - channels/chan_oss.c: it makes sure soundcard.h is found - main/Makefile: only use "-Wl,--version-script" when GNU LD is used as the Sun Linker doesn't support that. Similar checks are already used elswhere in the Makefile Review: https://reviewboard.asterisk.org/r/3426 ASTERISK-23576 #close Reported by: Sebastian Wiedenroth patches: fix-sunos.diff uploaded by Sebastian Wiedenroth (License 6597) ........ Merged revisions 412468 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 412483 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-17chan_sip: Add SIPURIPHONECONTEXT channel variable for Request TEL URIsMatthew Jordan
This patch is a continuation of https://reviewboard.asterisk.org/r/3349/, committed in r412303. It resolves a finding oej had that the phone-context be available in a channel variable separate from SIPDOMAIN. This patch adds that variable as SIPURIPHONECONTEXT. It also allows a local number (or global number specified in the TEL URI) to be used to look up as a peer. (issue ASTERISK-17179) Review: https://reviewboard.asterisk.org/r/3349/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412467 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-15Remove unused RAII_VAR() declarations.Richard Mudgett
* Remove unused RAII_VAR() declarations. The compiler cannot catch these because the cleanup function "references" the unused variable. Some actually allocated and released resources that were never used. * Fixed some whitespace issues in stasis_bridges.c. ........ Merged revisions 412399 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-15chan_sip.c: Fix channel staging assertion failure.Richard Mudgett
The failing assertion ensures that the final snapshot gets generated so CDR records can get finalized. The only place where a channel staging snapshot flag could be left set is in chan_sip.c:handle_request_bye(). The function could return before clearing the flag because the channel could dissappear while the function had to have the channel unlocked. * Fixed handle_request_bye() channel snapshot staging coverage area to not have a return in the middle of it and be unable to clear the staging flag. * Pushed the channel snapshot staging coverage area into ast_rtp_instance_set_stats_vars() to ensure that the staging is not interrutped. * Made callers of ast_rtp_instance_set_stats_vars() not call it with any channels or channel driver private locks held to eliminate the deadlock potential. The callers must hold references to the passed in channel and rtp objects. * Eliminated sip_hangup() trying to get the bridge peer. It is futile at this point because the channel could never be in a bridge. Review: https://reviewboard.asterisk.org/r/3431/ ........ Merged revisions 412385 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412386 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-15chan_sip.c: Moved some sip_pvt unrefs after their last use.Richard Mudgett
* Moved sip_pvt unref in ast_hangup() and handle_request_do() to the end of the function. The unref needs to happen after the last use of the pointer. ........ Merged revisions 412348 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 412383 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-15Reverting r411189 so that it can be put up for public reviewJonathan Rose
--- r411189 | jrose | 2014-03-26 10:50:48 -0500 (Wed, 26 Mar 2014) | 12 lines chan_sip: Send real CallerID information with P-Assserted-Identity (RFC-3325) Prior to this patch, the P-Asserted-Identity header would include anonymous caller id information which seems to go against the point of the P-Asserted-Identity header. Now the real caller ID information will be included in this header. Also, no privacy header would be included. This patch adds 'Privacy: id' to outgoing SIP messages that include the P-Asserted-Identity header. (closes issue AST-1301) --- ........ Merged revisions 412328 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 412329 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 412330 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-12chan_sip: Support RFC-3966 TEL URIs in inbound INVITE requestsMatthew Jordan
This patch adds support for handling TEL URIs in inbound INVITE requests. This includes the Request URI and the From URI. The number specified in the Request URI will be the destination of the inbound channel in the dialplan. The phone-context specified in the Request URI will be stored in the TELPHONECONTEXT channel variable. Review: https://reviewboard.asterisk.org/r/3349 ASTERISK-17179 #close Reported by: Geert Van Pamel Tested by: Geert Van Pamel patches: asterisk-12.0.0-chan_sip-RFC3966_patch.txt uploaded by Geert Van Pamel (License 6140) asterisk-12.0.0-reqresp_parser-RFC3966_patch.txt uploaded by Geert Van Pamel (License 6140) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412292 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-11main/astobj2: Make REF_DEBUG a menuselect item; improve REF_DEBUG outputMatthew Jordan
This patch does the following: (1) It makes REF_DEBUG a meneselect item. Enabling REF_DEBUG now enables REF_DEBUG globally throughout Asterisk. (2) The ref debug log file is now created in the AST_LOG_DIR directory. Every run will now blow away the previous run (as large ref files sometimes caused issues). We now also no longer open/close the file on each write, instead relying on fflush to make sure data gets written to the file (in case the ao2 call being performed is about to cause a crash) (3) It goes with a comma delineated format for the ref debug file. This makes parsing much easier. This also now includes the thread ID of the thread that caused ref change. (4) A new python script instead for refcounting has been added in the contrib/scripts folder. (5) The old refcounter implementation in utils/ has been removed. Review: https://reviewboard.asterisk.org/r/3377/ ........ Merged revisions 412114 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 412115 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 412153 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-04internal_timing: Remove the option and always make it enabled if a timing ↵Richard Mudgett
module is loaded. The masquerade supertest frequently fails because either the local channel chain doesn't completely optimize out or the DTMF handshake doesn't completely get accross. Local channel optimization requires frames flowing to trigger when optimization can happen. When optimization happens the media frame that triggered the optimization is dropped. Sending DTMF requires frames to flow in the other direction for timing purposes while sending nothing. If internal timing is not enabled when MOH is playing, Asterisk switches to received timing when an audio frame is received. With optimization dropping media frames and MOH not sending frames unless it receives frames, occasionaly there are no more frames being passed and the test fails. * The asterisk command line -I option and the asterisk.conf internal_timing option are removed. Asterisk now always uses internal timing when needed if any timing module is loaded. The issue ASTERISK-14861 did this quite awhile ago in v1.4 but effectively is broken if other internal timing modules besides DAHDI are used. The ast_read_generator_actions() now only does received timing if it has no choice for frame generators like MOH, silence, and playback streaming. * Cleaned up some code dealing with frame generators in ast_deactivate_generator(), generator_write_format_change(), ast_activate_generator(), and ast_channel_stop_silence_generator(). * Removed ast_internal_timing_enabled(), AST_OPT_FLAG_INTERNAL_TIMING, and ast_opt_internal_timing. ASTERISK-22846 #close Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3414/ ........ Merged revisions 411715 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411716 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 411717 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411724 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-28chan_sip: Add MESSAGE request to allowed methodsMatthew Jordan
The allowed methods advertised by chan_sip did not previously note the MESSAGE request. Even in Asterisk 1.8, we do accept in-dialog MESSAGE requests; we should advertise that we support MESSAGE requests. ASTERISK-23504 #close ASTERISK-23504 #comment Reported by: Martin Kontsek ASTERISK-23504 #comment Patch sip.h_patch.diff uploaded by Martin Kontsek (license 6587) Review: https://reviewboard.asterisk.org/r/3396/ ........ Merged revisions 411372 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411373 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 411374 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411375 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-27Fix dialplan function NULL channel safety issuesCorey Farrell
(closes issue ASTERISK-23391) Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/3386/ ........ Merged revisions 411313 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411314 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 411315 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411328 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-26chan_sip: Send real CallerID information with P-Assserted-Identity (RFC-3325)Jonathan Rose
Prior too this patch, the P-Asserted-Identity header would include anonymous caller id information which seems to go against the point of the P-Asserted-Identity header. Now the real caller ID information will be included in this header. Also, no privacy header would be included. This patch adds 'Privacy: id' to outgoing SIP messages that include the P-Asserted-Identity header. (closes issue AST-1301) ........ Merged revisions 411189 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411190 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 411193 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411194 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-25chan_sip: Fix incorrect use of timersKinsey Moore
If update_provisional_keepalive() is called while send_provisional_keepalive_full() is waiting on the PVT lock, then pvt->provisional_keepalive_sched_id will be changed to a new sched_id value by update_provisional_keepalive(), but that new sched_id then may be overwritten with -1 by send_provisional_keepalive_full(), killing the pvt's reference to a schedule and "leaking" the reference. (closes issue ASTERISK-22079) Review: https://reviewboard.asterisk.org/r/3368/ Reported by: Jamuel Starkey, Matteo, Leif Madsen, Steve Davies Patches: provisional_keepalive_fix.diff uploaded by Steve Davies (license 5012) ........ Merged revisions 411088 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411089 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 411091 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-24chan_sip: Always use fromdomain if set for domain, even if callerid is set ↵Joshua Colp
to restricted. (closes issue ASTERISK-20841) Reported by: Kelly Goedert ........ Merged revisions 411021 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411022 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 411023 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-10AST-2014-002: chan_sip: Exit early on bad session timers requestKinsey Moore
This change allows chan_sip to avoid creation of the channel and consumption of associated file descriptors altogether if the inbound request is going to be rejected anyway. (closes issue ASTERISK-23373) Reported by: Corey Farrell Patches: chan_sip-earlier-st-1.8.patch uploaded by Corey Farrell (license 5909) chan_sip-earlier-st-11.patch uploaded by Corey Farrell (license 5909) ........ Merged revisions 410308 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 410311 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 410329 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07chan_sip: Fix deadlock of monlock between unload_module and do_monitorCorey Farrell
Release monlock before calling pthread_join. This ensures do_monitor cannot freeze by locking monlock during module unload. (closes issue ASTERISK-21406) Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/3284/ ........ Merged revisions 410224 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 410225 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 410226 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07uniqueid: Fix chan_dahdi, sig_pri, sig_ss7, test_cdr, and test_cel compiler ↵Richard Mudgett
errors. (issue ASTERISK-23120) ........ Merged revisions 410171 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07uniqueid: channel linkedid, ami, ari object creation with id'sScott Griepentrog
Much needed was a way to assign id to objects on creation, and much change was necessary to accomplish it. Channel uniqueids and linkedids are split into separate string and creation time components without breaking linkedid propgation. This allowed the uniqueid to be specified by the user interface - and those values are now carried through to channel creation, adding the assignedids value to every function in the chain including the channel drivers. For local channels, the second channel can be specified or left to default to a ;2 suffix of first. In ARI, bridge, playback, and snoop objects can also be created with a specified uniqueid. Along the way, the args order to allocating channels was fixed in chan_mgcp and chan_gtalk, and linkedid is no longer lost as masquerade occurs. (closes issue ASTERISK-23120) Review: https://reviewboard.asterisk.org/r/3191/ ........ Merged revisions 410157 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07chan_sip: Allow static realtime members to be qualified during module load.Matthew Jordan
When a static realtime peer with qualify=yes is loaded, Asterisk will fail to send an OPTIONS request due to the lastms being equal to 0. This results in the peer being unable to receive calls from Asterisk because the status is permanently UNKNOWN. This patch allows an OPTIONS request to be sent during module load by ignoring the lastms value on startup only. Review: https://reviewboard.asterisk.org/r/3294/ (closes issue ASTERISK-17523) Reported by: Maciej Krajewski Tested by: wushumasters patches: realtime_fix_11.7.0.txt uploaded by Trevor Peirce (license 6112) ........ Merged revisions 410105 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 410106 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 410107 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410108 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-05Add update_peer function to unistim_rtp_glue, improve other unistim_rtp_glue ↵Igor Goncharovskiy
functions conforming to other channel drivers. Do not forget auto-detected and user-selected phone settings on 'unistim reload' ........ Merged revisions 409705 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 409745 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409747 65c4cc65-6c06-0410-ace0-fbb531ad65f3