Commit Graph

7959 Commits

Author SHA1 Message Date
Richard Mudgett 4c252096ef chan_dahdi: Fix analog dialtone detection.
* 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-16 20:06:59 +00:00
Richard Mudgett 6e2e38083d sig_pri.c: Pull the pri_dchannel() PRI_EVENT_RING case into its own function.
* 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-16 17:32:44 +00:00
Jonathan Rose e81b873fa2 chan_sip: Add TLS and SRTP status to CLI command 'sip show channel'
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-13 18:09:13 +00:00
Richard Mudgett 8b6ab4782a chan_dahdi/sig_pri: Prevent unnecessary PROGRESS events when overlap dialing 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-13 00:35:31 +00:00
Richard Mudgett 552dbe531e Fix compiler warning from GCC 4.10 fixup.
........

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-13 00:23:45 +00:00
Kinsey Moore abd3e4040b Allow Asterisk to compile under GCC 4.10
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-09 22:49:26 +00:00
Richard Mudgett 119599407b res_pjsip_refer: Add Referred-By header on INVITE for blind transfers.
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-05-02 16:39:58 +00:00
Richard Mudgett 20750e261b chan_sip.c: Fixed off-nominal message iterator ref count and alloc fail issues.
* 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-30 21:03:29 +00:00
Joshua Colp f2a060f502 chan_pjsip: Fix deadlock when retrieving call-id of channel.
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-30 20:39:17 +00:00
Joshua Colp 56ca10c7f1 chan_pjsip: Add support for picking up calls in the configured pickup group.
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-30 12:32:12 +00:00
Joshua Colp 2e39da35d0 chan_pjsip: Implement core ability to get Call-ID of a channel.
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-29 11:27:14 +00:00
Igor Goncharovskiy d3433771c9 Introducing changes proposed to chan_unistim driver:
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-28 07:43:33 +00:00
Jonathan Rose ae21162a69 chan_sip: Add sendrpid trust options
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-21 16:20:32 +00:00
Igor Goncharovskiy cb6d928a39 Fix wrong dialtone. The "modulation" should not be referenced for tone+tone 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-21 08:36:18 +00:00
Matthew Jordan c3497aa2bb main/Makefile: Fix build failure on SmartOS/Illumos/SunOS
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-17 20:25:16 +00:00
Matthew Jordan 7d26eefce4 chan_sip: Add SIPURIPHONECONTEXT channel variable for Request TEL URIs
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-17 19:50:05 +00:00
Richard Mudgett 45ade68cb4 Remove unused RAII_VAR() declarations.
* 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-15 18:01:47 +00:00
Richard Mudgett d28af99e65 chan_sip.c: Fix channel staging assertion failure.
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-15 17:07:20 +00:00
Richard Mudgett c6a2a513c2 chan_sip.c: Moved some sip_pvt unrefs after their last use.
* 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-15 16:38:35 +00:00
Jonathan Rose cc4a0a7fc9 Reverting r411189 so that it can be put up for public review
---
  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-15 16:13:35 +00:00
