Commit Graph

7894 Commits

Author SHA1 Message Date
Richard Mudgett 30cf1a590c Remove some unnecessary calls to ast_bridged_channel() in chan_skinny.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01 20:01:10 +00:00
Richard Mudgett b050778ce8 Remove some unnecessary calls to ast_bridged_channel() in chan_iax2.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01 20:00:53 +00:00
Richard Mudgett 5ab5715646 Remove some unnecessary calls to ast_bridged_channel() in chan_dahdi.c/sig_analog.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387181 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01 20:00:31 +00:00
Matthew Jordan b693a72378 Prevent crash in 'sip show peers' when the number of peers on a system is large
When you have lots of SIP peers (according to the issue reporter, around 3500),
the 'sip show peers' CLI command or AMI action can crash due to a poorly placed
string duplication that occurs on the stack. This patch refactors the command
to not allocate the string on the stack, and handles the formatting of a single
peer in a separate function call.

(closes issue ASTERISK-21466)
Reported by: Guillaume Knispel
patches:
  fix_sip_show_peers_stack_overflow_asterisk_11.3.0-v2.patch uploaded by gknispel (License 6492)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387135 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01 18:38:40 +00:00
Richard Mudgett 3a5a0f3f26 Move some annoying chan_dahdi debug messages to level 5.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387108 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01 17:15:26 +00:00
Jonathan Rose 8e257fe819 Stasis Core: Refactor ACL Change events to go out over the stasis core msg bus
(issue ASTERISK-21103)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2481/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387037 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-30 22:37:24 +00:00
Jason Parker cc9b4d8da4 Fix a log message.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-30 18:12:36 +00:00
Mark Michelson 74f2318051 Merge the pimp_my_sip branch into trunk.
The pimp_my_sip branch is being merged at this point because
it offers basic functionality, and from an API standpoint, things
are complete.

SIP work is *not* feature-complete; however, with the completion
of the SUBSCRIBE/NOTIFY API, all APIs (except a PUBLISH API) have
been created, and thus it is possible for developers to attempt
to create new SIP work.

API documentation can be found in the doxygen in the code, but
usability documentation is still lacking.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-25 18:25:31 +00:00
Michael L. Young b4c881c86e Fix Displaying Symmetric RTP Global Setting
* Use comedia_string() to display correctly the symmetric rtp setting when
  running "sip show settings"
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386487 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-25 03:04:21 +00:00
Michael L. Young 735026ccf6 Change Case On Forcerport For Consistency
* Change "ForcerPort" to "Forcerport" to match everywhere else it is displayed
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-25 02:48:44 +00:00
Matthew Jordan 5111744214 Don't attempt to create a voice frame on a read error
Prior to this patch, a read error in snd_pcm_readi would still be treated as a
nominal result when constructing a voice frame from the expected data. Since
the value returned is negative, as opposed to the number of samples read,
this could result in a crash. With this patch, we now return a null frame
when a read error is detected.

Note that the patch on ASTERISK-21329 was modified slightly for this commit,
in that we bail immediately on detecting the read error, rather than bypassing
the construction of the voice frame.

(closes issue ASTERISK-21329)
Reported by: Keiichiro Kawasaki
patches:
  chan_alsa.diff uploaded by kawasaki (License 6489)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-14 02:35:04 +00:00
Michael L. Young fcbb9f0c8d Fix One-Way Audio With auto_* NAT Settings When SIP Calls Initiated By PBX
When we reload Asterisk or chan_sip, the flags force_rport and comedia that are
turned on and off when using the auto_force_rport and auto_comedia nat settings
go back to the default setting off.  These flags are turned on when needed or
off when not needed at the time that a peer registers, re-registers or initiates
a call.  This would apply even when only the default global setting
"nat=auto_force_rport" is being used, which in this case would only affect the
force_rport flag.

Everything is good except for the following:  The nat setting is set to
auto_force_rport and auto_comedia.  We reload Asterisk and the peer's
registration has not expired.  We load in the settings for the peer which turns
force_rport and comedia back to off.  Since the peer has not re-registered or
placed a call yet, those flags remain off.  We then initiate a call to the peer
from the PBX.  The force_rport and comedia flags stay off.  If NAT is involved,
we end up with one-way audio since we never checked to see if the peer is behind
NAT or not.

This patch does the following:

* Moves the checking of whether a peer is behind NAT into its own function

* Create a function to set the peer's NAT flags if they are using the auto_* NAT
  settings

* Adds calls in sip_request_call() to these new functions in order to setup the
  dialog according to the peer's settings

(closes issue ASTERISK-21374)
Reported by: Michael L. Young
Tested by: Michael L. Young
Patches:
    asterisk-21374-auto-nat-outgoing-fix_v2.diff Michael L. Young (license 5026)

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-12 15:06:09 +00:00
Alec L Davis e5b0de5535 IAX2 defer_full_frames fail to get sent
Ensure iax2_process_thread is signalled when a deferred frame is queued to it.

(closes issue ASTERISK-18827)
Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385431 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-12 08:52:44 +00:00
Alec L Davis 3959535615 IAX2, prevent network thread starting before all helper threads are ready
On startup, it's possible for a frame to arrive before the processing threads were ready.

In iax2_process_thread() the first pass through falls into ast_cond_wait, should a frame arrive
before we are at ast_cond_wait, the signal will be ignored.
The result iax2_process_thread stays at ast_cond_wait forever, with deferred frames being queued.  

Fix: When creating initial idle iax2_process_threads, wait for init_cond to be signalled
after each thread is started.
 
(issue ASTERISK-18827)
Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385406 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-12 08:18:20 +00:00
Matthew Jordan caf4a5f605 Fix crash in chan_sip when a core initiated op occurs at the same time as a BYE
When a BYE request is processed in chan_sip, the current SIP dialog is detached
from its associated Asterisk channel structure. The tech_pvt pointer in the
channel object is set to NULL, and the dialog persists for an RFC mandated
period of time to handle re-transmits.

While this process occurs, the channel is locked (which is good).
Unfortunately, operations that are initiated externally have no way of knowing
that the channel they've just obtained (which is still valid) and that they are
attempting to lock is about to have its tech_pvt pointer removed. By the time
they obtain the channel lock and call the channel technology callback, the
tech_pvt is NULL.

This patch adds a few checks to some channel callbacks that make sure the
tech_pvt isn't NULL before using it. Prime offenders were the DTMF digit
callbacks, which would crash if AMI initiated a DTMF on the channel at the
same time as a BYE was received from the UA. This patch also adds checks on
sip_transfer (as AMI can also cause a callback into this function), as well
as sip_indicate (as lots of things can queue an indication onto a channel).

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

(closes issue ASTERISK-20225)
Reported by: Jeff Hoppe
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-10 14:07:27 +00:00
Michael L. Young 03286cf23f Fix For Not Overriding The Default Settings In chan_sip
The initial report was that the "nat" setting in the [general] section was not
having any effect in overriding the default setting.  Upon confirming that this
was happening and looking into what was causing this, it was discovered that
other default settings would not be overriden as well.

This patch works similar to what occurs in build_peer().  We create a temporary
ast_flags structure and using a mask, we override the default settings with
whatever is set in the [general] section.

In the bug report, the reporter who helped to test this patch noted that the
directmedia settings were being overriden properly as well as the nat settings.

This issue is also present in Asterisk 1.8 and a separate patch will be applied
to it.

(issue ASTERISK-21225)
Reported by: Alexandre Vezina
Tested by: Alexandre Vezina, Michael L. Young
Patches:
  asterisk-21225-handle-options-default-prob_v4.diff
						Michael L. Young (license 5026)

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-05 20:41:27 +00:00
Richard Mudgett 6a25d49296 chan_dahdi: Change inband_on_proceeding option default to no/disabled.
(issue ASTERISK-21151)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-03 20:27:11 +00:00
Richard Mudgett 79818112fd chan_dahdi: Add inband_on_proceeding compatibility option.
The new inband_on_proceeding option causes Asterisk to assume inband audio
may be present when a PROCEEDING message is received.

Q.931 Section 5.1.2 says the network cannot assume that the CPE side has
attached to the B channel at this time without explicitly sending the
progress indicator ie informing the CPE side to attach to the B channel
for audio.  However, some non-compliant ISDN switches send a PROCEEDING
without the progress indicator ie indicating inband audio is available and
assume that the CPE device has connected the media path for listening to
ringback and other messages.

ASTERISK-17834 which causes this issue was dealing with a non-compliant
network switch.

(closes issue ASTERISK-21151)
Reported by: Gianluca Merlo
Tested by: rmudgett
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384696 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-03 20:20:09 +00:00
Kinsey Moore 1a2a4578d2 Convert MWI state message type to the new stasis naming convention
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384219 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-27 22:42:06 +00:00
Kinsey Moore 72bccf69c3 Address uninitialized conditional that valgrind found
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-27 19:52:19 +00:00
Matthew Jordan 0ffce56f1b AST-2013-003: Prevent username disclosure in SIP channel driver
When authenticating a SIP request with alwaysauthreject enabled, allowguest
disabled, and autocreatepeer disabled, Asterisk discloses whether a user
exists for INVITE, SUBSCRIBE, and REGISTER transactions in multiple ways. The
information is disclosed when:
 * A "407 Proxy Authentication Required" response is sent instead of a
   "401 Unauthorized" response
 * The presence or absence of additional tags occurs at the end of "403
   Forbidden" (such as "(Bad Auth)")
 * A "401 Unauthorized" response is sent instead of "403 Forbidden" response
   after a retransmission
 * Retransmission are sent when a matching peer did not exist, but not when a
   matching peer did exist.

This patch resolves these various vectors by ensuring that the responses sent
in all scenarios is the same, regardless of the presence of a matching peer.

This issue was reported by Walter Doekes, OSSO B.V. A substantial portion of
the testing and the solution to this problem was done by Walter as well - a
huge thanks to his tireless efforts in finding all the ways in which this
setting didn't work, providing automated tests, and working with Kinsey on
getting this fixed.

(closes issue ASTERISK-21013)
Reported by: wdoekes
Tested by: wdoekes, kmoore
patches:
  AST-2013-003-1.8 uploaded by kmoore, wdoekes (License 6273, 5674)
  AST-2013-003-10 uploaded by kmoore, wdoekes (License 6273, 5674)
  AST-2013-003-11 uploaded by kmoore, wdoekes (License 6273, 5674)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-27 15:27:31 +00:00
Damien Wedhorn 63a4da4eba Fix skinny encall button to not blind xfer.
The softbutton endcall should not turn a transfer into a blind transfer but
hangup the exten being called and leave the original call on hold. This does
that.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383948 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-27 07:24:37 +00:00
Matthew Jordan 58ee2b7d11 Resolve deadlock between SIP registration and channel based functions
In r373424, several reentrancy problems in chan_sip were addressed. As a
result, the SIP channel driver is now properly locking the channel driver
private information in certain operations that it wasn't previously. This
exposed two latent problems either in register_verify or by functions called
by register_verify. This includes:
 * Holding the private lock while calling sip_send_mwi_to_peer. This can create
   a new sip_pvt via sip_alloc, which will obtain the channel container lock.
   This is a locking inversion, as any channel related lock must be obtained
   prior to obtaining the SIP channel technology private lock.

   Note that this issue was already fixed in Asterisk 11.

 * Holding the private lock while calling sip_poke_peer. In the same vein as
   sip_send_mwi_to_peer, sip_poke_peer can create a new SIP private, causing
   the same locking inversion.

Note that this locking inversion typically occured when CLI commands were run
while a SIP REGISTER request was being processed, as many CLI commands (such
as 'sip show channels', 'core show channels', etc.) have to obtain the channel
container lock.

(issue ASTERISK-21068)
Reported by: Nicolas Bouliane

(issue ASTERISK-20550)
Reported by: David Brillert

(issue ASTERISK-21314)
Reported by: Badalian Vyacheslav

(issue ASTERISK-21296)
Reported by: Gabriel Birke
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383879 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-26 02:30:10 +00:00
Russell Bryant 88874a95d7 Suppress compiler warning.
This code caused a compiler warning when --enable-dev-mode was not used.
The warning was that this variable was set but not used.  That was indeed
the case as the only place this is used is as an argument to SKINNY_DEBUG
which is compiled out when not in dev mode.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383838 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-26 01:46:39 +00:00
Richard Mudgett 23f363fcb1 Set the CALLERID(dnid-num-plan) for incoming ISDN calls.
The CALLEDTON channel variable is set for incoming ISDN calls to the lower
7 bits of the Q.931 type-of-number/numbering-plan octet.  The
CALLERID(dnid-num-plan) should have the same value.

(closes issue ASTERISK-21248)
Reported by: rmudgett
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383799 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-25 23:25:32 +00:00
Damien Wedhorn 401f7c1880 Fix skinny voicemail indication issues.
Unsubscribe from MWI stasis event on channel reload.

(closes issue ASTERISK-21216)
Reported by: wedhorn 
Tested by: snuffy, myself
Patches: 
    skinny-mwiind02.diff uploaded by snuffy (license 5024)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383560 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-22 06:32:03 +00:00
Kinsey Moore 6300aa6ae4 Make sure things compile...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-16 16:00:40 +00:00
Kinsey Moore 99aa02d17f Transition MWI to Stasis-core
Remove MWI's dependency on the event system by moving it to
Stasis-core. This also introduces forwarding topic pools in Stasis-core
which aggregate many dynamically allocated topics into a single primary
topic.

Review: https://reviewboard.asterisk.org/r/2368/
(closes issue ASTERISK-21097)
Patch-by: Kinsey Moore


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-16 15:45:58 +00:00
Kinsey Moore ad5f3a5759 tcptls: Prevent unsupported options from being set
AMI, HTTP, and chan_sip all support TLS in some way, but none of them
support all the options that Asterisk's TLS core is capable of
interpreting. This prevents consumers of the TLS/SSL layer from setting
TLS/SSL options that they do not support.

This also gets tlsverifyclient closer to a working state by requesting
the client certificate when tlsverifyclient is set. Currently, there is
no consumer of main/tcptls.c in Asterisk that supports this feature and
so it can not be properly tested.

Review: https://reviewboard.asterisk.org/r/2370/
Reported-by: John Bigelow
Patch-by: Kinsey Moore
(closes issue AST-1093)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-15 12:53:03 +00:00
Matthew Jordan cacc356bbe When a session timer expires during a T.38 call, re-invite with correct SDP
When a session timer expires during a dialog that has re-negotiated to T.38
and Asterisk is the refresher, Asterisk will send a re-INVITE with an SDP
containing audio media only. This causes some hilarity with the poor fax
session under weigh.

This patch corrects that by sending T.38 parameters if we are in the middle of
a T.38 session.

(closes issue ASTERISK-21232)
Reported by: Nitesh Bansal
patches:
  dont-send-audio-reinvite-for-sess-timer-in-t38-call.patch uploaded by nbansal (License 6418)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-15 01:38:53 +00:00
Matthew Jordan 00e9ffb907 Include the Username field in SIP Registry events when Status is registered
In ASTERISK-17888, the AMI Registry event during SIP registrations was supposed
to include the Username field. Somehow, one of the events was missed. This
patch corrects that - the Username field should be included in all AMI Registry
events involving SIP registrations.

(issue ASTERISK-17888)

(closes issue ASTERISK-21201)
Reported by: Dmitriy Serov
patches:
  chan_sip.c.diff uploaded by Dmitriy Serov (license 6479)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-12 16:30:02 +00:00
Igor Goncharovskiy ef64b29f8b Fix core dump on CLI usage
Fix issue with 'unistim show info' CLI command when device connected not configured
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-12 08:55:14 +00:00
Kevin Harwell 09ecb25e08 Added an option to disallow music on hold
Added an option "discard_remote_hold_retrieval" (default "no") that if set does
not trigger the music on hold event.  This essentially stops telling the peer
to start music on hold.