Matthew Jordan eed03fc01a chan_sip: Support RFC-3966 TEL URIs in inbound INVITE requests
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-12 02:27:43 +00:00
Matthew Jordan 4f30c7e91f main/astobj2: Make REF_DEBUG a menuselect item; improve REF_DEBUG output
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-11 02:59:19 +00:00
Richard Mudgett 03beadb6e9 internal_timing: Remove the option and always make it enabled if a timing 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-04-04 19:19:55 +00:00
Matthew Jordan 562182f5b0 chan_sip: Add MESSAGE request to allowed methods
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-28 03:55:26 +00:00
Corey Farrell fbe0dfaf44 Fix dialplan function NULL channel safety issues
(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-27 19:21:44 +00:00
Jonathan Rose fa3a2f8eca chan_sip: Send real CallerID information with P-Assserted-Identity (RFC-3325)
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-26 16:15:12 +00:00
Kinsey Moore a4890eddfb chan_sip: Fix incorrect use of timers
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-25 16:06:57 +00:00
Joshua Colp 6d81951f0d chan_sip: Always use fromdomain if set for domain, even if callerid is set 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-24 21:39:46 +00:00
Kinsey Moore c300f7e5a8 AST-2014-002: chan_sip: Exit early on bad session timers request
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-10 13:30:51 +00:00
Corey Farrell 0291965f79 chan_sip: Fix deadlock of monlock between unload_module and do_monitor
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-07 22:56:15 +00:00
Richard Mudgett ecbd052741 uniqueid: Fix chan_dahdi, sig_pri, sig_ss7, test_cdr, and test_cel compiler 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-07 19:19:04 +00:00
Scott Griepentrog 80ef9a21b9 uniqueid: channel linkedid, ami, ari object creation with id's
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-07 15:47:55 +00:00
Matthew Jordan d3ac8b8a0e chan_sip: Allow static realtime members to be qualified during module load.
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-07 05:04:32 +00:00
Igor Goncharovskiy fe73de1302 Add update_peer function to unistim_rtp_glue, improve other unistim_rtp_glue 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
2014-03-05 06:17:03 +00:00
Sean Bright f5b2f1333f Minor whitespace change to 'sip show peers' output.
(closes issue ASTERISK-23406)
Reported by: ibercom
Tested by: ibercom
Patches:
    asterisk-11.patch uploaded by ibercom
........

Merged revisions 409472 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 409473 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 409474 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409475 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-04 14:55:24 +00:00
Richard Mudgett d820685e83 chan_sip: Add precautionary p->owner checks.
* Add precautionary p->owner checks in sip_hangup(), get_refer_info(),
get_also_info(), and interpret_t38_parameters().

* Simplify some tangled logic in get_refer_info(), get_also_info(), and
add_rpid().

* Removed some dead code in handle_request_invite().

(closes issue ASTERISK-23323)
Reported by: Walter Doekes
Patches:
      issueA23323-more_p_owner_checks-1.8.x.patch (license #5674) uploaded by wdoekes (modified)
      issueA23323-more_p_owner_checks-11.x.patch (license #5674) uploaded by wdoekes (modified)
      issueA23323-more_p_owner_checks-12.x.patch (license #5674) uploaded by wdoekes (modified)
      issueA23323-more_p_owner_checks-trunk.patch (license #5674) uploaded by wdoekes (modified)
........

Merged revisions 409207 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 409255 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 409256 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409257 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-28 21:44:26 +00:00
Richard Mudgett 954a3cf26f chan_sip: Fix crash in ast_channel_hangupcause_set().
* Fix crash in ast_channel_hangupcause_set() because p->owner not checked
before calling.  Regression introduced by the fix for ASTERISK-22621.

(closes issue ASTERISK-23135)
Reported by: OK

(issue ASTERISK-23323)
Reported by: Walter Doekes
........

Merged revisions 409156 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 409157 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 409158 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409159 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-28 18:03:56 +00:00
Scott Griepentrog 5a46d69543 pjsip: avoid edge case potential crash in answer()
When accidentally compiling against a wrong version of
pjsip headers with a different pjsip_inv_session size,
the invite_tsx structure could be null in the answer()
function.  This led to a crash because it attempted to
send the session response with an uninitialized packet
pointer.  This patch presets packet to null and adds a
diagnostic log message to explain why the call fails.

Review: https://reviewboard.asterisk.org/r/3267/
........

Merged revisions 408970 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408971 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-26 19:00:56 +00:00
Igor Goncharovskiy 9397e7af2a Implement functions handling keypress, display icons and text for i2004 KEM support.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-26 08:57:14 +00:00
Corey Farrell 3cfa1c8826 chan_sip: prevent add_route from adding empty header.
Fix regression caused by ASTERISK-22582.  Empty Route
headers were added when the route had a single strict
hop.

(closes issue ASTERISK-23306)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3236/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408699 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-21 16:49:03 +00:00
Matthew Jordan f001981862 chnan_sip: Set SIP_DEFER_BYE_ON_TRANSFER prior to calling bridge blind transfer
This patch moves setting SIP_DEFER_BY_ON_TRANSFER prior to calling
ast_bridge_transfer_blind. This prevents a BYE from being sent prior to the
NOTIFY request that informs the transferor if the transfer succeeded or failed.

This patch also clears said flag from the off nominal NOTIFY paths in the
local_attended_transfer code, as once we've sent the NOTIFY request it is safe
to send by the BYE request.

This was caught by the blind-transfer-accountcode test in the Asterisk Test
Suite.

(closes issue ASTERISK-23290)
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/3214/
........

Merged revisions 408069 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-14 12:41:13 +00:00
Corey Farrell cb4e210773 chan_sip: Isolate code that manages struct sip_route.
* Move route code to sip/route.c + sip/include/route.h
* Rename functions to sip_route_*
* Replace ad-hoc list code with macro's from linkedlists.h
* Create sip_route_process_header() to processes Path and Record-Route headers
  (previously done with different code in build_route and build_path)
* Add use of const where possible
* Move struct uriparams, struct contact and contactliststruct from sip.h to
  reqresp_parser.h.  sip/route.c uses reqresp_parser.h but not sip.h, this was
  a problem.  These moved declares are not used outside of reqresp_parser.
* While modifying reqprep() the lack of {} caused me trouble.  I added them.
* Code outside route.c treats sip_route as an opaque structure, using macro's
  or procedures for all access.

(closes issue ASTERISK-22582)
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/3173/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407926 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-10 18:28:35 +00:00
Richard Mudgett 67f84590e5 chan_iax2: Add some more iaxs[] NULL checks to a routine already full of them.
........

Merged revisions 407764 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 407765 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 407766 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407767 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-07 20:52:40 +00:00
Richard Mudgett 6f38887cb7 chan_iax2: Block unnecessary control frames to/from the wire.
Establishing an IAX2 call between Asterisk v1.4 and v1.8 (or later)
results in an unexpected call disconnect.  The problem happens because
newer values in the enum ast_control_frame_type are not consistent between
the branch versions of Asterisk.

For example:
1) v1.4 calls v1.8 (or later) using IAX2

2) v1.8 answers and sends a connected line update control frame.  (on v1.8
AST_CONTROL_CONNECTED_LINE = 22)

3) v1.4 receives the control frame as an end-of-q (on v1.4
AST_CONTROL_END_OF_Q = 22)

4) v1.4 disconnects the call once the receive queue becomes empty.

Several things are done by this patch to fix the problem and attempt to
prevent it from happening again in the future:

* Added a warning at the definition of enum ast_control_frame_type about
how to add new control frame values.

* Made block sending and receiving control frames that have no reason to
go over the wire.

* Extended the connectedline iax.conf parameter to also include the
redirecting information updates.

* Updated the connectedline iax.conf parameter documentation to include a
notice that the parameter must be "no" when the peer is an Asterisk v1.4
instance.

(closes issue AST-1302)

Review: https://reviewboard.asterisk.org/r/3174/
........

Merged revisions 407678 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 407727 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 407729 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407731 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-07 18:29:49 +00:00
Damien Wedhorn a744b29ab5 Skinny - Fix deadlock when pickup of no call.
Locking issues in skinny when picking up a call that doesn't exist. Cleaned 
up sub locking by fully removing and using the chan lock instead. Also
changed ast_call_pickup to check whether chan was masq'd.

(closes issue ASTERISK-23249)
Reported by: wedhorn
Tested by: snuffy, myself
Patches: 
    skinny-locking01.diff uploaded by wedhorn (license 5019)
........

Merged revisions 407197 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407198 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-04 02:07:18 +00:00
Damien Wedhorn e8eb6a9e30 Skinny: fix up possible double unlock of chan.
Return before chan is possibly unlocked a second time when hanging up
a channel in SUBSTATE_OFFHOOK.
........

Merged revisions 406987 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406988 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-31 05:31:45 +00:00
Kinsey Moore 0fbffdb3b2 chan_sip: Decline image streams on unsupported transports
This change allows chan_sip to decline individual image streams over
unsupported transports in the SDP of the 200 response. Previously,
an image stream offer with RTP/AVP as the transport would cause
chan_sip to respond with a 488.

(closes issue ASTERISK-22988)
Reported by: adomjan
Original patch by: adomjan
........

Merged revisions 406170 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 406171 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 406172 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-22 18:34:13 +00:00
Kinsey Moore b2a682bae2 chan_mgcp: Enforce locking for oseq
This restricts direct usage of global oseq so that all accesses are
locked and threads are not racing to get oseq values that they did not
claim.

This also fixes a build error in res_pktccops under dev mode.

(closes issue ASTERISK-23100)
Reported by: adomjan
Patch by: adomjan
........

Merged revisions 406037 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 406038 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 406049 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-21 20:28:57 +00:00
Damien Wedhorn 4bc84b1b9f Skinny: fix up handling of fragmented packets.
Bad offset in reading second or more fragment of skinny packets. Fixed
to offset by char (single byte) rather than size of req.
........

Merged revisions 405982 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-20 23:25:38 +00:00
Richard Mudgett eddbe10f91 chan_dahdi/PRI: Suppress CONNECTED_LINE updates when nothing in the udpate is valid.
* Also simplified some subddress handling code.

(closes issue ASTERISK-23008)
Reported by: Michael Cargile
........

Merged revisions 405926 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 405927 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 405928 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-20 22:23:00 +00:00