(issue ABE-2899)
Reported by: Denis Alberto Martinez
Review: https://reviewboard.asterisk.org/r/2336/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-11 15:22:02 +00:00
Jonathan Rose b4a010e958 chan_sip: Update the via header when relaying SMS MESSAGE
Prior to this change, certain conditions for sending the message would
result in an address of '(null)' being used in the via header of the
SIP message because a NULl value of pvt->ourip was used when initially
generating the via header. This is fixed by adding a call to build_via
when the address is set before sending the message.

(closes issue ASTERISK-21148)
Reported by: Zhi Cheng
Patches:
	700-sip_msg_send_via_fix.patch uploaded by Zhi Cheng (license 6475)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-08 20:26:03 +00:00
Matthew Jordan f6f6bc7b59 Remove unused function
After r382670, get_ip_and_port_from_sdp was no longer used.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382671 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-08 04:11:12 +00:00
Matthew Jordan 12748bc735 Don't reset the RTP address on a glare re-INVITE
Originally, way back in r201583, we added the alternate RTP address so
that the RTP engine would expect to receive audio from a new source
when a glare re-INVITE occurred. In r382589, we remove the alternate
RTP source, as the 'secret' probation mode allows for switching to a new
RTP source when a previous source stops sending RTP. At the time, it
seemed appropriate to set the RTP source based on the information in the
glared re-INVITE.

Unfortunately, that doesn't work so well - in a glared re-INVITE that occurs
with no SDP - such as in a connected line update that glances - we'll set
the RTP source to an invalid address. In subsequent re-INVITE requests from
this Asterisk instance, we'll then send an invalid media address, which will
result in the remote side sending a 488. Whoops.

There isn't any need to reset the RTP source - if we're using strictrtp, we'll
simply synchronize to a new source when we stop getting packets from the old
one. If we aren't using strictrtp, then again there shouldn't be a problem.

Note that the Asterisk Test Suite's connectedline test caught this error.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382670 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-08 03:54:38 +00:00
Matthew Jordan 80b8c2349c Add a 'secret' probation strictrtp mode to handle delayed changes in RTP source
Often, Asterisk may realize that a change in the source of an RTP stream is
about to occur and ask that the RTP engine reset it's lock on the current RTP
source. In certain scenarios, it may take awhile for the new remote system to
send RTP packets, while the old remote system may continue providing RTP during
that time period. This causes Asterisk to re-lock onto the old source, thereby
rejecting the new source when the old source stops sending RTP and the new
source begins.

This patch prevents that by having a constant secondary, 'secret' probation
mode enabled when an RTP source has been chosen. RTP packets from other sources
are always considered, but never chosen unless the current RTP source stops
sending RTP.

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

(closes issue AST-1124)
Reported by: John Bigelow
Tested by: John Bigelow

(closes issue AST-1125)
Reported by: John Bigelow
Tested by: John Bigelow
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-07 15:48:06 +00:00
Matthew Jordan 8d5c36c9bb Add RFC 3327 Path header support to chan_sip
This patch adds support for RFC 3327 "Path" headers. This can be enabled in
sip.conf using the 'supportpath' setting, either on a global basis or on a
peer basis. This setting enables Asterisk to route outgoing out-of-dialog
requests via a set of proxies by using a pre-loaded route-set defined by the
Path headers in the REGISTER request. This patch also adds Realtime support
for dynamically updating the Path information for a peer.

A huge thank-you to Klaus Darillion and Olle E Johansson for their efforts
in writing this patch.

Review: https://reviewboard.asterisk.org/r/2235/
Review: https://reviewboard.asterisk.org/r/991/

(closes issue ASTERISK-16884)
Reported by: klaus3000
Tested by: klaus3000, oej, mjordan
patches:
  path-1.8.0-patch.txt uploaded by klaus3000 (License 5054)
  oolong-path-support-trunk in team branch by oej (License 5267)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382440 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-05 13:14:43 +00:00
Igor Goncharovskiy 469ca1c71d Fix several unreleased mutex locks that cause problem with processing calls
Reported by: Daniel Bohling
Tested by: Daniel Bohling

(Closes issue ASTERISK-21119)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382411 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-05 03:53:44 +00:00
Michael L. Young a3ad8b28e6 Fix / Clean Up Some Items To Handle The New auto_* NAT Options
The original report had to do with a realtime peer behind NAT being pruned and
the peer's private address being used instead of its external address.  Upon
debugging, it was discovered that this was being caused by the addition of
the auto_force_rport and auto_comedia settings.

This patch does the following:

* Adds a missing note to the CHANGES file indicating that the default global nat
  setting is auto_force_rport

* Constify the 'req' parameter for check_via()

* Add calls to check_via() in a couple of places in order for the auto_*
  settings to do their job in attempting to determine if NAT is involved

* Set the flags SIP_NAT_FORCE_RPORT and SIP_PAGE2_SYMMETRICRTP if the auto_*
  settings are in use where it was needed

* Moves the copying of peer flags up in build_peer() to before they are used;
  this fixes the realtime prune issue

* Update the contrib/realtime schemas to allow the nat column to handle the
  different nat setting combinations we have

This patch received a review and "Ship It!" on the issue itself.

(closes issue ASTERISK-20904)
Reported by: JoshE
Tested by: JoshE, Michael L. Young
Patches:
  asterisk-20904-nat-auto-and-rt-peersv2.diff Michael L. Young (license 5026)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382323 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-01 04:32:01 +00:00
Matthew Jordan 1a34b465bc Prevent deadlock in chan_iax2 when attempting to set caller ID
A deadlock can occur in chan_iax2 when it attempts to set the caller ID, as it
already holds the iax2 private lock and improperly fails to obtain the channel
lock before calling ast_set_callerid. By not safely obtaining the channel lock,
a locking inversion can take place, causing a deadlock.

This patch solves this by calling the required deadlock avoidance functions
that obtain the channel lock before setting the caller ID.

Thanks to Pavel for fixing my syntax errors and testing this patch out.

(closes issue ASTERISK-21128)
Reported by: Pavel Troller
Tested by: Pavel Troller
patches:
  ASTERISK-21128-1.8.diff uploaded by mjordan (license 6283)
  ASTERISK-21128-modified-1.8.diff uploaded by Pavel Troller (license 6302)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382236 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-28 17:17:35 +00:00
Richard Mudgett de90681293 More places to eliminate the cast to argv but were not giving warnings.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382204 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-27 20:31:56 +00:00
Richard Mudgett 31f08344ee Fix compiler warning by eliminating the need for a cast.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-27 20:21:40 +00:00
Joshua Colp e0b49e7331 Relax dialog checking in get_sip_pvt_byid_locked so it works when the dialog is forked.
(closes issue ASTERISK-20638)
Reported by: eelcob
Patches:
      pedantic-call-pickup-from-tag.patch uploaded by eelcob (license 6442)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-27 16:19:51 +00:00
Walter Doekes d33d9c1781 Correct RPID parsing for unquoted display-name.
Parsing Remote-Party-ID will now succeed if display-name is of the
*(token LWS) kind and not just the quoted-string kind.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382109 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-26 19:36:30 +00:00
Damien Wedhorn b34479ad37 More called details fixup for skinny.
Basically sets the callerid and callername to the first device talked to for the
purposes of putting the the calls made log on the device. Does not affect the device
displaying who the device is currently talking to.

Also some minor changes to use sub->exten in lieu of l->lastnumberdialed.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382008 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-25 07:09:37 +00:00
Damien Wedhorn 0928f45794 Add prinotify messages to skinny.
Adds both fixed and variable prinotify messages and clearprinotify messages to skinny.
Also adds cli function for pushing messages to devices. i

Initial code by snuffy, expanded by myself to include fixed messages.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382007 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-25 06:46:00 +00:00
Matthew Jordan f6abcce7c1 Set the sin_family on the bind address socket during initialization
Somehow, chan_jingle has managed to operate for years without setting the
sin_family on its bindaddr socket. This patch properly sets the field during
initial module load to AF_INET.

Note that the patch on the issue was modified slightly to change the
initialization of the socket from allocation of a chan_jingle private to the
module initialization, as the bindaddr object (which is static) only needs to
have the address set once.

(closes issue ASTERISK-19341)
Reported by: andre valentin
patches:
  0105-chan_jingle.patch uploaded by avalentin (License 6064)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381977 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-24 23:01:17 +00:00
Michael L. Young d1f8e338b0 Add The Status Of A Module To The Output Of "CLI> module show"
When a module's configuration is not loadable, we still load the module but it
is not in a running state.  When trying to troubleshoot, let's say, why
chan_motif is ignoring inbound XMPP traffic, there is no way to indicate that a
loaded module is not currently running.

(closes issue ASTERISK-21108)
Reported by: Rusty Newton
Tested by: Michael L. Young
Patches:
  asterisk-21108_add_status-v2.diff Michael L. Young (license 5026)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-19 17:17:10 +00:00
Damien Wedhorn 0d553eece8 Add serviceURL stuff to skinny.
Patch adds all the packet and structure stuff to skinny to enable setting 
service URLs in skinny, such as corporate directories.

This stuff is only relevant during load/unload as when activated. Also 
some minor changes removing duplicated counting of addons and speedials in 
handle_skinny_show_devices.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381718 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-19 06:54:23 +00:00
Damien Wedhorn 96025d5dfc Fixup skinny CLI completion.
Auto complete for skinny debug allows multiple options and negation, also add 
debug all option. Usage example: 'skinny debug all -packets' (each can be 
autocompleted including -packet).

Change show device to use device name. Remove the duplicate ast_strdup's from 
place calling device complete return immediately from complete devicename and 
complete linename so that multiple options are displayed on the CLI if more 
than one option available.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-19 06:50:57 +00:00
Matthew Jordan 2ebb9863ea Don't send presencestate information if the state is invalid
Previously, presencestate information was sent whenever the state was not
NOT_SET. When r381594 actually returned INVALID presence state in all the
places it was supposed to, it caused chan_sip to start adding presence
state information to NOTIFY requests that it previously would not have
added. chan_sip shouldn't be adding presence state information when the
provider is in an invalid state; users can't set the state to invalid and
an invalid state always implies that the provider is in an error condition.

(issue AST-1084)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381615 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-16 16:28:43 +00:00
Mark Michelson 8a7dd2f408 Fix a crash that occurred when a BYE was received on a replaced dialog.
Reference counting for the channel and its tech_pvt got messed up at
some point between 1.8 and 11. The result was that if a BYE for a dialog
that had been replaced (via an INVITE with Replaces) was received, Asterisk
would crash due to trying to access data on a channel that was no longer there.

The fix I introduced is to remove code that both unrefs the sip_pvt and sets
the channel's tech_pvt to NULL when an INVITE with Replaces is handled. This
way when a BYE is received, the tech_pvt will be non-NULL and so the BYE can
be processed and not cause a crash.

(closes issue ASTERISK-20929)
reported by Kristopher Lalletti
patches:
	ASTERISK-20929.patch uploaded by Mark Michelson (License #5049)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-15 18:51:40 +00:00
Jonathan Rose f008baddac chan_sip: Use video and text crypto attributes to append RTP profiles to SDP
Some bad copy/pasting resulted in using the audio crypto attribute for both
text and video RTP. Also the audio crypto isn't set until after these, so it
was really just bad all around.

(closes ASTERISK-20905)
Reported by: Kristopher Lalletti
patches:
	rtp_crypto_video_text.diff uploaded by Jonathan Rose (license 6182)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-15 17:33:32 +00:00
Matthew Jordan d04ab3c645 Add CLI configuration documentation
This patch allows a module to define its configuration in XML in source, such
that it can be parsed by the XML documentation engine. Documentation is
generated in a two-pass approach:

1. The documentation is first generated from the XML pulled from the source
2. The documentation is then enhanced by the registration of configuration
   options that use the configuration framework

This patch include configuration documentation for the following modules:
 * chan_motif
 * res_xmpp
 * app_confbridge
 * app_skel
 * udptl

Two new CLI commands have been added:
 * config show help - show configuration help by module, category, and item
 * xmldoc dump - dump the in-memory representation of the XML documentation to
   a new XML file.

Review: https://reviewboard.asterisk.org/r/2278
Review: https://reviewboard.asterisk.org/r/2058

patches:
  on review 2058 uploaded by twilson



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-15 13:38:12 +00:00
Damien Wedhorn edf0483f4f Remove extraneous stuff from r381470.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-14 19:58:33 +00:00
Damien Wedhorn ce8101c6c6 Add back sending dialnumber to skinny.
Don't know why it seemed to work during testing, but it really is needed 
for protocol v17 (and probably above).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381470 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-14 19:55:29 +00:00
Damien Wedhorn fffcdb0361 Respect callerid presentation in skinny.
Fix chan_skinny so that it respects callerID presentation of inbound calls to 
device and a couple of other minor fixes: 145 packet (add OCTAL_FROM amd callerid),
and dont send dialednumber message if protocol >= 17. 

(closes issue ASTERISK-21066)
Reported by: snuffy
Tested by: snuffy, myself
Patches: 
    skinny-respect-clid-restrictions-v2.diff uploaded by snuffy (license 5024)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381465 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-14 19:25:52 +00:00
Sean Bright 86a537c271 Use a shuffling algorithm to find unused IAX2 call numbers.
While adding red-black tree containers to astobj2 in r376575, Richard pointed
out the way chan_iax2 finds unused call numbers will prevent ao2_container
integrity checks at runtime.

This patch removes the ao2_container and instead uses fixed sized arrays and a
modified Fisher-Yates-Durstenfeld shuffle to maintain the call number list.

While the locking semantics are similar to the ao2_container implementation,
this implementation should be faster and more memory efficient.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381427 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-14 17:06:02 +00:00
Kinsey Moore 81fa307af7 Fix some more REF_DEBUG-related build errors
When sip_ref_peer and sip_unref_peer were exported to be usable in
channels/sip/security_events.c, modifications to those functions when
building under REF_DEBUG were not taken into account. This change
moves the necessary defines into sip.h to make them accessible to
other parts of chan_sip that need them.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381285 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-12 20:18:21 +00:00
Damien Wedhorn 98ef0d3215 Fix some issues with skinny callid.
Add extra string to transmit_callinfo_var, Only set string2 to tonum for outgoing calls
and changes to send_callinfo and push_callinfo to not set callid name to last number.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381195 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-11 18:54:12 +00:00
Richard Mudgett 5b236ee647 Make ast_do_masquerade() a void function.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-09 01:31:55 +00:00
David M. Lee 345253a50e Fixed failing test from r380696.
When I added my extensive suite of session timer unit tests, apparently one of
them was failing and I never noticed. If neither Min-SE nor Session-Expires is
set in the header, it was responding with a Session-Expires of the global
maxmimum instead of the configured max for the endpoint.

(issue ASTERISK-20787)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380977 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-06 20:18:05 +00:00
Damien Wedhorn c0832b4765 Fix reload skinny with active devices.
Patch ensures that d->activeline and l->activesub are moved over to the
new device and line so that on callend the appropriate subs can be found
to complete hangup before device resets.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380943 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-06 08:44:32 +00:00
Damien Wedhorn 44872e797c Reset skinny vmexten and immeddial char on reload.
Make skinny reset vmexten and immeddial to '\0' on reload to ensure that
it is set to '\0' if the appropriate item is removed/commented in 
skinny.conf. Also small fix re immeddial char in skinny.conf and add
immedial setting to skinny show settings.

(closes issue ASTERISK-21037)
Reported by: snuffy
Tested by: snuffy, myself
Patches: 
    immed_dial_fix.diff uploaded by snuffy (license 5024)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-06 06:55:02 +00:00
Damien Wedhorn 8bb9aa2f6d Add variable length displayprompt packet to skinny and use octals.
Add new variable length displayprompt packet (0x0145) to skinny. Uses the new 
packet if the device is reporting protocol versions >= 17.

Add the use of octal codes for sending prompts to both the new and old 
displayprompt messages (also cleaned up soft_key_template_default to use the 
defined octal codes).

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-02 01:52:21 +00:00
Richard Mudgett ae1421e04d chan_iax2: Fix compile error if MALLOC_DEBUG enabled.
NEVER INCLUDE astmm.h DIRECTLY!!


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-01 19:35:26 +00:00
Damien Wedhorn 523e472e1a Adds variable length callinfo packets to skinny.
Add packet 0x014A (variable length call info messages) to skinny for newer 
firmware. Plenty of unknown information but includes the equivalent functionality 
as the fixed size callinfo packet already included.
Only send this packet if protocol reported is >= 17.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380755 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-01 06:37:22 +00:00
David M. Lee 5899e13112 Process session timers, even if Session-Expires header is missing
Previously, Asterisk only processed session timer information if both the
'Supported: timer' and 'Session-Expires' headers were present. However, the
Session-Expires header is optional. If we were to receive a request with a
Min-SE greater than our configured session-expires, we would respond with a
'Session-Expires' header that was too small.

This patch cleans the situation up a bit, always processing timer information
if the 'Supported: timer' header is present.

(closes issue ASTERISK-20787)
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/2299/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380699 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-31 20:17:15 +00:00
Sean Bright d6e05d5bf3 Move IAX firmware related functionality into separate files.
This patch is mostly a reorganization of existing code with a few exceptions:

* Added doxygen comments to all of the extracted functions.

* Split reload_firmware(int unload) into iax_firmware_reload() and
  iax_firmware_unload() for readability.

* Create iax_firmware_traverse() to support the 'iax2 show firmware' CLI
  command.

* Renamed iax_check_version() to iax_firmware_get_version() and change its
  arguments and return value so that it returns a success/failure value and sets
  the selected version into an out parameter to avoid confusion with failure and
  version 0.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380695 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-31 19:52:48 +00:00
Richard Mudgett 6458a6572b chan_dahdi: Fix "dahdi show channels group" for groups greater than 31.
The variable type used was not large enough to hold a group bit field.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380576 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-30 21:59:07 +00:00
Matthew Jordan 01309cf41e Unregister SIP provider API if module load is declined
A user in #asterisk ran into a problem where a configuration error prevented
the chan_sip module from being loaded. Upon fixing their configuratione error,
they could no longer load the chan_sip module. This was because the
configuration checking happened after the SIP provider was registered with the
Asterisk core, and subsequent attempts to load the SIP module failed as the
provider was already registered.

Since we want to detect any failure in registering chan_sip as early as
possible (as that could be emblematic of a deeper mismatch between module
and Asterisk core), this patch does not change the registration location, but
does ensure that if a module load is declined, we unregister the module as
the SIP api provider.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-30 15:57:41 +00:00
Matthew Jordan 8018bdd8e1 Perform case insensitive comparisons for T.38 attributes
RFC5347 section 2.5.2 states the following:
...
The attribute "T38MaxBitRate" was once incorrectly registered with
IANA as "T38maxBitRate" (lower-case "m"). In accordance with T.38
examples and common implementation practice, the form "T38MaxBitRate"
SHOULD be generated by implementations conforming to this package.
In general, it is RECOMMENDED that implementations of this package
accept lowercase, uppercase, and mixed upper/lowercase encodings of
all the T.38 attributes.
...

Asterisk currently does not perform case insensitive matching on the T.38
attributes. This causes the T38MaxBitRate attribute to be negotiated at
2400 baud instead of 14400 (or whatever value you actually wanted).

This patch makes it so that when we compare T.38 attributes, we do so in a case
insensitive fashion.

Note that while the issue reporter did not directly write the patch, they
contributed to it (and would have provided one themselves if the license had
gone through a tad faster), and hence get attribution for it.

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

(closes issue ASTERISK-20897)
Reported by: Eric Hill
Tested by: Eric Hill
patches:
  -- uploaded by Eric Hill
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-30 14:47:26 +00:00
Sean Bright 693d609081 Move the ancillary iax2 source files into a separate sub-directory.
This patch just moves the IAX2 source and header files into a separate iax2
sub-directory in the channels directory, similar to how the sip source files are
structured.

The only thing that was added was an #ifndef to protect provision.h from multiple
inclusion.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-29 22:58:33 +00:00
Richard Mudgett 8cc7aea09b chan_agent: Prevent multiple channels from logging in as the same agent.
Multiple channels logging in as the same agent can result in dead channels
waiting for a condition signal that will never come because another
channel thread stole it.  A symptom is chan_sip repeatedly generating
warning messages about rescheduling autodestruction of dialogs with an
agent channel owner.

* Made only login_exec() (the app AgentLogin) clear the agent_pvt->chan
pointer to prevent multiple channels from logging in as the same agent.
agent_read(), agent_call(), and agent_set_base_channel() no longer
disconnect the agent channel from the agent_pvt.  This also eliminates the
need to keep checking for agent_pvt->chan being NULL.

* Made agent_hangup() not wake up the AgentLogin agent thread until it is
done.

* Made agent_request() not able to get the agent until he has logged in
and any wrapup time has expired.

* Made agent_request() use ast_hangup() instead of agent_hangup() to
correctly dispose of a channel.

* Removed agent_set_base_channel().  Nobody calls it and it is a bad thing
in general.

* Made only agent_devicestate() determine the current device state of an
agent.  Note: Agent group device states have never been supported.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380386 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-29 18:02:07 +00:00
David M. Lee e06cd59e04 Corrected crypto tag in SDP ANSWER for SRTP. (again)
The original fix (r380043) for getting Asterisk to respond with the correct
tag overlooked some corner cases, and the fact that the same code is in 1.8.

This patch moves the building of the crypto line out of
sdp_crypto_process(). Instead, it merely copies the accepted tag. The call to
sdp_crypto_offer() will build the crypto line in all cases now, using a tag of
"1" in the case of sending offers.

(closes issue ASTERISK-20849)
Reported by: José Luis Millán
Review: https://reviewboard.asterisk.org/r/2295/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-29 17:46:30 +00:00
Matthew Jordan 126060042e Ensure that a declined media stream is terminated with a '\r\n'
In r369028, chan_sip's processing of media streams in an SDP was modified to
better handle multiple offered media streams. Part of that change modified
how streams were declined. Previously, declined media streams were not
handled in an RFC compliant manner; now, we set the port number to 0 in the
media stream definition and proceed on with the next media stream.

Unfortunately, the formatting of the declined media stream forgot to append a
'\r\n' to the end of the media stream. This is normally added to the accepted
media streams later on in the processing of the SDP. Since the declined media
stream uses a different buffer than the accepted media streams (and is a
malloc'd buffer as opposed to a struct ast_str), it's easier to just slap the
'\r\n' on the declined media stream buffer rather than attempt to append it
later on.

So, that's what we do. And now some devices (and probably some providers) will
be a bit happier (but probably not terribly happy, since we just rejected
something they offered).

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

(closes issue ASTERISK-20908)
Reported by: Dennis DeDonatis
Tested by: Dennis DeDonatis
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380332 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-29 14:48:28 +00:00
Sean Bright 986c2a1818 Correct the number of available call numbers in IAX2.
There is currently an edge case where call number 32768 might be allocated for
a call, even though the IAX2 protocol requires call numbers be only 15 bits.
This resulted in some unpredictable behavior when call number 32678 is chosen.

This patch was mostly written by Richard Mudgett via ReviewBoard.  I'm just
committing it.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380256 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-28 21:09:52 +00:00
Damien Wedhorn e9446501c9 Add force dial keys to skinny.
Adds a dial softkey when the device is in DAFD. The softkey is greyed (unusable) 
until a possible dialplan match is entered. Code includes updating 
transmit_selectsoftkeys to allow the use of a button mask. Also add option
to use # or * as a dial now button. Original patch by snuffy cleaned up by myself.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380057 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-25 05:49:54 +00:00
David M. Lee 14a9fb761b Corrected crypto tag in SDP ANSWER for SRTP.
When Asterisk responds with an SDP ANSWER for SRTP, it had the code to
correctly fill in the crypto data, which was overwritten by a call to
sdp_crypto_offer. Corrected the situation by changing sdp_crypto_offer
to not replacing crypto data if it already exists.

(closes issue ASTERISK-20849)
Reported by: José Luis Millán
Tested by: Iñaki Baz Castillo
Patches:
	fix_sdp_crypto_tags.diff uploaded by Pedro Kiefer (license 6407)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-24 16:40:42 +00:00
Sean Bright df7b335ead Remove a large block of commented out code from chan_iax2.
During the conversion to the newer CLI command structure the old definitions were
commented out.  I think it's safe to remove them completely now.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-22 20:58:08 +00:00
Richard Mudgett 09fb47a65c confbridge: Minor fixes playing user counts to the conference.
* Generate a warning message if sound files do not exist when trying to
play the user count to the conference.  Use the new helper routine
sound_file_exists() for consistency.

* Put the new user into autoservice when playing user counts to the
conference.

* Check the return value of ast_bridge_impart().
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-22 00:36:52 +00:00
Damien Wedhorn ff32e094e5 Fix device call logging issues in skinny
Skinny device call logging (ie missed, place and received calls) has issues 
because the incorrect sequence of callstates is/can be sent to the device.
This patch removes some extra callstate updates driven by forces external
to skinny and ensures the needed intermediary callstate messages are sent.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-21 07:26:04 +00:00
Damien Wedhorn 822f5f5ff1 Fix issues with skinny sessions
Fixes a couple of issues with the way skinny handles sessions by ensuring
sessions aren't used after being freed. Some other minor changes.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-20 03:06:28 +00:00
David M. Lee be727bf0d2 Fix Record-Route parsing for large headers.
Record-Route parsing copied the header into a char[256] array, which can
be a problem if the header is longer than that. This patch parses the
header in place, without the copy, avoiding the issue.

In addition to the original patch, I added a unit test for the new
get_in_brackets_const function.

(closes issue ASTERISK-20837)
Reported by: Corey Farrell
Patches:
	chan_sip-build_route-optimized-rev1.patch uploaded by Corey Farrell (license 5909)
	(with minor changes by dlee)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379394 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-18 05:31:23 +00:00
Richard Mudgett 5e46455806 chan_misdn: Fix compile error.
(issue ASTERISK-15456)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379231 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-16 17:49:52 +00:00
Matthew Jordan 9693f8f10f Set the INVALID_EXTEN channel variable when chan_misdn forces the 'i' extension
The chan_misdn channel driver will send a channel with an invalid destination
to the 'i' extension itself if said extension can be reached. It forgot,
however, to set the INVALID_EXTEN channel variable when it bounces the channel
to this extension. Dialplan writers everywhere moaned at yet another
inconsistency.

This is yet another example of why duplicating logic in multiple places results
in bugs that stick around in Jira for just under three years.

Yes: ASTERISK-15456 was created on January 18th, 2010. Patch committed on
January 15th, 2013. Ouch.

(closes issue ASTERISK-15456)
Reported by: Thomas Omerzu
patches:
  chan_misdn_invalid.patch2 uploaded by Thomas Omerzu (license 5927)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379147 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-16 00:16:22 +00:00
David M. Lee a91a289154 Fix XML encoding of 'identity display' in NOTIFY messages, continued.
When r378933 was merged into 1.8, it should have also escaped
remote_display, since it will have the same XML encoding problem when
the caller/callee roles are reversed.

(closes issue ABE-2902)
Reported by: Guenther Kelleter
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379021 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-14 15:29:22 +00:00
David M. Lee aecd2429bd Fix XML encoding of 'identity display' in NOTIFY messages.
XML encoding in chan_sip is accomplished by naively building the XML
directly from strings. While this usually works, it fails to take into
account escaping the reserved characters in XML.

This patch adds an 'ast_xml_escape' function, which works similarly to
'ast_uri_encode'. This is used to properly escape the local_display
attribute in XML formatted NOTIFY messages.

Several things to note:
 * The Right Thing(TM) to do would probably be to replace the
   ast_build_string stuff with building an ast_xml_doc. That's a much
   bigger change, and out of scope for the original ticket, so I
   refrained myself.
 * It is with great sadness that I wrote my own ast_xml_escape
   function. There's one in libxml2, but it's knee-deep in
   libxml2-ness, and not easily used to one-off escape a
   string.
 * I only escaped the string we know is causing problems
   (local_display). At least some of the other strings are
   URI-encoded, which should be XML safe. Rather than figuring out
   what's safe and escaping what's not, it would be much cleaner to
   simply build an ast_xml_doc for the messages and let the XML
   library do the XML escaping. Like I said, that's out of scope.

(closes issue ABE-2902)
Reported by: Guenther Kelleter
Tested by: Guenther Kelleter
Review: http://reviewboard.digium.internal/r/365/

........

Merged revision 378919 from https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378935 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-12 06:43:37 +00:00
Damien Wedhorn 7d5345c9c0 Skinny blob cleanup
Cleanup of red blobs in chan_skinny and possible other small formatting issues.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378634 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-06 21:37:59 +00:00
Damien Wedhorn f795062662 Add group and namedgroup pickup to skinny
Above says it all. Code by snuff, cleaned up by me. 

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378624 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-06 21:09:43 +00:00
Damien Wedhorn bacc5e6604 Rewrite skinny dialing to remove threaded simpleswitch
This rewrite changes skinny dialing from the threaded simpleswitch
to a scheduled timeout approach. There were some underlying issues
with the threaded simple switch with occasional corruption and
possible segfaults.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-06 20:45:12 +00:00
Michael L. Young 209373262d Fix SIP Notify Messages To Have The Proper IP Address In The FROM Field
On a multihomed server when sending a NOTIFY message, we were not figuring out
which network should be used to contact the peer.

This patch fixes the problem by calling ast_sip_ouraddrfor() and then
build_via() so that our NOTIFY message contains the correct IP address.

Also, a debug message is being added to help follow the call-id changes that
occur.  This was helpful for confirming that the IP address was set properly
since the call-id contains the IP address.  It also will be helpful for
troubleshooting purposes when following a call in the debug logs.

(closes issue ASTERISK-20805)
Reported by: Bryan Hunt
Tested by: Bryan Hunt, Michael L. Young
Patches:
    asterisk-20805-notify-ip-v2.diff uploaded by Michael L. Young (license 5026)

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-04 21:20:12 +00:00
Richard Mudgett 1d685bd28c chan_agent: Fix wrapup time wait response.
* Made agent_cont_sleep() and agent_ack_sleep() stop waiting if the wrapup 
time expires.  agent_cont_sleep() had tried but returned the wrong value 
to stop waiting.  

* Made agent_ack_sleep() take a struct agent_pvt pointer instead of a void
pointer for better type safety.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-03 19:42:54 +00:00
Richard Mudgett da7c2e3ffe chan_agent: Misc code cleanup.
* Fix off-nominal path resource cleanup in agent_request().

* Create agent_pvt_destroy() to eliminate inlined versions in many places.

* Pull invariant code out of loop in add_agent().

* Remove redundant module user references in login_exec().

* Remove unused struct agent_pvt logincallerid[] member.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378458 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-03 18:47:29 +00:00
Richard Mudgett 11571714fe chan_agent: Fix agent_indicate() locking.
Avoid deadlock potential with local channels and simplify the locking.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-03 17:48:14 +00:00
Matthew Jordan 8fb5bdce9a Prevent exhaustion of system resources through exploitation of event cache
Asterisk maintains an internal cache for devices in the event subsystem. The
device state cache holds the state of each device known to Asterisk, such that
consumers of device state information can query for the last known state for
a particular device, even if it is not part of an active call. The concept of
a device in Asterisk can include entities that do not have a physical
representation. One way that this occurred was when anonymous calls are allowed
in Asterisk. A device was automatically created and stored in the cache for
each anonymous call that occurred; this was possible in the SIP and IAX2
channel drivers and through channel drivers that utilized the
res_jabber/res_xmpp resource modules (Gtalk, Jingle, and Motif). These devices
are never removed from the system, allowing anonymous calls to potentially
exhaust a system's resources.

This patch changes the event cache subsystem and device state management to
no longer cache devices that are not associated with a physical entity.

(issue ASTERISK-20175)
Reported by: Russell Bryant, Leif Madsen, Joshua Colp
Tested by: kmoore
patches:
  event-cachability-3.diff uploaded by jcolp (license 5000)
........

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

Merged revisions 378320 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378322 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02 18:11:59 +00:00
Matthew Jordan 1fb06fde95 Resolve crashes due to large stack allocations when using TCP
Asterisk had several places where messages received over various network
transports may be copied in a single stack allocation. In the case of TCP,
since multiple packets in a stream may be concatenated together, this can
lead to large allocations that overflow the stack.

This patch modifies those portions of Asterisk using TCP to either
favor heap allocations or use an upper bound to ensure that the stack will not
overflow:
 * For SIP, the allocation now has an upper limit
 * For HTTP, the allocation is now a heap allocation instead of a stack
   allocation
 * For XMPP (in res_jabber), the allocation has been eliminated since it was
   unnecesary.

Note that the HTTP portion of this issue was independently found by Brandon
Edwards of Exodus Intelligence.

(issue ASTERISK-20658)
Reported by: wdoekes, Brandon Edwards
Tested by: mmichelson, wdoekes
patches:
  ASTERISK-20658_res_jabber.c.patch uploaded by mmichelson (license 5049)
  issueA20658_http_postvars_use_malloc2.patch uploaded by wdoekes (license 5674)
  issueA20658_limit_sip_packet_size3.patch uploaded by wdoekes (license 5674)
........

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

Merged revisions 378286 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378288 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02 15:39:42 +00:00
Kinsey Moore 32472eca70 Ensure chan_sip rejects encrypted streams without crypto info
This ensures that Asterisk rejects encrypted media streams (RTP/SAVP
audio and video) that are missing cryptographic keys and ensures that
the incoming SDP is consistent with RFC4568 as far as having a crypto
attribute present for any SAVP streams.

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

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

Merged revisions 378218 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378220 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-31 14:46:06 +00:00
Richard Mudgett 23b94b9211 Make chan_local module references tied to local_pvt lifetime.
The chan_local module references were manually tied to the existence of
the ;1 and ;2 channel links.

* Made chan_local module references tied to the existence of the local_pvt
structure as well as automatically take care of the module references.

* Tweaked the wording of the local_fixup() failure warning message to make
sense.

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

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

Merged revisions 378089 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-17 23:02:54 +00:00
Richard Mudgett 0494456ae6 chan_local: Parse dial string consistently.
* Fix local_alloc() unexpected limitation of exten and context length from
a combined length of 80 characters to a normal 80 characters each.

* Made local_alloc() and local_devicestate() parse the same way.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378081 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-17 21:22:21 +00:00
Richard Mudgett 87cb8e94cd chan_local: Misc lock and ref tweaks.
* awesome_locking() does not need to thrash the pvt lock as much.

* local_setoption() does not need to check for NULL pvt on cleanup since
it will never be NULL.

* Made ref the pvt before locking for consistency.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-17 20:34:25 +00:00
Richard Mudgett de026cf92f chan_agent: Remove some duplicated code.
No need to check for an agent twice.  Santa does that.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-14 22:45:03 +00:00
Damien Wedhorn cb6e00b408 Fix skinny to recognise vmexten in general section of conf
Fixup the vmexten so if globally set in general section will be honored by
chan_skinny. Also get rid of the 'global_' part of variable name to match
regexten.

(closes issue ASTERISK-20790)
Reported by: snuffy
Tested by: snuffy, myself
Patches: 
    skinny-vm.diff uploaded by snuffy (license 5024)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-14 01:55:43 +00:00
Damien Wedhorn b514659d1c Add g722 codec support to skinny
(closes issue ASTERISK-20788)
Reported by: snuffy
Tested by: snuffy, myself
Patches: 
    skinny-g722.diff uploaded by snuffy (license 5024)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-14 01:02:15 +00:00
Damien Wedhorn 5cf8a1f2e5 Minor fixes for chan_skinny
Whitespace, change SUBSTATE_ONHOOK to correct SKINNY_ONHOOK and 
correct len of 2 strcmp in skinny_setdebug(). (see opticron's review
on https://reviewboard.asterisk.org/r/2240/)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378001 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-13 21:25:31 +00:00
Damien Wedhorn 758cad0984 Fix skinny debug tab completion
Review the syntax of the 'skinny debug' command to show more than
just 'show' for options to 'skinny debug' command.

(closes issue ASTERISK-20789)
Reported by: snuffy
Tested by: snuffy, myself
Patches:
    skinny-debug.diff uploaded by snuffy (license 5024)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377986 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-13 18:28:41 +00:00
Brent Eagles ab894d5af9 This change adds a SIP peer configuration feature to allow the peer's
configured codecs to take precedence on an outgoing call.

This change introduces a new peer configuration property named
'ignore_requested_pref' that causes the requested codec to be ignored when
determining the preferred codec for an outgoing call leg. The consequence is
that Asterisk's usual efforts to prefer avoiding transcoding can be overridden
on a peer-by-peer basis where appropriate. 


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377971 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-13 15:22:27 +00:00
Kinsey Moore 4f6064584d Ensure Min-SE is included in outbound INVITEs
Asterisk now includes Min-SE in outbound INVITEs when the value is not
90 (the default) and session timers are not disabled. This has the
effect of Asterisk following RFC4028 more closely with regard to 422
responses and preventing situations in which Asterisk would be forced
to temporarily accept a call to tear it down based on a Session-Expires
below the locally configured Min-SE.

(issue SWP-5051)
Review: https://reviewboard.asterisk.org/r/2222/
Reported-by: Kinsey Moore
Patch-by: Kinsey Moore
........

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

Merged revisions 377947 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377966 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-13 14:28:57 +00:00
Mark Michelson 607a5d898c Fix a potential deadlock in chan_sip during transfers.
The issue comes from the fact that transfers may perform
a redirecting update on a channel. The issue is that lock
inversion between the channel and its tech_pvt occurs since
the channel lock is released during the transfer process.

The fix is to move when the redirecting update occurs to a
place where neither the tech_pvt or the channel is locked so
that the two can be locked in the proper order.

(closes issue ASTERISK-20708)
reported by Mark Michelson
patches:
	ASTERISK-20708-3.patch uploaded by Mark Michelson (License #5049)

Tested by:
	Tim Ringenbach at Asteria Solutions Group
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377911 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-12 00:02:31 +00:00
Kinsey Moore 1c1faa1380 Handle Session-Expires less than local Min-SE in 200 OK
Ensure that a call is immediately torn down if a Session-Expires value
received in a 200 OK is less than the local Min-SE. This also prevents
Asterisk from allowing calls with Session-Expires below the
RFC4028-mandated minimum (90s).

(closes issue ASTERISK-20653)
Review: https://reviewboard.asterisk.org/r/2237/
Patch-by: Kinsey Moore
........

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

Merged revisions 377624 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-10 14:45:52 +00:00
Igor Goncharovskiy 8c99bcc5a3 Add firmware information to CLI devices listing
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-10 07:03:48 +00:00
Igor Goncharovskiy 98539ffb32 Fix codec mismatch
Fix code to send in both rx and tx open stream messages correct codecs. Found that on phase 0/1 phones wrong codecs cause to no audio in some situations. 

(issue ASTERISK-20183)
........

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

Merged revisions 377592 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377594 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-10 06:56:04 +00:00
Igor Goncharovskiy 1042d43160 Remove trailing whitespaces in number from incoming redial list.
Reported by: Igor Olhovskiy
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-10 05:29:04 +00:00
Joshua Colp b68d4dba67 Add missing support for "who hung up" to chan_motif.
(closes issue ASTERISK-20671)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2208/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-09 01:23:44 +00:00
Joshua Colp b206511914 Fix a SIP request memory leak with TLS connections.
During the TLS re-work in chan_sip some TLS specific code was moved
into a separate function. This function operates on a copy of the
incoming SIP request. This copy was never deinitialized causing a
memory leak for each request processed.

This function is now given a SIP request structure which it can use
to copy the incoming request into. This reduces the amount of memory
allocations done since the internal allocated components are reused
between packets and also ensures the SIP request structure is
deinitialized when the TLS connection is torn down.

(closes issue ASTERISK-20763)
Reported by: deti
........

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

Merged revisions 377258 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-05 16:51:58 +00:00
Joshua Colp bd8fbeed01 Fix an RTP instance reference count leak in chan_motif.
When setting up an RTP instance the RTCP portion of the instance
keeps a reference to the instance itself. In order to release this
reference and stop RTCP the stop API call must be called before
destroying the instance.

(closes issue ASTERISK-20751)
Reported by: joshoa
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 14:56:36 +00:00
Olle Johansson 712aaa9828 Move functions to AFTER the block of forward declarations of functions.
It was a mess. The first part of chan_sip.c is constants, declarations, structures and stuff,
then forward declarations and then actual code. It's still a mess, but a bit less messy ;-)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 14:46:02 +00:00
Olle Johansson 1b47dbe991 Formatting changes
Found a large amount of missing {} in the code before patching in another branch


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 09:35:55 +00:00
Joshua Colp 898ca023d5 Tweak extension used for incoming calls received on Motif.
Based on feedback from numerous individuals this patch tweaks incoming calls
to first look for an extension with the name of the endpoint. If no such extension
exists the call will silently fall back to the "s" extension as it previously
did.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376984 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-01 00:47:42 +00:00
Richard Mudgett 8bbbf4cf2f chan_misdn: Fix sending RELEASE_COMPLETE in response to SETUP.
Fix sending a RELEASE_COMPLETE in response to a SETUP if chan_misdn does
not have a B channel available to assign to the call.

(closes issue ABE-2869)
Reported by: Guenther Kelleter
Patches:
      setup-reject_2.diff (license #6372) patch uploaded by Guenther Kelleter
      Modified

........

Merged revision 376949 from https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
........

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

Merged revisions 376951 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-30 21:38:01 +00:00
Mark Michelson fab48c28f9 Fix potential crashes during SIP attended transfers.
The principal behind this patch is simple. During a transfer,
we manipulate channels that are owned by a separate thread than
the one we currently are running in, so it makes sense that we
need to grab a reference to the channels so that they cannot
disappear out from under us.

In the wild, crashes were sometimes seen when the transferring
party would hang up the call before the transfer target answered
the call. The most common place to see the crash occur was when
attempting to send a connected line update to the transferer
channel.

(closes issue ASTERISK-20226)
Reported by Jared Smith
Patches:
	ASTERISK-20226.patch uploaded by Mark Michelson (License #5049)
Tested by: Jared Smith
........

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

Merged revisions 376916 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376918 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-30 16:56:53 +00:00
Richard Mudgett 9a8ce96aff chan_local: Fix local_pvt ref leak in local_devicestate().
Regression introduced by ASTERISK-20390 fix.

(closes issue ASTERISK-20769)
Reported by: rmudgett
Tested by: rmudgett
........

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

Merged revisions 376869 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376871 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-29 23:01:16 +00:00
Richard Mudgett 53e97bc9ee Fix compile error.
(issue ASTERISK-20724)
........

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

Merged revisions 376865 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376867 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-29 22:34:24 +00:00
Michael L. Young 587906cb6c Improve Code Readability And Fix Setting natdetected Flag
For 1.8, 10, 11 and trunk we are are improving the code readability.

For 11 and trunk, auto nat detection was added.  The natdetected flag was being
set to 1 when the host address in the VIA header did not specifiy a port.  This
patch fixes this by setting the port on the temporary sock address used to
SIP_STANDARD_PORT in order for the sock address comparison to work properly.

(closes issue ASTERISK-20724)
Reported by: Michael L. Young
Patches:
    asterisk-20724-set-port-v2.diff uploaded by Michael L. Young (license 5026)

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

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

Merged revisions 376835 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376837 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-29 21:58:41 +00:00
Pedro Kiefer e46ea1fe65 Fix chan_sip websocket payload handling
Websocket by default doesn't return an ast_str for the payload received. When 
converting it to an ast_str on chan_sip the last character was being omitted, 
because ast_str functions expects that the given length includes the trailing 
0x00. payload_len only has the actual string length without counting the 
trailing zero.

For most cases this passed unnoticed as most of SIP messages ends with \r\n.

(closes issue ASTERISK-20745)
Reported by: Iñaki Baz Castillo
Review: https://reviewboard.asterisk.org/r/2219/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-29 16:44:42 +00:00
Richard Mudgett 4ccf2c7aa5 Add red-black tree container type to astobj2.
* Add red-black tree container type.

* Add CLI command "astobj2 container dump <name>"

* Added ao2_container_dump() so the container could be dumped by other
modules for debugging purposes.

* Changed ao2_container_stats() so it can be used by other modules like
ao2_container_check() for debugging purposes.

* Updated the unit tests to check red-black tree containers.

(closes issue ASTERISK-19970)
Reported by: rmudgett
Tested by: rmudgett

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-21 18:33:16 +00:00
Mark Michelson b37ab7e673 Add "Require: timer" to 200 OK responses when appropriate.
The method by which the Require header is added to 200 responses is
inspired by the method that Olle Johansson uses in his darjeeling-prack
branch.

(closes issue ASTERISK-20570)
Reported by Matt Jordan, at the behest of Olle Johansson

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

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

Merged revisions 376522 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-20 19:09:37 +00:00
Alec L Davis 316fbb083c Reduce CLI spam of "Extension Changed" device state messages.
Asterisk 11 follows RFC3265 that states that after every subscribe or resubscribe a notify should be sent.
Thus the console if filled continuously with the following after every subscribe;
  == Extension Changed 8512[phones] new state IDLE for Notify User cisco1
 
In Asterisk 1.8 only changes would be sent. Thus only when a device state changed was anything emitted to the console.

fix:
Only print to console when device state isn't forced.

(closes issue ASTERISK-20706)
Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-20 17:39:11 +00:00
Walter Doekes 907050d41b Fix most leftover non-opaque ast_str uses.
Instead of calling str->str, one should use ast_str_buffer(str). Same
goes for str->used as ast_str_strlen(str) and str->len as
ast_str_size(str).

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

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

Merged revisions 376470 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376472 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-19 20:03:56 +00:00
Jonathan Rose e62bab8131 chan_sip: Add SubscribeContext field to SIPshowpeer AMI response
The new field is will show up within the response if the requested peer has a
subscribe context set.

(closes issue ASTERISK-20626)
Reported by: Jaco Kroon
Patches:
    asterisk-sip-ami-SubscrContext.patch uploaded by jkroon (license 5671)
        -with modifications by jrose to conform to style guidelines
Review: https://reviewboard.asterisk.org/r/2195/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376219 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-13 19:42:13 +00:00
Joshua Colp 866d968149 Remove a fixed size limitation for producing SDP and change how ICE support is disabled by default.
With ICE support enabled in chan_sip and a large number of interfaces on the system it was
possible for the produced SDP to be truncated due to some fixed size buffers. These buffers
have now been changed so they will dynamically grow as needed.

ICE support is now also enabled by default in res_rtp_asterisk to provide a smoother experience
for chan_motif users where it is required. To maintain the previous behavior in chan_sip it is
no longer enabled by default there.

(closes issue ASTERISK-20643)
Reported by: coopvr
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376131 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-11 17:15:47 +00:00
Richard Mudgett 735f5c5059 chan_dahdi/SS7: Made reject incoming call for an in-alarm or blocked channel.
If a SS7 call comes in requesting a CIC that is in-alarm, the call is
accepted and connects if the extension exists in the dialplan.  The call
does not have any audio.

* Made release the call immediately with circuit congestion cause.

(closes issue ASTERISK-20204)
Reported by: Tuan Le
Patches:
      jira_asterisk_20204_v1.8.patch (license #5621) patch uploaded by rmudgett
........

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

Merged revisions 376059 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-08 21:12:35 +00:00
Mark Michelson f2bb9afe17 Multiple revisions 375993-375994
........
  r375993 | mmichelson | 2012-11-07 11:01:13 -0600 (Wed, 07 Nov 2012) | 30 lines
  
  Fix misuses of timeouts throughout the code.
  
  Prior to this change, a common method for determining if a timeout
  was reached was to call a function such as ast_waitfor_n() and inspect
  the out parameter that told how many milliseconds were left, then use
  that as the input to ast_waitfor_n() on the next go-around.
  
  The problem with this is that in some cases, submillisecond timeouts
  can occur, resulting in the out parameter not decreasing any. When this
  happens thousands of times, the result is that the timeout takes much
  longer than intended to be reached. As an example, I had a situation where
  a 3 second timeout took multiple days to finally end since most wakeups
  from ast_waitfor_n() were under a millisecond.
  
  This patch seeks to fix this pattern throughout the code. Now we log the
  time when an operation began and find the difference in wall clock time
  between now and when the event started. This means that sub-millisecond timeouts
  now cannot play havoc when trying to determine if something has timed out.
  
  Part of this fix also includes changing the function ast_waitfor() so that it
  is possible for it to return less than zero when a negative timeout is given
  to it. This makes it actually possible to detect errors in ast_waitfor() when
  there is no timeout.
  
  (closes issue ASTERISK-20414)
  reported by David M. Lee
  
  Review: https://reviewboard.asterisk.org/r/2135/
........
  r375994 | mmichelson | 2012-11-07 11:08:44 -0600 (Wed, 07 Nov 2012) | 3 lines
  
  Remove some debugging that accidentally made it in the last commit.
........

Merged revisions 375993-375994 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 375995 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-07 19:15:26 +00:00
Joshua Colp 82dc21e0e1 Fix a bug where our Motif ICE candidates were not quite proper, and make us more forgiving.
An issue was reported on the mailing list where calling would result in an "Incomplete
ICE-UDP candidate received on session" error message. This is the result of the ICE-UDP
candidate code not placing a "network" attribute within the candidates. This is now done.
To increase compatibility though I have removed the requirement for the "network" attribute
to exist within ICE-UDP candidates that are received since we don't actually require the
value.

Reported on the mailing list by Jean-Denis Girard.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375926 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-06 12:15:31 +00:00
Matthew Jordan a0c363e227 Refactor ast_timer_ack to return an error and handle the error in timer users
Currently, if an acknowledgement of a timer fails Asterisk will not realize
that a serious error occurred and will continue attempting to use the timer's
file descriptor.  This can lead to situations where errors stream to the
CLI/log file.  This consumes significant resources, masks the actual problem
that occurred (whatever caused the timer to fail in the first place), and
can leave channels in odd states.

This patch propagates the errors in the timing resource modules up through
the timer core, and makes users of these timers handle acknowledgement
failures.  It also adds some defensive coding around the use of timers
to prevent using bad file descriptors in off nominal code paths.

Note that the patch created by the issue reporter was modified slightly for
this commit and backported to 1.8, as it was originally written for
Asterisk 10.

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

(issue ASTERISK-20032)
Reported by: Jeremiah Gowdy
patches:
  jgowdy-timerfd-6-22-2012.diff uploaded by Jeremiah Gowdy (license 6358)
........

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

Merged revisions 375894 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375896 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-05 23:10:14 +00:00
Damien Wedhorn 732767f230 Fix for chan_skinny leaving RTP ports open
Skinny wasn't closing RTP sockets. This patch includes ast_rtp_instance_stop before 
ast_rtp_instance_destroy which fixes the problem. Also add destroy for VRTP (which 
I believe is unused, but exists).

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-02 21:03:56 +00:00
Richard Mudgett f85db0e34d Things don't need to be that const.
........

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

Merged revisions 375659 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375662 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-02 21:01:33 +00:00
Richard Mudgett e950086daf Multiple revisions 375519-375524
........
  r375519 | rmudgett | 2012-10-30 16:06:15 -0500 (Tue, 30 Oct 2012) | 11 lines

  chan_misdn: Timer primitives must be handled first.

  The frm->addr is a different "address space" than the stack/instance
  address of other Lx primitives.  The test for B channel instance address
  could fail.

  Patches:
	patch01_timers.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2888

  ........
  r375520 | rmudgett | 2012-10-30 16:14:58 -0500 (Tue, 30 Oct 2012) | 10 lines

  chan_misdn: Free memory in error paths and other memory leaks.

  The one line commented with BUG is not easily fixable because there is no
  de-init function one can call.

  Patches:
	patch02_memory.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2888

  ........
  r375521 | rmudgett | 2012-10-30 16:38:41 -0500 (Tue, 30 Oct 2012) | 14 lines

  chan_misdn: ISDN NT L2 de-establish/establish

  * An NT-PTMP cannot de/establish L2 since it doesn't know the TEIs.
  * On NT-PTP L2 is started when L1 is finally active in handle_l1.
  * L2 deactivation logging cleanup.
  * L2 aggregate link status is unknown for NT-PTMP, show as "UNKN".
  * Removed unused functions and code for L2 handling.

  Patches:
	patch03_L2estab.diff (license #6372) patch uploaded by Guenther Kelleter
	Modified

  JIRA ABE-2888

  ........
  r375522 | rmudgett | 2012-10-30 16:56:14 -0500 (Tue, 30 Oct 2012) | 22 lines

  chan_misdn: Fix broken upper_id/lower_id usage.

  Sending PH prim via lower_id layer (3 or 1) simply does not work.  For TE
  (3) it returns an error (len=-6) which is not evaluated by handle_l1(), so
  the L1 layer status ends up wrong.  Instead PH must be sent via L4, only
  then does it reach L1 without an error message.

  And NT PH prims only reach L1 when they are sent to layer 2 id.
  --> use upper_id to send PH primitives.

  * Check for errors in PH_(DE)ACTIVATE | CONFIRM.
  * Debug messages are improved.

  * The lower_id is now not used for anything, except: Why is lower_id layer
  deleted when it wasn't created?  I removed this code since it looks very
  wrong.

  Patches:
	patch04_l1activation.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2888

  ........
  r375523 | rmudgett | 2012-10-30 17:29:15 -0500 (Tue, 30 Oct 2012) | 31 lines

  chan_misdn: Fix loss of B channels if L1 is down.

  If you make 2 calls out an NT PTMP port which is not connected to any
  phone, the B channel associated with that call becomes unusable until
  Asterisk is restarted.

  The problem is the EVENT_SETUP is queued when L1 is not up in
  misdn_lib_send_event().  If L1 cannot be activated the event won't be
  dequeued.  It gets even worse when the call is hung up.  The queued
  EVENT_SETUP will be overwritten by an EVENT_DISCONNECT.  The reserved B
  channel then will never be freed.  If later someone connects a phone to
  the port, L1 will eventually activate and the queued EVENT_DISCONNECT is
  sent down the stack.  However, it is ignored because it is the wrong call
  state.

  The real fix would be that activation and queueing for a new SETUP is done
  by the NT stack.  But since it doesn't, the workaround must be removed
  because it doesn't always work.

  Fix: The event is no longer queued but immediately sent to the stack.  If
  L1 cannot be activated, the L3 state machine that was started by the
  EVENT_SETUP will do its work, i.e.  a timeout will release the B channel
  properly.  The SETUP possibly cannot be sent the first time but is resent
  by T303 in case L1 could be activated.

  Patches:
	patch05_bchan-loss.diff (license #6372) patch uploaded by Guenther Kelleter
	Modified

  JIRA ABE-2888

........
  r375524 | rmudgett | 2012-10-30 18:26:05 -0500 (Tue, 30 Oct 2012) | 13 lines

  chan_misdn: Remove some calls to exit().

  Try proper cleanup when something goes wrong in misdn_lib_init().
  Especially do not call exit()!

  * Fix memory leak because stack_destroy() does not free the stack struct.

  Patches:
	patch06_cleanup-init.diff (license #6372) patch uploaded by Guenther Kelleter
	Modified

  JIRA ABE-2888
........

Merged revisions 375519-375524 from https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
........

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

Merged revisions 375626 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-02 18:46:58 +00:00
Michael L. Young 01526b2c3c Fix Wrong Result In Debug Message For SDP Origin Processing
While looking at some debug logs, I noticed that it was being reported that the
SDP origin line was unsupported or failed.  Upon looking into this on my local
machine, I found that I too was getting this debug message yet everything seemed
to be getting processed properly.  What was discovered is, that, the variable to
determine what is displayed in the debug message for the SDP line that was
processed, was not being set for the origin line when the result was successful.

This patch fixes this and was tested on local machine.
........

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

Merged revisions 375601 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375614 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-02 17:27:24 +00:00
Jonathan Rose d4a357b82f chan_sip: Fix a bug causing SIP reloads to remove all entries from the registry
A regression was introduced in chan_sip by changes to sip reload introduced by
r349097. That patch moved peer purging from the beginning of the reload to
after the general configuration was finished. This patch fixes that by undoing
the repositioning of the original peer purging code and using a similar
function after performing general configuration that purges only autocreated
peers that were created when persist mode isn't enabled.

(closes issue ASTERISK-20611)
Reported by: Alisher
Review: https://reviewboard.asterisk.org/r/2171/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375576 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-01 15:03:04 +00:00
Mark Michelson 5f3f32c494 Prevent resetting of NATted realtime peer address on reload.
If a "sip reload" is issued for a SIP peer, then his
IP address will be cleared, thus resulting in forgetting the
public IP address. Asterisk will then attempt to route SIP
traffic to the private IP address.

The fix here is to make "sip reload" ignore realtime peers
when "host = dynamic" is spotted. Realtime peers can now only
have their IP address reset if they have gone from being not
dynamic to being dynamic.

(closes issue ASTERISK-18203)
reported by daren ferreira

(closes issue ASTERISK-20572)
reported by JoshE
Patches:
	fix_nat_realtime.diff uploaded by JoshE (license #6075)
........

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

Merged revisions 375417 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375443 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-29 21:38:40 +00:00
Mark Michelson da85f8489f Make evaluation of channel variables consistently case-sensitive.
Due to inconsistencies in how variable names were evaluated, the
decision was made to make all evaluations case-sensitive. See the
UPGRADE.txt file or https://wiki.asterisk.org/wiki/display/AST/Case+Sensitivity
for more details.

(closes issue ASTERISK-20163)
reported by Matt Jordan

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-29 21:27:09 +00:00
Richard Mudgett e2702177a4 chan_dahdi: Fix segfault dereferencing a NULL tech_pvt.
The tech support customer was using the AMI Redirect action shortly after
a call was placed.  While the channel tried to do an ast_read(), the
masquerade resulting from the channel redirect took place.  The masquerade
in the middle of the ast_read() resulted in the segfault.

(closes issue AST-1025)
Reported by: Trey Blancher
Patches:
      jira_ast_1025_v1.8_v2.patch (license #5621) patch uploaded by rmudgett
........

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

Merged revisions 375362 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-29 15:56:13 +00:00
Walter Doekes 6d57ecd48c Change a few warnings to debug and the inverse.
Remove the "RTP Read too short" warning for RTP keepalives. Remove the
the warning about the application delimiter switch from pipe to comma.
(You should've done this by now.) Make cdr_odbc report more when an
insert fails. Make chan_sip warn less when the peer wants SRTP (and we
don't) or sends a zero port to disable a media type.

Review: https://reviewboard.asterisk.org/r/2167
(closes issue ASTERISK-20538)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-17 14:24:52 +00:00
Walter Doekes 1a0646aec1 Fixes to the fd-oriented SIP TCP reads.
Don't crash on large user input. Allow SIP headers without space.
Optimize code a bit.

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

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

Merged revisions 375112 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375114 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-16 21:46:09 +00:00
Walter Doekes 8a65f47e88 Don't do SIP contact/route DNS if we're not using the result.
In many cases (for peers behind NAT or for TCP sockets) we do not need
to look up any hostname in the Contact (or Route) when sending an
in-dialog request. This should reduce netsock2.c: getaddrinfo errors in
certain scenarios.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375110 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-16 21:38:00 +00:00
Walter Doekes 2142fc3bc7 Update sip_request_call SIP dial string documentation.
This was missed when merging review r1859.
........

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

Merged revisions 375078 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375080 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-16 19:25:11 +00:00
Joshua Colp c4df9778cb Remove a log message that was left in accidentally from call-id logging development.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-16 14:09:39 +00:00
Mark Michelson e9ab568f88 Fix some potential misuses of ast_str in the code.
Passing an ast_str pointer by value that then calls
ast_str_set(), ast_str_set_va(), ast_str_append(), or
ast_str_append_va() can result in the pointer originally
passed by value being invalidated if the ast_str had
to be reallocated.

This fixes places in the code that do this. Only the
example in ccss.c could result in pointer invalidation
though since the other cases use a stack-allocated ast_str
and cannot be reallocated.

I've also updated the doxygen in strings.h to include
notes about potential misuse of the functions mentioned
previously.

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

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

Merged revisions 375026 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-15 21:25:29 +00:00
Igor Goncharovskiy e41a591dfc Fix underscreen buttons warnings apeared while transfer process
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375017 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-15 08:26:58 +00:00
Andrew Latham 3820f1586e Doxygen Updates - Title update
Update and extend the configuration_file group and enable linking.  Update title that was left behind many years ago.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-14 21:47:40 +00:00
Mark Michelson c7b23cbb0a Do not use a FILE handle when doing SIP TCP reads.
This is used to solve an issue where a poll on a file
descriptor does not necessarily correspond to the readiness
of a FILE handle to be read.

This change makes it so that for TCP connections, we do a
recv() on the file descriptor instead.

Because TCP does not guarantee that an entire message or even
just one single message will arrive during a read, a loop has
been introduced to ensure that we only attempt to handle a
single message at a time. The tcptls_session_instance structure
has also had an overflow buffer added to it so that if more
than one TCP message arrives in one go, there is a place to
throw the excess.

Huge thanks goes out to Walter Doekes for doing extensive review
on this change and finding edge cases where code could fail.

(closes issue ASTERISK-20212)
reported by Phil Ciccone

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

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

Merged revisions 374906 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-12 16:31:01 +00:00
Joshua Colp ccb7b3a1b5 Fix a bug where audio on Google Voice would not work due to ignoring candidates.
Instead of ignoring parts of the message that are not known just ignore the ones
we know may be present and that would cause a problem.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374878 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-11 21:19:33 +00:00
Joshua Colp cd9745be1b Fix an issue where outgoing calls would fail to establish audio due to ICE negotiation failures.
This change removes the requirement for ufrag and pwd in the transport stanza and also
makes us the controlling agent.

(closes issue ASTERISK-20554)
Reported by: mmichelson

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-11 16:06:28 +00:00
Mark Michelson 825607e09b Don't make chan_sip export global symbols.
During testing, it was discovered that having chan_sip
export global symbols was problematic.

The biggest problem was that load order was affected.
Trying to use realtime could be problematic since in
all likelihood the necessary realtime driver(s) would
not be loaded before chan_sip.

In addition, it was found that it was impossible to
use the Digium Phone Module for Asterisk since it
must be loaded before chan_sip since it must hook
into chan_sip's configuration parsing.

The solution is to use a virtual table in the same
manner that other modules in Asterisk do, like
app_voicemail.

(closes issue ASTERISK-20545)
Reported by: kmoore

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-11 15:49:02 +00:00
Joshua Colp 755c2b8708 Consider the Google Talk content stanza name (jin:content) valid.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374834 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-11 13:34:52 +00:00
Joshua Colp 766d133c62 Improve logging for DTLS-SRTP failure situations.
(closes issue ASTERISK-20487)
Reported by: mjordan
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374757 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-09 21:35:53 +00:00
Richard Mudgett 79baef5bbd Merged revisions 374515-374535 from
https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier

................
  r374515 | rmudgett | 2012-10-04 17:52:36 -0500 (Thu, 04 Oct 2012) | 10 lines

  chan_misdn: Remove some deadcode

  * Made setup_bc() static.

  Patches:
	patch1_unused-code.diff (license #6372) patch uploaded by Guenther Kelleter
	Modified

  JIRA ABE-2882

................
  r374516 | rmudgett | 2012-10-04 18:01:01 -0500 (Thu, 04 Oct 2012) | 7 lines

  chan_misdn: Remove unused bchan states

  Patches:
	patch2_unused-states.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374517 | rmudgett | 2012-10-04 18:17:51 -0500 (Thu, 04 Oct 2012) | 16 lines

  chan_misdn: Remove unnecessary null pointer checks and checks for stack->nt

  * cleanup_bc() is always called with valid bc (or it would've crashed
  before).

  * Value of stack->nt is known in advance at some places.

  * Rename handle_event() to handle_event_te(), handle_frm() to
  handle_frm_te().

  Patches:
	patch3_checks.diff (license #6372) patch uploaded by Guenther Kelleter
	Modified

  JIRA ABE-2882

................
  r374518 | rmudgett | 2012-10-04 18:21:59 -0500 (Thu, 04 Oct 2012) | 7 lines

  chan_misdn: Fix spelling in log messages

  Patches:
	patch4_spelling.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374519 | rmudgett | 2012-10-04 18:31:59 -0500 (Thu, 04 Oct 2012) | 15 lines

  chan_misdn: Don't cleanup a bc twice.

  In handle_frm_te() after calling misdn_lib_send_event(bc,
  EVENT_RELEASE_COMPLETE) bc is emptied, cleaned and set not in use,
  although misdn_lib_send_event() already did the same.  This is bad.  When
  it's not in use we are not allowed to touch it.

  * Moved log message in front of the resulting actions and fixed it to
  match the case.

  Patches:
	patch5_bccleanup.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374520 | rmudgett | 2012-10-04 18:43:56 -0500 (Thu, 04 Oct 2012) | 12 lines

  chan_misdn: Fix memory leaks, bc, chan not cleaned up etc., really bad stuff.

  * Fix return codes of cb_events() for EVENT_SETUP to use caller's cleanup
  mechanisms.

  * Move cl_queue_chan() call after bearer check.

  Patches:
	patch6_leaks.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374521 | rmudgett | 2012-10-04 18:48:38 -0500 (Thu, 04 Oct 2012) | 11 lines

  chan_misdn: We must initialize cause on sending a DISCONNECT.

  We must initialize cause on sending a DISCONNECT, so it is later correctly
  indicated to ast_channel in case the answer (RELEASE/RELEASE_COMPLETE)
  does not include one.

  Patches:
	patch7_hangupcause.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374522 | rmudgett | 2012-10-04 19:03:56 -0500 (Thu, 04 Oct 2012) | 7 lines

  chan_misdn: Remove unused code for upqueue

  Patches:
	patch8_unused-upqueue.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374523 | rmudgett | 2012-10-04 19:11:50 -0500 (Thu, 04 Oct 2012) | 7 lines

  chan_misdn: Improve debugging (port number, messages fixed, dups removed)

  Patches:
	patch9_debug.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374533 | rmudgett | 2012-10-05 12:17:18 -0500 (Fri, 05 Oct 2012) | 8 lines

  chan_misdn: Better debug: we can print_bc_info even if there's no ast leg.

  Patches:
	patch10_debug-bc-2.diff (license #6372) patch uploaded by Guenther Kelleter
	Modified.

  JIRA ABE-2882

................
  r374534 | rmudgett | 2012-10-05 12:34:10 -0500 (Fri, 05 Oct 2012) | 16 lines

  chan_misdn: setup_bc() is called too early for an incoming SETUP on TE.

  This prevents the B channel from being setup for HDLC mode when requested
  by the bearer capability and config option hdlc=yes.  It violates
  ETS300102 Ch.5.2.3.2: "The user, in any case, must not connect to the
  channel until a CONNECT ACKNOWLEDGE message has been received."

  * Call setup_bc() on receipt of CONNECT_ACKNOWLEGDE for PTMP, and on first
  response to SETUP for PTP.

  Patches:
	abe-2881-2.diff (license #6372) patch uploaded by Guenther Kelleter
	Modified.

  JIRA ABE-2881

................
  r374535 | rmudgett | 2012-10-05 12:41:05 -0500 (Fri, 05 Oct 2012) | 2 lines

  chan_misdn: Remove some more deadcode.

................
........

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

Merged revisions 374537 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-05 18:42:14 +00:00
Joshua Colp d78f7f92b2 Add support for applying direct media ACLs between differing channel technologies.
Review: https://reviewboard.asterisk.org/r/2122/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-04 13:49:45 +00:00
Matthew Jordan a094707d51 Fix a variety of ref counting issues
This patch resolves a number of ref leaks that occur primarily on Asterisk
shutdown.  It adds a variety of shutdown routines to core portions of
Asterisk such that they can reclaim resources allocate duringd initialization.

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

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

Merged revisions 374178 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-02 01:47:16 +00:00
Andrew Latham 99e1174bfa Doxygen Cleanup
Start adding configuration file linking and pages.  Add module loading doxygen block.

Breaking up commits to keep it easy to track

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-01 23:24:35 +00:00
Matthew Jordan c3c317433f Fix ref leak when adding ICE candidates to an SDP
There was a missing decrement to the reference count for the current ICE
candidate when local candidates are being added to an outbound SDP.  This
patch corrects that.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-29 03:56:49 +00:00
Richard Mudgett b5138fccf4 Add pause one second W dial modifier.
* The following dialplan applications now recognize 'W' to pause sending
DTMF for one second in addition to the previously existing 'w' that paused
sending DTMF for half a second.  Dial, ExternalIVR, and SendDTMF.

* The chan_dahdi analog port dialing and deferred DTMF dialing for PRI now
distinguishes between 'w' and 'W'.  The 'w' pauses dialing for half a
second.  The 'W' pauses dialing for one second.

* Created dahdi_dial_str() in chan_dahdi that eliminated a lot of
duplicated dialing code and diagnostic messages for the channel driver.

(closes issue ASTERISK-20039)
Reported by: Jeremiah Gowdy
Patches:
      jgowdy-wait-6-22-2012.diff (license #5621) patch uploaded by Jeremiah Gowdy
      Expanded patch to add support in chan_dahdi.
Tested by: rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-28 18:27:02 +00:00
Joshua Colp 9f55e5e928 Make res_http_websocket an optional dependency on supported platforms for chan_sip.
(closes issue ASTERISK-20439)
Reported by: sruffell
Patches:
     0001-chan_sip-websocket-support-is-an-optional-API.patch uploaded by sruffell (license 5417)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-27 17:12:08 +00:00
Joshua Colp 10eb78d213 Fix an issue where Local channels dialed by app_queue are considered in use immediately.
The chan_local channel driver returns a device state of in use even if a created Local
channel has not yet been dialed. This fix changes the logic to return a state of not
in use until the channel itself has been dialed.

(closes issue ASTERISK-20390)
Reported by: tim_ringenbach

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

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

Merged revisions 373879 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-27 11:33:54 +00:00
Mark Michelson b6a780b923 Move handling of 408 response so there is no misleading warning message.
(closes issue ASTERISK-20060)
Reported by: Walter Doekes
........

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

Merged revisions 373849 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-26 21:17:16 +00:00
Mark Michelson 2b56626b43 Remove dead code and documentation for nonexistent feature.
multiplelogin was removed from chan_agent back in 1.6.0 when
AgentCallbackLogin() was removed.

(closes issue AST-948)
reported by Steve Pitts
........

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

Merged revisions 373769 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373771 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-25 22:57:56 +00:00
Joshua Colp 318c7bea44 Fix T.38 support when used with chan_local in between.
Users of the T.38 API can indicate AST_T38_REQUEST_PARMS on a channel to request that the
channel indicate a T.38 negotiation with the parameters present on the channel. The return
value of this indication is expected to be AST_T38_REQUEST_PARMS upon success but with
chan_local involved this could never occur.

This fix changes chan_local to always return AST_T38_REQUEST_PARMS for this situation. If
the underlying channel technology on the other side does not support T.38 this would have
been determined ahead of time using ast_channel_get_t38_state and an indication would
not occur.

(closes issue ASTERISK-20229)
Reported by: wdoekes
Patches:
     ASTERISK-20229.patch uploaded by wdoekes (license 5674)

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

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

Merged revisions 373706 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373708 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-25 20:14:13 +00:00
Mark Michelson fdfb3ae5fa Allow for redirecting reasons to be set to arbitrary strings.
This allows for the REDIRECTING dialplan function to be
used to set the reason to any string.

The SIP channel driver has been modified to set the redirecting
reason string to the value received in a Diversion header. In
addition, SIP 480 response reason text will set the redirecting
reason as well.

(closes issue AST-942)
reported by Malcolm Davenport

(closes issue AST-943)
reported by Malcolm Davenport

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-25 19:29:14 +00:00
Terry Wilson b7233b18eb Properly handle UAC/UAS roles for SIP session timers
The SIP session timer mechanism contains a mandatory 'refresher' parameter
(included in the Session-Expires header) which is used in the session timer
offer/answer signaling within a SIP Invite dialog. It looks like asterisk is
interpreting the uac resp. uas role only as the initial role of client and
server (caller is uac, callee is uas). The standard rfc 4028 however assigns
the client role to the ((RE)-Invite) requester, the server role to the
((RE)-Invite) responder.

This patch has Asterisk track the actual refresher as "us" or "them" as opposed
to relying on just the configured "uas" or "uac" properties.

(closes issue AST-922)
Reported by: Thomas Airmont

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

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

Merged revisions 373665 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373691 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-25 19:08:02 +00:00
Jonathan Rose c7850a198b chan_sip: Set Quality of Service for video rtp instance
(closes issue ASTERISK-20201)
Reported by: ddkprog
Patches:
    chan_sip.c.diff uploaded by ddkprog (license 6008)
........

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

Merged revisions 373631 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373634 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-25 16:45:02 +00:00
Richard Mudgett da8c22fe45 Be consistent, send From: "Anonymous" <sip:anonymous@anonymous.invalid>
When setting CALLERID(pres)=unavailable in the dialplan, the From header
in the SIP message contains "Anonymous" <sip:Anonymous@anonymous.invalid>.
For consistency, Asterisk should use a lowercase a in the userpart of the
URI.

* Make the From header use a lowercase A in the userpart of the anonymous
URI.

(closes issue ASTERISK-19838)
Reported by: Antti Yrjola
Patches:
      chan_sip_patch_ASTERISK-19838.patch (license #6383) patch uploaded by Antti Yrjola
........

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

Merged revisions 373501 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373503 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-24 22:14:28 +00:00
Richard Mudgett bc090677bc Fix potential reentrancy problems in chan_sip.
Asterisk v1.8 and later was not as vulnerable to this issue.

* Made find_call() lock each private as it processes the found dialogs.
(Primary cause of ABE-2876)

* Made the other functions that traverse the dialogs container lock each
private as it examines them.

* Fix race condition in sip_call() if the thread that sent the INVITE is
held up long enough for a response to be processed.  The p->initid for the
INVITE retransmission could be added after it was canceled by the response
processing.

* Made __sip_destroy() clean up resource pointers after freeing.  This is
primarily defensive in case someone has a stale private pointer.

* Removed redundant memset() in reqprep().  The call to init_req() already
does the memset() and is the first reference to req in reqprep().

* Removed useless set of req.method in transmit_invite().  The calls to
initreqprep() and reqprep() have to do this because they memset() the req.

JIRA ABE-2876

..........

Merged -r373423 from https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
........

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

Merged revisions 373466 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-24 21:15:26 +00:00
Joshua Colp f6e0406239 Fix a deadlock caused by a race condition between removing a hint and reloading the dialplan and subscribing to the removed hint.
If conditions were right it was possible for both the PBX core and chan_sip to deadlock by both having a lock that the other
wants. In the case of the PBX core it had the contexts lock and wanted a SIP dialog lock, while in the case of chan_sip it
had the SIP dialog lock and wanted the contexts lock.

This fix unlocks the SIP dialog before getting the extension state so that the other thread will not block on trying to lock
it. Once the extension state is retrieved the SIP dialog is locked again and life carries on.

As the SIP dialog is reference counted it is not possible for it to go away after unlocking.

(closes issue ASTERISK-20437)
Reported by: jhutchins
........

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

Merged revisions 373440 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373456 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-24 19:23:32 +00:00
Joshua Colp ad3e51bf4c Fix an issue with H.264 format attribute comparison and fix an issue with improper SDP being produced.
The H.264 format attribute module compares two format attribute structures to determine if they are
compatible or not. In some instances it was possible for this check to determine that both structures
were incompatible when they actually should be considered compatible. This check has now been made even
more permissive by assuming that if no attribute information is available the two structures are compatible.
If both structures contain attribute information a base level comparison of the H.264 IDC value is done to
see if they are compatible or not.

The above issue uncovered a secondary issue in chan_sip where the SDP being produced would be incorrect if
the formats were considered incompatible. This has now been fixed by checking that all information required
to produce the SDP is available instead of assuming it is.

(closes issue ASTERISK-20464)
Reported by: Leif Madsen
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-24 14:27:17 +00:00
Andrew Latham fd98835f1f Doxygen Updates Janitor Work
* Whitespace, doc-blocks, spelling, case, missing and incorrect tags.
* Add cleanup to Makefile for the Doxygen configuration update
* Start updating Doxygen configuration for cleaner output
* Enable inclusion of configuration files into documentation
* remove mantisworkflow...
* update documentation README
* Add markup to Tilghman's email and talk with him about updating his email, he knows...
* no code changes on this commit other than the mentioned Makefile change

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-22 20:43:30 +00:00
Jonathan Rose ca8aeeef1b iax2-provision: Fix improper return on failed cache retrieval
(closes issue ASTERISK-20337)
reported by: John Covert
Patches:
    iax2-provision.c.patch uploaded by John Covert (license 5512)
........

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

Merged revisions 373343 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-21 19:35:37 +00:00
Andrew Latham 6f61cb50c5 Doxygen Updates - janitor work
Doxygen updates including mistakes, misspellings, missing parameters, updates for Doxygen style.  Some missing txt file links are removed but their content or essense will be included in some later updates.  A majority of the txt files were removed in the 1.6 era but never noted. The HR and EXTREF are simple changes that make the documentation more compatable with more versions of Doxygen.

Further updates coming.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-21 17:14:59 +00:00
Joshua Colp e8380afc8a Add support for DTLS-SRTP to res_rtp_asterisk and chan_sip.
As mentioned on the review for this, WebRTC has moved towards choosing
DTLS-SRTP as the mechanism for key exchange for SRTP. This commit adds
support for this but makes it available for normal SIP clients as well.

Testing has been done to ensure that this introduces no regressions with
existing behavior and also that it functions as expected.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-20 18:27:28 +00:00
Kinsey Moore afa6b8f320 Correct handling of unknown SDP stream types
When the patch to handle arbitrary SDP stream arrangements went into
Asterisk, it also included an ability to transparently decline unknown
stream types. The scanf calls used were not checked properly causing
this part of the functionality to be broken.

(closes issue ASTERISK-20203)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373212 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-20 13:04:22 +00:00
Richard Mudgett b0f01e5a6f Made companding law for SS7 calls only determined by SS7 signaling type.
For SS7, the companding law for a call was chosen inconsistently depending
upon ss7type (ITU vs ANSI) and the DAHDI companding default (T1 vs E1).
For incoming calls, the companding law was determined by ss7type.  For
outgoing calls, the companding law was determined by the DAHDI default.
With the wrong combination you would get A-law/u-law conflicts.  An
A-law/u-law conflict sounds like bad static on the line.

SS7 ITU  signaling with E1 line: ok
SS7 ITU  signaling with T1 line: noise
SS7 ANSI signaling with E1 line: noise
SS7 ANSI signaling with T1 line: ok

* Fix the companding law used to be determined by the SS7 signaling type
only.
........

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

Merged revisions 373101 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373108 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-15 00:32:37 +00:00
Matthew Jordan f92bb6265c Resolve memory leaks in TLS initialization and TLS client connections
This patch resolves two sources of memory leaks when using TLS in Asterisk:
1) It removes improper initialization (and multiple re-initializations) of
   portions of the SSL library.  Asterisk calls SSL_library_init and
   SSL_load_error_strings during SSL initialization; collectively this
   obviates the need for calling any of the following during initialization
   or client connection handling:
   * ERR_load_crypto_strings (handled by SSL_load_error_strings)
   * OpenSSL_add_all_algorithms (synonym for SSL_library_init)
   * SSLeay_add_ssl_algorithms (synonym for SSL_library_init)
2) Failure to completely clean up all memory allocated by Asterisk and by
   the SSL library for TLS clients.  This included not freeing the SSL_CTX
   object in the SIP channel driver, as well as not clearing the error
   stack when the TLS client exited.

Note that these memory leaks were found by Thomas Arimont, and this patch
was essentially written by him with some minor tweaks.

(closes issue AST-889)
Reported by: Thomas Arimont
Tested by: Thomas Arimont
patches:
  (bugAST-889.patch) by Thomas Arimont (license 5525)

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

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

Merged revisions 373062 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373080 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-14 19:53:43 +00:00
Joshua Colp 189249cc73 Skip any non-content information when looking for and handling content.
This fixes a bug with Jitsi and conference calling. Jitsi implements XEP-0298
which places some conference-info information in the session-initiate request
which chan_motif did not expect to occur.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372996 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-12 20:54:38 +00:00
Mark Michelson b0a4f08928 Add channel name to a warning to make debugging easier.
The "autodestruct with owner in place" message is typically
indicative of a channel reference leak. Printing out the name
of the channel in the message may be helpful when trying to
debug the issue.
........

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

Merged revisions 372933 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372943 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-12 15:21:19 +00:00
Jonathan Rose 6f8bad0eac chan_local: Switch from using a random 4 digit hex identifier to unique id
Changes chan_local channels to use an 8 digit hex identifier generated
atomically and sequentially in order to eliminate the chance of having
multiple channels with the same name during high call volume situations.

(issue ASTERISK-20318)
Reported by: Dan Cropp
Review: https://reviewboard.asterisk.org/r/2104/
........

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

Merged revisions 372916 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372918 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-11 22:40:02 +00:00
Jonathan Rose 23a298f28c chan_sip: Change SIPQualifyPeer to improve initial response time
Prior to this patch, The acknowledgement wasn't produced until after
executing the sip_poke_peer action actually responsible for
qualifying the peer. Now the response is given immediately once it is
known that a peer will be qualified and a SIPqualifypeerdone event
is issued when the process is finished. Thanks to OEJ for identifying
the problem and helping to come up with a solution.

(issue AST-969)
Reported by John Bigelow
Review: https://reviewboard.asterisk.org/r/2098/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-10 21:15:38 +00:00
Kinsey Moore e65dea4616 Ensure iax2 debug output is displayed when expected
When IAX2 debug was changed from iax_showframe to iax_outputframe,
some instances were missed (or added afterward). This was causing
debug output to not be displayed when expected.

(closes issue ASTERISK-20338)
Reported-by: John Covert
Patch-by: John Covert
........

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

Merged revisions 372805 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-10 21:00:22 +00:00
Kinsey Moore d96b832787 Deprecate chan_gtalk, chan_jingle, and res_jabber
chan_gtalk, chan_jingle, and res_jabber are now deprecated in favor of
using chan_motif and res_xmpp. They are a feature-equivalent
replacement and are written to be more easily maintainable.

(closes issue ASTERISK-20298)
Review: https://reviewboard.asterisk.org/r/2082/
Reported-by: Leif Madsen
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-10 19:49:30 +00:00
Matthew Jordan ae179ac5b4 Only re-create an SRTP session when needed
In r356604, SRTP handling was fixed to accomodate multiple crypto keys in an
SDP offer and the ability to re-create an SRTP session when the crypto keys
changed.  In certain circumstances - most notably when a phone is put on
hold after having been bridged for a significant amount of time - the act
of re-creating the SRTP session causes problems for certain models of phones.
The patch committed in r356604 always re-created the SRTP session regardless
of whether or not the cryptographic keys changed.  Since this is technically
not necessary, this patch modifies the behavior to only re-create the SRTP
session if Asterisk detects that the remote key has changed.  This allows
models of phones that do not handle the SRTP session changing to continue
to work, while also providing the behavior needed for those phones that do
re-negotiate cryptographic keys.

(issue ASTERISK-20194)
Reported by: Nicolo Mazzon
Tested by: Nicolo Mazzon

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

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

Merged revisions 372710 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-09 01:28:31 +00:00
Richard Mudgett 8b933196e9 Fix loss of MOH on an ISDN channel when parking a call for the second time.
Using the AMI redirect action to take an ISDN call out of a parking lot
causes the MOH state to get confused.  The redirect action does not take
the call off of hold.  When the call is subsequently parked again, the
call no longer hears MOH.

* Make chan_dahdi/sig_pri restart MOH on repeated AST_CONTROL_HOLD frames
if it is already in a state where it is supposed to be sending MOH.  The
MOH may have been stopped by other means.  (Such as killing the generator.)

This simple fix is done rather than making the AMI redirect action post an
AST_CONTROL_UNHOLD unconditionally when it redirects a channel and thus
potentially breaking something with an unexpected AST_CONTROL_UNHOLD.

(closes issue ABE-2873)
Patches:
      jira_abe_2873_c.3_bier.patch (license #5621) patch uploaded by rmudgett
........

Merged revisions 372521 from https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
........

Merged revisions 372522 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372524 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-06 22:14:52 +00:00
Darren Sessions 7e46e4d17b LDAP Realtime Peers Cannot Register
Prior to 1.8, it was not necessary for an explicit "type" to be set for an
asterisk LDAP realtime peer. Now the routine find_peer actually checks the
type field during registration and fails to find the peer if it is not set.

The attached patch makes the realtime type equal whatever type is being 
searched for if the type is 0 upon return from routine build_peer. 

(closes issue ASTERISK-17222)
Reported by: John Covert
Patch by: David Vossel
Tested by: Darren Sessions

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-05 14:12:11 +00:00
Mark Michelson a40f702aef Fix issue where SIP devices were not notified when custom devices changed to "ringing".
The problem had to do with logic used when checking for what the oldest ringing channel
was. The problem was that if no channel was found, then no notification would be sent.
For custom device states, there is no associated channel, so no notification would get
sent. This fixes the issue by still sending the notification even if no associated
channel can be found for a ringing device state change.

(closes issue ASTERISK-20297)
Reported by Noah Engelberth
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-04 15:50:30 +00:00
Matthew Jordan acbe1f90e7 AST-2012-013: Resolve ACL rules being ignored during calls by some IAX2 peers
When an IAX2 call is made using the credentials of a peer defined in a dynamic
Asterisk Realtime Architecture (ARA) backend, the ACL rules for that peer are
not applied to the call attempt. This allows for a remote attacker who is aware
of a peer's credentials to bypass the ACL rules set for that peer.

This patch ensures that the ACLs are applied for all peers, regardless of their
storage mechanism.

(closes issue ASTERISK-20186)
Reported by: Alan Frisch
Tested by: mjordan, Alan Frisch
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-30 16:25:34 +00:00
Matthew Jordan 8018b879a2 Clean up doxygen warnings
This patch fixes numerous doxygen warnings across Asterisk.  It also updates
the makefile to regenerate the doxygen configuration on the local system
before running doxygen to help prevent warnings/errors on the local system.

Much thanks to Andrew for tackling one of the Asterisk janitor projects!

(issue ASTERISK-20259)
Reported by: Andrew Latham
Patches:
  doxygen_partial.diff uploaded by Andrew Latham (license 5985)
  make_progdocs.diff uploaded by Andrew Latham (license 5985)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-30 14:23:28 +00:00
Jonathan Rose 6c07c904aa chan_sip: Change manager event to confirm SIPqualifypeer into an ack
Matt Jordan  informed me that it was more appropriate to use an
astman_send_ack here instead of making an event response. I've also
used this opportunity to update UPGRADE.txt to mention this change
in behavior.

(issue AST-969)
Reported by: John Bigelow


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371889 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-29 19:38:52 +00:00
Jonathan Rose 3f69a4e34f chan_sip: Send 408 on retransmit timeout instead of 603
(closes issue ASTERISK-20124)
Reported by: Walter Doekes
........

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

Merged revisions 371825 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371851 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-29 17:35:32 +00:00
Jonathan Rose 504cfd1070 chan_sip: Send a manager event to confirm SIPqualifypeer completes
Prior to this patch, Issuing SIPqualifypeer either resulted in an
error or if it succeeded, a few \r\ns.  This patch adds a
SIPqualifypeerComplete event issued as a response when the command
is successfully executed.

(closes issue AST-969)
Reported by: John Bigelow



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371823 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-29 16:44:48 +00:00
Joshua Colp 09b121bb50 Add support for call-id logging to chan_motif.
Review: https://reviewboard.asterisk.org/r/2077/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-22 15:55:26 +00:00
Mark Michelson 6a539ace84 Fix misuses of asprintf throughout the code.
This fixes three main issues

* Change asprintf() uses to ast_asprintf() so that it
pairs properly with ast_free() and no longer causes
MALLOC_DEBUG to freak out.

* When ast_asprintf() fails, set the pointer NULL if
it will be referenced later.

* Fix some memory leaks that were spotted while taking
care of the first two points.

(Closes issue ASTERISK-20135)
reported by Richard Mudgett

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

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

Merged revisions 371591 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-21 21:01:11 +00:00
Joshua Colp 1a95c9a906 When a peer registers using WebSocket do not resolve the Contact provided.
(closes issue ASTERISK-20238)
Reported by: james.mortensen
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371483 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-17 19:50:58 +00:00
Jonathan Rose d4879edd8e chan_sip: Use pvt outgoing_call variable to set Remote-Party-ID Header
Previously the pvt SIP_OUTGOING flag was used instead, which will frequently
flip during reinvites.

(closes issue AST-897)
Reported by: Thomas Arimont
........

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

Merged revisions 371358 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-16 19:52:08 +00:00
Jonathan Rose 70ca2e51a1 chan_sip: Trigger reinvite if the SDP answer is included in the SIP ACK
Under certain conditions, a SIP transaction involving directmedia wouldn't
trigger a re-invite because the SDP answer was included in an ACK instead
of in a message that we would have triggered the invite with. This patch
just queues a source change control frame if the dialog is using
directmedia when we find sdp for an ACK.

(closes issue AST-913)
Reported by: Thomas Arimont
........

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

Merged revisions 371338 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371356 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-16 18:28:30 +00:00
Michael L. Young 7aac43b4b1 Fix Segfault When Registering SIP Over WebSockets
The helper function, get_address_family_filter, in chan_sip for dns resolution
by address family was not recognizing the websockets transport and resulting in
a null pointer being sent to functions in netsock2, in an attempt to determine
if we are bound to ANY address ([::]) or not.

This patch fixes this issue by handling the transport types SIP_TRANSPORT_WS and
SIP_TRANSPORT_WSS which results in a sock address being set properly for use in
determining the address family.

(closes issue ASTERISK-20221)
Reported by: Sven Beisiegel
Tested by: Sven Beisiegel, James Mortensen
Patches: 
asterisk-20221-ws-family-filter.diff uploaded by Michael L. Young (license 5026)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-15 20:43:37 +00:00
Kinsey Moore 837e00a5cc Avoid unconditional NULLing of mwipvt on relatedpeer on SIP dialog destruction
The other instance of this bug was fixed by jcolp/file in r121496. If
we are destroying a dialog only set the MWI dialog pointer on the
related peer to NULL if it is the dialog currently being destroyed.

(closes issue ASTERISK-20119)
Patch-by: Misha Vodsedalek
........

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

Merged revisions 371271 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371277 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-15 20:18:26 +00:00
Kinsey Moore 76d642ff69 Add HANGUPCAUSE information to callee channels
This adds HANGUPCAUSE information to called channels so that hangup
handlers can, in conjunction with predial dialplan execution, access
the hangupcause information when the dialed channel hangs up on a
one-to-one basis instead of a many-to-one basis as with HANGUPCAUSE
usage on the caller channel.

Review: https://reviewboard.asterisk.org/r/2069/
(closes issue ASTERISK-20198)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-15 17:56:04 +00:00
Mark Michelson 5d02d8e016 Fix problem where incorrect pointer was checked for nullity.
........

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

Merged revisions 371199 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371202 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-13 20:02:41 +00:00
Richard Mudgett fb6238899b Add private representation of caller, connected and redirecting party ids.
This patch adds the feature "Private representation of caller, connected
and redirecting party ids", as previously discussed with us (DATUS) and
Digium.

1. Feature motivation

Until now it is quite difficult to modify a party number or name which can
only be seen by exactly one particular instantiated technology channel
subscriber.  One example where a modified party number or name on one
channel is spread over several channels are supplementary services like
call transfer or pickup.  To implement these features Asterisk internally
copies caller and connected ids from one channel to another.  Another
example are extension subscriptions.  The monitoring entities (watchers)
are notified of state changes and - if desired - of party numbers or names
which represent the involving call parties.  One major feature where a
private representation of party names is essentially needed, i.e.  where a
party name shall be exclusively signaled to only one particular user, is a
private user-specific name resolution for party numbers.  A lookup in a
private destination-dependent telephone book shall provide party names
which cannot be seen by any other user at any time.

2. Feature Description

This feature comes along with the implementation of additional private
party id elements for caller id, connected id and redirecting ids inside
Asterisk channels.

The private party id elements can be read or set by the user using
Asterisk dialplan functions.

When a technology channel is initiating a call, receives an internal
connected-line update event, or receives an internal redirecting update
event, it merges the corresponding public id with the private id to create
an effective party id.  The effective party id is then used for protocol
signaling.

The channel technologies which initially support the private id
representation with this patch are SIP (chan_sip), mISDN (chan_misdn) and
PRI (chan_dahdi).

Once a private name or number on a channel is set and (implicitly) made
valid, it is generally used for any further protocol signaling until it is
rewritten or invalidated.

To simplify the invalidation of private ids all internally generated
connected/redirecting update events and also all connected/redirecting
update events which are generated by technology channels -- receiving
regarding protocol information - automatically trigger the invalidation of
private ids.

If not using the private party id representation feature at all, i.e.  if
using only the 'regular' caller-id, connected and redirecting related
functions, the current characteristic of Asterisk is not affected by the
new extended functionality.

3. User interface Description

To grant access to the private name and number representation from the
Asterisk dialplan, the CALLERID, CONNECTEDLINE and REDIRECTING dialplan
functions are extended by the following data types.  The formats of these
data types are equal to the corresponding regular 'non-private' already
existing data types:

CALLERID:
priv-all
priv-name priv-name-valid priv-name-charset priv-name-pres
priv-num priv-num-valid priv-num-plan priv-num-pres
priv-subaddr priv-subaddr-valid priv-subaddr-type priv-subaddr-odd
priv-tag

CONNECTEDLINE:
priv-name priv-name-valid priv-name-pres priv-name-charset
priv-num priv-num-valid priv-num-pres priv-num-plan
priv-subaddr priv-subaddr-valid priv-subaddr-type priv-subaddr-odd
priv-tag

REDIRECTING:
priv-orig-name priv-orig-name-valid priv-orig-name-pres priv-orig-name-charset
priv-orig-num priv-orig-num-valid priv-orig-num-pres priv-orig-num-plan
priv-orig-subaddr priv-orig-subaddr-valid priv-orig-subaddr-type priv-orig-subaddr-odd
priv-orig-tag

priv-from-name priv-from-name-valid priv-from-name-pres priv-from-name-charset
priv-from-num priv-from-num-valid priv-from-num-pres priv-from-num-plan
priv-from-subaddr priv-from-subaddr-valid priv-from-subaddr-type priv-from-subaddr-odd
priv-from-tag

priv-to-name priv-to-name-valid priv-to-name-pres priv-to-name-charset
priv-to-num priv-to-num-valid priv-to-num-pres priv-to-num-plan
priv-to-subaddr priv-to-subaddr-valid priv-to-subaddr-type priv-to-subaddr-odd
priv-to-tag

Reported by: Thomas Arimont

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-10 19:54:55 +00:00
Mark Michelson 5ff199d99a Fix a comparison that was causing presence tests to fail.
A recent change made it so that device state changes that were
not actual "changes" would not get reported to subscribers. The
problem was that this inadvertently blocked presence updates as
well.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371113 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-10 17:56:05 +00:00
Richard Mudgett 18d5041981 Use better libss7 detection test and move libpri compile test.
........

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

Merged revisions 371013 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-09 19:22:35 +00:00
Mark Michelson 9ee8b3c0f6 Extend extension state callbacks to have more information.
Quote from review board:

This patch extends the extension state callbacks so that monitoring channels
(as chan_sip) get more information of the devices which are responsible for
an extension state change. The additional information is needed by chan_sip
to present names/numbers of the caller and callee in an early-state SIP
notification. Users of extenstion state callback not interested in the
additional information are not affected by the changes.

Motivation: to present the involved party's name/number in an early-state
nofification (used by the notified device as a pickup offer) one after another
so that a user can see which call he will pick up in an undirected pickup.
Such a pickup offer to a user shall indicate the same call (number/name-A calls
number/name-B) as the call which would be picked up when an undirected pickup
is executed.


Users interested in additional state info must use the new functions
ast_extension_state_add_extended() resp.
ast_extension_state_add_destroy_extended() to register an extended state
callback. When the callback is registered this way, an extra member
device_state_info of struct ast_state_cb_info is passed to the callback in
addition to the aggregated extension state. This container holds an object for
every device of the monitored extension hint consisting of the device name, the
device state and a channel reference to the channel which (presumably) caused
the device state.

The information is used by chan_sip for early-state notifications. When the
state of a device changes and the new state contains AST_EVENT_RINGING, an
early-state notification is sent to the subscribed devices with the
caller/callee names/numbers of the oldest ringing channel of the monitored
extension. The notified user may then invoke a direct pickup, which will pickup
exactly this channel.

Users of the old non-extended callbacks will only be called when the aggregated
state did change (same behavior as before). Users of the extended callback will
also be called when the state is unchanged but does contain AST_EVENT_RINGING.
That could be the case if two channels are ringing at one device and one of
them hangs up, so the aggregated state does not change. This way the monitoring
channel can create a new early-state notification with the now ringing
party-ids.

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

This contribution comes from Guenther Kelleter



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370979 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-09 14:52:16 +00:00
Richard Mudgett 062becab80 Convert sig_analog to use a global callback table.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370926 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-08 20:32:53 +00:00
Richard Mudgett f1dce57742 Fix the analog dial *0 flash-hook of bridged peer feature.
The flash-hook the bridged peer feature now correctly determines if the
bridged peer is another chan_dahdi channel, that it is an analog channel,
and that it has the correct signaling for an FXO port.  It now also
flash-hooks the correct channel.
........

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

Merged revisions 370901 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-08 20:17:02 +00:00
Richard Mudgett 35bf5efeaf Convert sig_pri to use a global callback table.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370893 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-08 00:35:37 +00:00
Richard Mudgett f24be2740b Convert sig_ss7 to use a global callback table.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-08 00:15:54 +00:00
Damien Wedhorn f4d1b7ab12 Rewrite of skinny debugging.
Debugging messages and associated controls only compiled in if configured with --enable-dev-mode. Debug messages provide more detail (including thread id) and are grouped so the user/dev can limit the type of messages displayed. Functionally no real change to chan_skinny.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-07 21:58:01 +00:00
Joshua Colp 15e41c7542 Reduce memory consumption significantly for users of the RTP engine API by storing only the payloads present and in use instead of every possible one.
Review: https://reviewboard.asterisk.org/r/2052/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-07 13:07:58 +00:00
Matthew Jordan 5c4578f4ad Add named callgroups/pickupgroups
This patch adds named calledgroups/pickupgroups to Asterisk.  Named groups are
implemented in parallel to the existing numbered callgroup/pickupgroup
implementation.  However, unlike the existing implementation, which is limited
to a maximum of 64 defined groups, the number of defined groups allowed for
named callgroups/pickupgroups is effectively unlimited.

Named groups are configured with the keywords "namedcallgroup" and
"namedpickupgroup".  This corresponds to the numbered group definitions of
"callgroup" and "pickupgroup".  Note that as the implementation of named groups
coexists with the existing numbered implementation, a defined named group of
"4" does not equate to numbered group 4.

Support for the named groups has been added to the SIP, DAHDI, and mISDN channel
drivers.

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

Uploaded by:
	Guenther Kelleter(license #6372)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370831 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-07 12:46:36 +00:00
Mark Michelson e46db5d943 Improve debug message for temporary outbound proxies.
Thanks to Paul Belanger for pointing this out.
........

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

Merged revisions 370798 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370801 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-06 15:18:18 +00:00
Mark Michelson 9f0127f087 Multiple revisions 370769-370771
........
  r370769 | mmichelson | 2012-08-03 16:35:00 -0500 (Fri, 03 Aug 2012) | 24 lines
  
  Fix error in the "IPorHost" section of a SIP dialstring.
  
  This is based on the review request posted by Walter Doekes
  (referenced lower in the commit message)
  
  The main fix here is to treat the IPorHost portion of the dial
  string as a temporary outbound proxy. This ensures requests
  get sent to the proper location.
  
  Due to the age of the request, some parts were no longer relevant.
  For instance, the request moved outbound proxy parsing code into
  a single method. This is done in a previous commit, so it was not
  necessary to do again.
  
  Also, the review request fixed some errors with regards to request
  routing for CANCEL and ACK requests. This has also been fixed in
  more recent commits.
  
  (closes issue ASTERISK-19677)
  reported by Walter Doekes
  
  Review https://reviewboard.asterisk.org/r/1859
........
  r370770 | mmichelson | 2012-08-03 16:39:35 -0500 (Fri, 03 Aug 2012) | 3 lines
  
  Remove unused variable.
........
  r370771 | mmichelson | 2012-08-03 16:43:52 -0500 (Fri, 03 Aug 2012) | 5 lines
  
  Seriously? Another compilation error fixed.
  
  Somebody beat me.
........

Merged revisions 370769-370771 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 370772 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370773 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-03 21:52:57 +00:00
Kinsey Moore e108a5777a Fix regression from r370636
When the chan_sip cleanup went in, a typo was included that caused some
subscriptions of non-Polycom phones to be limited to the same
capabilities as Polycom phones. This resolves the failures in the test
suite resulting from this regression.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-02 15:51:17 +00:00
Mark Michelson 4377d511ae Add headers from SIPAddHeader to outbound REFER requests.
This is a patch from kkm from review board.

This is useful for adding headers to REFER requests that
emanate from a Transfer() dialplan application call.

This also fixes some uses of the Referred-by header, removing
an extra set of angle brackets.

I've modified the reporter's original patch to not require
any additions to the sip_refer header and to just remove the
referred_by_name from sip_refer since it is no longer needed
or used.

(closes Issue ASTERISK-17639)
reported by Kirill Katsnelson
Patches:
	019059-sip-refer-addheaders-trunk-353549.diff
	uploaded by Kirill Katsnelson (license #5845)

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370691 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-31 22:28:16 +00:00
Matthew Jordan d5d41741cc Schedule pokes of registered SIP peers within a given timespan after SIP reload
With a large number of SIP peers registered, performing a SIP reload causes a
flood of SIP OPTIONS request packets.  These are immediately sent out, and, as
responses come back, can cause peers to be flagged as 'lagged' due to handling
of the many response messages.

This fix prevents this "packet storm" and schedules the pokes for a random
time.  That time varies between 1 ms and the peer's qualify time, or, if
the qualify time is unknown, the global qualifyfreq setting.

The committed patch has some very small modifications to the patch schmidts
wrote for the review.

(closes issue ASTERISK-19154)
Reported by: Nicolo Mazzon
patches:
  issue19154.patch license #6034 uploaded by schmidts

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

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

Merged revisions 370672 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370677 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-31 21:20:59 +00:00
Kinsey Moore 9b16c8b0f6 Clean up and ensure proper usage of alloca()
This replaces all calls to alloca() with ast_alloca() which calls gcc's
__builtin_alloca() to avoid BSD semantics and removes all NULL checks
on memory allocated via ast_alloca() and ast_strdupa().

(closes issue ASTERISK-20125)
Review: https://reviewboard.asterisk.org/r/2032/
Patch-by: Walter Doekes (wdoekes)
........

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

Merged revisions 370643 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-31 20:21:43 +00:00
Kinsey Moore e5210366e4 Clean up chan_sip
This clean up was broken out from
https://reviewboard.asterisk.org/r/1976/ and addresses the following:
 - struct sip_refer converted to use the stringfields API.
 - sip_{refer|notify}_allocate -> sip_{notify|refer}_alloc to match
   other *alloc functions.
 - Replace get_msg_text, get_msg_text2 and get_pidf_body -> No, not
   get_pidf_msg_text_body3 but get_content, to match add_content.
 - get_body doesn't get the request body, renamed to get_content_line.
 - get_body_by_line doesn't get the body line, and is just a simple if
   test. Moved code inline and removed function.
 - Remove camelCase in struct sip_peer peer state variables,
   onHold -> onhold, inUse -> inuse, inRinging -> ringing.
 - Remove camelCase in struct sip_request rlPart1 -> rlpart1,
   rlPart2 -> rlpart2.
 - Rename instances of pvt->randdata to pvt->nonce because that is what
   it is, no need to update struct sip_pvt because _it already has a
   nonce field_.
 - Removed struct sip_pvt randdata stringfield.
 - Remove useless (and inconsistent) 'header' suffix on variables in
   handle_request_subscribe.
 - Use ast_strdupa on Event header in handle_request_subscribe to avoid
   overly complicated strncmp calls to find the event package.
 - Move get_destination check in handle_request_subscribe to avoid
   duplicate checking for packages that don't need it.
 - Move extension state callback management in handle_request_subscribe
   to avoid duplicate checking for packages that don't need it.
 - Remove duplicate append_date prototype.
 - Rename append_date -> add_date to match other add_xxx functions.
 - Added add_expires helper function, removed code that manually added
   expires header.
 - Remove _header suffix on add_diversion_header (no other header adding
   functions have this).
 - Don't pass req->debug to request handle_request_XXXXX handlers if req
   is also being passed.
 - Don't pass req->ignore to check_auth as req is already being passed.
 - Don't create a subscription in handle_request_subscribe if
   p->expiry == 0.
 - Don't walk of the back of referred_by_name when splitting string in
   get_refer_info
 - Remove duplicate check for no dialog in handle_incoming when
   sipmethod == SIP_REFER, handle_request_refer checks for that.

Review: https://reviewboard.asterisk.org/r/1993/
Patch-by: gareth


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370636 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-31 19:10:41 +00:00
Richard Mudgett 00d8fae66b Release B channel allocation on error path in chan_misdn.
........

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

Merged revisions 370564 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-30 16:57:41 +00:00
Jonathan Rose 3da07b3ec0 chan_sip: Add SIPpeerstatus command to AMI
This patch was submitted by mnicholson a while back. It adds a new AMI action
which allows users to request SIP peer status on demand similar to existing
PeerStatus events and to the output you would see from CLI with sip show peer

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370518 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-26 15:31:05 +00:00
Tzafrir Cohen 6f8bb47833 chan_oss: fix "sample rate" error message
Merged revisions 370428 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Merged revisions 370432 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-24 17:16:40 +00:00
Igor Goncharovskiy 8eaba809ab Remove code, that operate with cdr in attempt_transfer(). That was removed somewhere between 1.2 and 1.4 and acidentaly put back in chan_unistim.
(closes issue ASTERISK-19628)
Reported by: Igor Olhovskiy



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-24 08:53:01 +00:00
Mark Michelson a28e6fc7bd Add separate configuration options for subscription and registration 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-23 21:10:54 +00:00
Joshua Colp 4d6b524b61 Prevent multiple local candidates from being added with the same information 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-22 17:03:24 +00:00
Jonathan Rose a5e10001b2 chan_iax2: Fix a segfault introduced by call ID logging
Didn't previously check that a non NULL IAX channel was stored in the array
at the requested position before attempting iax_pvt_callid_get

(closes issue ASTERISK-20145)
Reported by: Birger "WIMPy" Harzenetter


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-20 19:36:05 +00:00
Kinsey Moore c2d9192660 Fix build error in chan_misdn from commit 370316
chan_misdn was not updated properly to account for a change in
parameters for HANGUPCAUSE functionality. It now builds properly.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370328 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-20 18:37:44 +00:00
Kinsey Moore cb9756daa2 Add hangupcause translation support
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-20 15:48:55 +00:00
Matthew Jordan 86ff5585fd Add the ability to specify technology specific documentation
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-19 22:17:13 +00:00
Kevin P. Fleming 79087cbbd5 Ensure that all ast_datastore_info structures are 'const'.
While addressing a bug, I came across a instance of 'struct ast_datastore_info'
that was not declared 'const'. Since the API already expects them to be
'const', this patch changes the declarations of all existing instances
that were not already declared that way.
........

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

Merged revisions 370184 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-18 17:18:20 +00:00
Joshua Colp cbdb2dbb0e Fix a crash occurring as a result of excess stack usage.
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-18 11:38:05 +00:00
Igor Goncharovskiy 9278b5e51e Added option 'interdigit_timer' to unistim.conf to make able controll hardcoded dial timeout constant.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-18 07:17:00 +00:00
Walter Doekes 6027b26fa7 Code cleanup and bugfix in chan_sip outboundproxy parsing.
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-16 19:58:00 +00:00
Joshua Colp f234eae9ee Fix a bug exposed by the testsuite where text streams would no longer be parsed correctly.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-16 15:08:53 +00:00
Joshua Colp e938737570 Add support for SIP over WebSocket.
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-16 12:35:04 +00:00
Igor Goncharovskiy f9c3585d73 Deactivate timer for dialing entered number on hook switch hang up.
(closes issue ASTERISK-19554)
Reported by: Stefano Villani



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370067 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-16 07:38:18 +00:00
Igor Goncharovskiy 95ac8f4743 Add French translation for chan_unistim phones on-screen menus.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-16 07:34:12 +00:00
Joshua Colp a693fd1d87 Add support for parsing SDP attributes, generating SDP attributes, and 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-13 16:49:40 +00:00
Richard Mudgett 9773d2351b Add missing ast_hangup() calls on some analog exception paths.
Make starting analog_ss_thread() or __analog_ss_thread() failure paths
hangup the channel.
........

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

Merged revisions 370025 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370037 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-12 20:28:07 +00:00
Kinsey Moore c1354af599 Include Expires header for SIP PUBLISH requests
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-12 20:06:23 +00:00
Kinsey Moore 65fe6976ae Prevent double uri_escaping in chan_sip when pedantic is enabled
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-12 19:05:11 +00:00
Jonathan Rose 10afdf3a2a Named ACLs: Introduces a system for creating and sharing ACLs
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-11 18:33:36 +00:00
Joshua Colp a25b4b7457 Do not consider failure to read the configuration file in chan_motif to be a show stopper for loading Asterisk by returning decline instead of failure.
(closes issue ASTERISK-20103)
Reported by: Terry Wilson


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-11 16:42:01 +00:00
Matthew Jordan 9bc2127d7b Fix validation errors when producing documentation using default build script
The awk script parses out the first instance of the DOCUMENTATION tag that it
finds within a file.  If a file did not previously have a DOCUMENTATION tag
but received one due to it having an AMI event, then the XML fragment
associated with the AMI event was erroneously placed in the resulting XML
file.  Without the python scripts, these XML fragments will not validate.

This patch adds DOCUMENTATION tags at the top of those files that did
not previously have them to prevent the awk script from pulling AMI event
documentation.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369910 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-11 02:06:05 +00:00