Commit Graph

7398 Commits

Author SHA1 Message Date
Joshua Colp 2736fe9917 Defer sending the connected line reinvite if a reinvite is already in progress.
(issue ASTERISK-19355)
Reported by: tomaso

(closes issue AST-825)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-05 16:44:16 +00:00
Kinsey Moore dec0d4f9e3 Ensure Asterisk acknowledges ACKs to 4xx on Replaces errors
Asterisk was not setting pendinginvite in the upper half of
handle_request_invite such that the 4xx was retransmitted repeatedly even
though an ack was received for every retransmission.

(closes issue ASTERISK-19303)
Reported by: Jon Tsiros
Patches:
  fix-19303.patch uploaded by Jeremiah Gowdy (license 6358)

........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358117 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-05 16:00:32 +00:00
Terry Wilson b71deb0518 Fix unused-but-set-variable warnings
All of these were pretty obviously unused. Some were unused because
the code that used them was #if 0'd. In those cases, I just commented
out the unused-but-set variables.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358038 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-02 23:29:53 +00:00
Terry Wilson e8f8d2c81e Make chan_usbradio compile under dev mode
x=++x and x=x=1? Really?
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357999 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-02 22:36:28 +00:00
Richard Mudgett 9926662aba Remove ISDN hold restriction for non-bridged calls.
The check if an ISDN call is bridged before it could be placed on hold is
not necessary and is overly restrictive.  The check was originally done to
prevent problems with call transfers in case a user tried to transfer a
call connected to an application to another call connected to an
application.  The ISDN transfer code has not required this restriction for
quite some time because ECT could transfer any two active calls to each
other.

* Remove ISDN hold restriction for calls connected to applications.

* Made ast_waitfordigit_full() ignore AST_CONTROL_HOLD and
AST_CONTROL_UNHOLD instead of generating a warning message.

(closes issue ASTERISK-19388)
Reported by: Birger Harzenetter
Tested by: rmudgett
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357896 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-02 18:38:49 +00:00
Richard Mudgett ced1211fad Fix compile error from latest channel opaquification change.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357814 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-02 16:01:05 +00:00
Sean Bright f6b2f05f8c The default value for mohinterpret is the empty string, so when resetting to
default values don't explicitly set the value to "default."
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357813 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-02 16:00:41 +00:00
Mark Michelson 4094a9f57e Fix compilation error due to typo during channel opaquification.
s/ast_channel_fd_set/ast_channel_internal_fd_set/g



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-02 01:25:36 +00:00
Terry Wilson 0e5c761c28 Opaquify ast_channel typedefs, fd arrays, and softhangup flag
Review: https://reviewboard.asterisk.org/r/1784/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-01 22:09:18 +00:00
Terry Wilson a9d607a357 Opaquify ast_channel structs and lists
Review: https://reviewboard.asterisk.org/r/1773/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-29 16:52:47 +00:00
Richard Mudgett 764d2ccae2 Use more reasonable cause code when rejecting incoming call waiting calls.
(closes issue ASTERISK-19397)
Reported by: Birger Harzenetter
Patches:
      nochannel-cause.patch (license #5870) patch uploaded by Birger Harzenetter
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-28 21:01:09 +00:00
Mark Michelson 1bef7695ce Add a security event for the case where fake authentication challenge is sent.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357319 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-28 18:52:13 +00:00
Richard Mudgett 85ea4277f1 Convert struct ast_tcptls_session_instance to finally use the ao2 object lock.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-28 18:46:34 +00:00
Jonathan Rose 565f411868 Changes transport option in sip.conf so that using multiple instances doesn't stack.
Prior to this patch, Using "transport=" multiple times would cause them to add to one
another like allow/deny. This patch changes that behavior to simply use the transport
option specified last. Also, if no transport option is applied now, the default will
automatically be UDP.

(closes ASTERISK-19352)
Reported by: jamicque
Patches:
	asterisk-19352-transport-warning-message-v1.patch uploaded by Michael L. Young (license 5026)
	issueA19352_no_transport_is_udp.patch uploaded by Walter Doekes (license 5674)
Review: https://reviewboard.asterisk.org/r/1745/diff/#index_header
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357288 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-28 18:23:02 +00:00
Sean Bright c20cfcdcf0 Address comments from Mark Michelson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357014 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27 17:03:46 +00:00
Sean Bright 3cf09f40f7 Convert netsock.h over to use ast_sockaddrs rather than sockaddr_in and update
chan_iax2 to pass in the correct types.

chan_iax2 is the only consumer for the various ast_netsock_* functions in trunk
at this point, so this feels like a safe change to make.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357005 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27 16:31:24 +00:00
Jonathan Rose 299dd5d4fc Adds an option to sip.conf that prevents diversion headers from being added.
send_diversion=no will prevent Diversion headers from being added to SIP
requests. This doesn't prevent Diversion from being added with dialplan
such as with SIPAddHeader.

(closes issue ASTERISK-16862)
Reported by: rsw686
Review: https://reviewboard.asterisk.org/r/1769/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356987 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27 16:24:17 +00:00
Sean Bright 9ed6de9fd2 There isn't much point in saving off and restoring a value that we never use again.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356966 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27 16:12:51 +00:00
Sean Bright 51c24c88a1 Prefer ast_set_qos() over ast_netsock_set_qos()
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27 14:13:58 +00:00
Richard Mudgett ebe2c33b72 Fix worker thread resource leak in SIP TCP/TLS.
The SIP TCP/TLS worker threads were created joinable but noone could join
them if they died on their own.

* Fix the SIP TCP/TLS worker threads to not be created joinable.

* _sip_tcp_helper_thread() only needs one parameter since the pvt
parameter is only passed in as NULL and never used.

(closes issue ASTERISK-19203)
Reported by: Steve Davies

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356697 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24 18:33:04 +00:00
Matthew Jordan 670797e5da Allow SRTP policies to be reloaded
Currently, when using res_srtp, once the SRTP policy has been added to the
current session the policy is locked into place.  Any attempt to replace an
existing policy, which would be needed if the remote endpoint negotiated a new
cryptographic key, is instead rejected in res_srtp.  This happens in particular
in transfer scenarios, where the endpoint that Asterisk is communicating with
changes but uses the same RTP session.

This patch modifies res_srtp to allow remote and local policies to be reloaded
in the underlying SRTP library.  From the perspective of users of the SRTP API,
the only change is that the adding of remote and local policies are now added
in a single method call, whereas they previously were added separately.  This
was changed to account for the differences in handling remote and local
policies in libsrtp.

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

(closes issue ASTERISK-19253)
Reported by: Thomas Arimont
Tested by: Thomas Arimont
Patches:
  srtp_renew_keys_2012_02_22.diff uploaded by Matt Jordan (license 6283)
  (with some small modifications for this check-in)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24 15:10:35 +00:00
Terry Wilson ebaf59a656 Opaquification for ast_format structs in struct ast_channel
Review: https://reviewboard.asterisk.org/r/1770/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24 00:32:20 +00:00
Richard Mudgett 235f88d122 Fix blind transfer parking issues if the dialed extension is not recognized as a parking extension.
Custom parking extensions may not be coded such that the first and only
extension priority is the Park application.  These custom parking
extensions will not be recognized as parking extensions.  When a call is
blind transferred to an extension that is not recognized as a parking
extension, the normal blind transfer code causes the transferred channel
to start executing dialplan.  Calls that get parked in this manner do not
know the original channel name that parked the call so the original parker
could never be called back if the parked call is not retrieved before the
timeout time.  The parking space is also announced to the call being
parked as a side effect of not knowing the original parking channel.

* Fix handling of BLINDTRANSFER channel variable for call parking.

* Fixed SIP blind transfer using the wrong dialplan context variable to
check for the parking extension.

(closes issue ASTERISK-19322)
Reported by: aragon
Tested by: rmudgett, jparker

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

JIRA AST-766
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-23 20:14:54 +00:00
Mark Michelson c078a1819c Fix ACK routing for non-2xx responses.
When we send an ACK for a 2xx response to an INVITE, we are supposed
to use the learned route set. However, when we receive a non-2xx final
response to an INVITE, we are supposed to send the ACK to the same place
we initially sent the INVITE.

We had been doing this up until the changes went in that would build a route
set from provisional responses. That introduced a regression where we would
use the learned route set under all circumstances.

With this change, we now will set the destination of our ACK based on the
invitestate. If it is INV_COMPLETED then that means that we have received
a non-2xx final response (INV_TERMINATED indicates a 2xx response was received).
If it is INV_CANCELLED, then that means the call is being canceled, which
means that we should be ACKing a 487 response.

The other change introduced here is setting the invitestate to INV_CONFIRMED
when we send an ACK *after* the reqprep instead of before. This way, we can
tell in reqprep more easily what the invitestate is prior to sending the ACK.

(closes issue ASTERISK-19389)
reported by Karsten Wemheuer
patches:
    ASTERISK-19389v2.patch uploaded by Mark Michelson (license #5049)
	(with some slight modifications prior to commit)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356477 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-23 15:49:13 +00:00
Kevin P. Fleming 25a9b03cd1 Correct some set-but-unused variable warnings in the mISDN library.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356292 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-22 21:10:05 +00:00
Terry Wilson 90a6848c67 Fix chan_misdn after the lastest opaquification changes
It now compiles, but there are some unrelated warnings for set but
unused variables.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-22 17:34:33 +00:00
Matthew Jordan a8d9e0bf0b Merged revisions 356215 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r356215 | mjordan | 2012-02-22 08:53:53 -0600 (Wed, 22 Feb 2012) | 32 lines
  
  Merged revisions 356214 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r356214 | mjordan | 2012-02-22 08:50:20 -0600 (Wed, 22 Feb 2012) | 27 lines
    
    Fix potential buffer overrun and memory leak when executing "sip show peers"
    
    The "sip show peers" command uses a fix sized array to sort the current peers
    in the peers ao2_container.  The size of the array is based on the current
    number of peers in the container.  However, once the size of the array is
    determined, the number of peers in the container can change, as the peers
    container is not locked.  This could cause a buffer overrun when populating
    the array, if peers were added to the container after the array was created.
    Additionally, a memory leak of the allocated array would occur if a user
    caused the _show_peers method to return CLI_SHOWUSAGE.
    
    We now create a snapshot of the current peers using an ao2_callback with the
    OBJ_MULTIPLE flag.  This size of the array is set to the number of peers
    that the iterator will iterate over; hence, if peers are added or removed
    from the peers container it will not affect the execution of the "sip show
    peers" command.
    
    Review: https://reviewboard.asterisk.org/r/1738/
    
    (closes issue ASTERISK-19231)
    (closes issue ASTERISK-19361)
    Reported by: Thomas Arimont, Jamuel Starkey
    Tested by: Thomas Arimont, Jamuel Starkey
    Patches: sip_show_peers_2012_02_16.diff uploaded by mjordan (license 6283)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-22 14:54:42 +00:00
Sean Bright 1c971ae604 Make 'iax2 show callnumber usage' output make sense when an IP is passed in.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-21 11:17:53 +00:00
Terry Wilson 57f42bd74f ast_channel opaquification of pointers and integral types
Review: https://reviewboard.asterisk.org/r/1753/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20 23:43:27 +00:00
Sean Bright 25e5eb3b96 Remove spurious warning when 'qualifyfreqnotok' is set successfully.
(closes issue ASTERISK-17176)
Reported by: John Covert
Tested by: Sean Bright
Patches:
   chan_iax2.c.qualifyfreqnotok.patch uploaded by John Covert (license 5512)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355999 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20 18:40:11 +00:00
Sean Bright db487bd7f8 This was a LOG_NOTICE, so roll it back.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355954 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20 14:41:21 +00:00
Sean Bright 2bd6649a93 Change some debug messages from LOG_DEBUG to ast_debug.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355951 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20 14:37:41 +00:00
Sean Bright bec0ee0851 Add some boilerplate documentation for IAXVAR and IAXPEER.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355906 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-19 18:06:08 +00:00
Sean Bright 2c1b3144cb Set the length of the ast_sockaddr, so that we can set it's port later.
Without this, the call to ast_sockaddr_set_port a few lines later is a noop.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355903 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-19 17:51:12 +00:00
Alec L Davis a4f6d96b2e push 'outgoing' flag from sig_XXX up to chan_dahdi
'p->outgoing' in chan_dahdi and sig_analog wern't kept in sync, particulary FXS ast_hangup didn't clear the 'outgoing' flag.
sig_pri and sig_ss7 were keeping 'outgoing' flag insync.

Now provides a callback for all the low level sig_XXX modules.

(issue ASTERISK-19316)

alecdavis (license 585)
Reported by: Jeremy Pepper
Tested by: alecdavis
 
Review: https://reviewboard.asterisk.org/r/1747/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-18 08:02:08 +00:00
Sean Bright 3816fdde94 Don't allow trunkfreq to be greater than 1000ms.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355795 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-17 22:03:56 +00:00
Sean Bright 7c373d8c13 Pass the correct value to ast_timer_set_rate() for IAX2 trunking.
IAX2 uses the trunkfreq variable to determine how often to send trunk packets, but
this value is in milliseconds while ast_timer_set_rate() expects the rate argument
to be ticks per second.  So we divide 1000 by trunkfreq and pass that in instead.

With a default of 20ms, this change makes IAX2 send trunk packets every 20ms
instead of every 50ms.

Tracked down by myself and Bob Wienholt.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355748 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-17 19:35:11 +00:00
Mark Michelson 8a20faa8d7 Fix regressions with regards to route-set creation on early dialogs.
This fixes two main issues:

1. Asterisk would send a CANCEL to the route created by the provisional response
   instead of using the same destination it did in the initial INVITE.
2. If a new route set arrives in a 200 OK than was in the 1XX response (perfectly
   possible if our outbound INVITE gets forked), then the route set in the 200 OK
   needs to overwrite the route set in the 1XX response.

(closes issue ASTERISK-19358)
Reported by: Karsten Wemheuer
Tested by: Karsten Wemheuer
patches:
   ASTERISK-19358.patch uploaded by Mark Michelson (license 5049)
   ASTERISK-19358.patch uploaded by Stefan Schmidt (license 6034)

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355745 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-17 19:22:22 +00:00
Sean Bright b69fb773d2 When IAX2 debugging is enabled, make sure to log 'apathetic' messages too.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355531 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-15 19:29:26 +00:00
Sean Bright 45f361c9bd Remove IAX_OLD_FIND from chan_iax2.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355495 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-15 18:41:22 +00:00
Sean Bright 0d12368261 Use TRUNK_CALL_START as originally intended.
Back in r646, TRUNK_CALL_START was added and defined as 0x4000.  That same value
was also hard-coded in one part of the IAX2 code instead of using the #define.

TRUNK_CALL_START has changed over the years (for dealing with LOW_MEMORY), but
the hard-coded usage was never updated to match.  This patch fixes that.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-15 17:26:30 +00:00
Mark Michelson 03894236d0 Properly invert the return of a strncmp call.
This was causing identification that should have been
made private to be public.

(closes issue AST-814)
reported by Patrick Anderson

Patches:
	chan_sip.c.diff uploaded by Patrick Anderson (license 5430)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-14 16:28:01 +00:00
Sean Bright 98111f8f1f Clear the high order bit from the destination call number before sending.
send_apathetic_reply takes the incoming frame's source call number as the
destination call number for the outgoing frame.  If the incoming frame was a
full frame, then the high order bit of the source call number is set and will be
interpreted as a retransmit when sent back out as the destination call number.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-14 13:35:02 +00:00
Richard Mudgett d8af1a4882 Fix compile error from most recent ast_channel opaquification installment.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355055 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-13 21:36:26 +00:00
Terry Wilson 34c55e8e7c Opaquify char * and char[] in ast_channel
Review: https://reviewboard.asterisk.org/r/1733/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-13 17:27:06 +00:00
Kinsey Moore 6225c6cadc Fix parsing of SIP headers where compact and non-compact headers are mixed
Change parsing of SIP headers so that compactness of the header no longer
influences which header will be chosen.  Previously, a non-compact header
would be chosen instead of a preceeding compact-form header.

(closes issue ASTERISK-17192)
Review: https://reviewboard.asterisk.org/r/1728/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354704 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-09 20:52:13 +00:00
Terry Wilson e5c51ee44c Add auto_force_rport and auto_comedia NAT options
This patch adds the auto_force_rport and auto_comedia NAT options. It
also converts the nat= setting to a list of comma-separated combinable
options: no, force_rport, comedia, auto_force_rport, and auto_comedia.
nat=yes remains as an undocumented option equal to
"force_rport,comedia". The first instance of 'yes' or 'no' in the list
stops parsing and overrides any previously set options. If an auto_*
option is specified with its non-auto_ counterpart, the auto setting
takes precedence.

This patch builds upon the patch posted to ASTERISK-17860 by JIRA user
pedro-garcia.

(closes issue ASTERISK-17860)
Review: https://reviewboard.asterisk.org/r/1698/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354597 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-09 18:14:39 +00:00
Matthew Jordan dff9b61f5c Clean-up of minor formatting issues in r354542/3/4
rmudgett pointed out some formatting issues in the check-in for
ASTERISK-19290.  This cleans those up.

Review: https://reviewboards.asterisk.org/r/1722/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354549 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-09 17:09:10 +00:00
Matthew Jordan ba08e9f4d6 Fix SIP INFO DTMF handling for non-numeric codes
In ASTERISK-18924, SIP INFO DTMF handlingw as changed to account for both
lowercase alphatbetic DTMF events, as well as uppercase alphabetic DTMF
events.  When this occurred, the comparison of the character buffer containing
the event code was changed such that the buffer was first compared again '0'
and '9' to determine if it was numeric.  Unfortunately, since the first
character in the buffer will typically be '1' in the case of non-numeric
event codes (10-16), this caused those codes to be converted to a DTMF event
of '1'.  This patch fixes that, and cleans up handling of both
application/dtmf-relay and application/dtmf content types.

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

(closes issue ASTERISK-19290)
Reported by: Ira Emus
Tested by: mjordan
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354544 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-09 16:37:01 +00:00
Richard Mudgett 16fbc7e902 Fix some compile problems from the 'cppcheck' patch.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354498 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-09 03:09:39 +00:00
Terry Wilson 3342183016 Add callbackextension matching & realtime callbackextensions
This patch is based on the one by David Vossel, developer extrodinaire, at
https://reviewboard.asterisk.org/r/344/. If multiple peers are defined with the
same host/port, but differing callbackextensions, it chooses the peer with the
matching callbackextension. Since callbackextension creates an outbound
registration with the callbackextension as the Contact address, matching an
incoming request by that (in addition to the host/port) makes a lot of sense.

This patch also adds support for callbackextension to realtime by querying all
peers with callbackextensions on reload and adding registrations for them.

(closes issue ASTERISK-13456)
Review: https://reviewboard.asterisk.org/r/344/
Review: https://reviewboard.asterisk.org/r/1717/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354458 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-08 21:28:55 +00:00
Kevin P. Fleming f0e321b88a Restore some variables removed by the 'cppcheck' patch that were actually needed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-08 21:25:57 +00:00
Walter Doekes db24fc2523 Avoid cppcheck warnings; removing unused vars and a bit of cleanup.
Patch by: Clod Patry
Review: https://reviewboard.asterisk.org/r/1651


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-08 20:49:48 +00:00
Terry Wilson 8ba2d70602 Fix multiple SIP realtime issues
1. Set lastms to 0 when clearing instead of ""
2. Don't set ipaddr or port to the string "(null)" when they are empty
3. Add missing required fields, set default for lastms to 0, and modify
   the length of the ipaddr field to 45 in the Postgresql realtime.sql
   file.

(closes issue ASTERISK-19172)
Review: https://reviewboard.asterisk.org/r/1703/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-07 21:33:42 +00:00
Richard Mudgett a4f5d2c2ef Restore alternate SIG_PRI_DEBUG_DEFAULT meaning.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-06 20:56:23 +00:00
Kinsey Moore 49ed50d8ac Allow more control over the output of pri debug
This changes the debuglevel of 'pri set debug' to a bit mask allowing the user
to independently select bits of output:
1 libpri internals including state machine
2 Decoded Q.931 messages
4 Decoded Q.921 headers
8 raw hex dump of the full frames

Additionally, this ensures that the meaning of "on" does not change and
intrudces intense and hex to simplify usage.

(closes issue ASTERISK-17159)
Original-patch-by: wimpy


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-06 20:18:16 +00:00
Jonathan Rose a898eb4d07 Fixes deadlocks occuring in chan_agent due to r335976
Bad locking order was added to chan_agent to prevent segfaults from having no locking
in a patch by irroot. This patch addresses the bad locking order by releasing locks before
getting the right locking order to stop deadlocks from occuring when doing multiple
interactions with agents.

(closes issue ASTERISK-19285)
Reported by: Alex Villacis Lasso
Review: https://reviewboard.asterisk.org/r/1708/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354001 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-03 21:33:23 +00:00
Kinsey Moore 29318afc15 Ensure entering T.38 passthrough does not cause an infinite loop
After R340970 Asterisk was still polling the RTCP file descriptor after RTCP is
shut down and removed. If the descriptor happened to have data ready when the
removal occured then Asterisk would go into an infinite loop trying to read
data that it can never actually access. This change disables the audio RTCP
file descriptor for the duration of the T.38 transaction.

(closes issue ASTERISK-18951)
Reported-by: Kristijan Vrban
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-02 22:28:36 +00:00
Richard Mudgett 63c5eaee43 Restore the 'w' modifier support for ISDN spans. Dial(DAHDI/g0/1234w888)
This feature also causes the sending complete ie to be sent for switch
types that do not automatically send the ie.  (EuroISDN/ETSI)

The main difference between dialing Dial(DAHDI/g0/1234w888) and
Dial(DAHDI/g0/1234,,D(888)) is the sending of the sending complete ie.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-02 20:18:11 +00:00
Jonathan Rose 5164196972 Fix sip show peers port output, align columns, and fix ami port output.
A previous patch I committed from ASTERISK-16930 unexpectedly changed some output for
the AMI action "sippeers" which this patch changes back. Also, this aligns the output
for the cli command "sip show peers" and fixes another issue that patch introduced by
using ast_sockaddr_stringify calls multiple times without immediately using the pointer.
I also went ahead and did a little janitorial work to clean up whitespace in
_sip_show_peers.

(issue ASTERISK-16930)
(closes issue ASTERISK-19281)
Reported by: Patrick El Youssef
Patches:
	ASTERISK-19281.diff uploaded by Walter Doekes (license 5674)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-02 17:07:35 +00:00
Jonathan Rose 0e334d427b Use ast_sockaddr_stringify_fmt wrappers for various functions in chan_sip
There are a number of cleaner looking wrappers for ast_sockaddr_stringify_fmt
available which are slightly more readable than using a direct call to
ast_sockaddr_stringify_fmt. This patch switches a number of those calls in
chan_sip to use those wrappers and is generally harmless.

(Closes issue ASTERISK-16930)
Reported by: Michael L. Young
Patches:
	chan_sip-broken-registration-1.8.diff uploaded by Michael L. Young (license 5026)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353725 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01 21:18:03 +00:00
Richard Mudgett 23bc964e1c Constify some more channel driver technology callback parameters.
Review: https://reviewboard.asterisk.org/r/1707/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01 19:53:38 +00:00
Terry Wilson de57235ac6 Re-link peers by IP when dnsmgr changes the IP
Asterisk's dnsmgr currently takes a pointer to an ast_sockaddr and updates it
anytime an address resolves to something different. There are a couple of
issues with this. First, the ast_sockaddr is usually the address of an
ast_sockaddr inside a refcounted struct and we never bump the refcount of those
structs when using dnsmgr. This makes it possible that a refresh could happen
after the destructor for that object is called (despite ast_dnsmgr_release
being called in that destructor). Second, the module using dnsmgr cannot be
aware of an address changing without polling for it in the code. If an action
needs to be taken on address update (like re-linking a SIP peer in the
peers_by_ip table), then polling for this change negates many of the benefits
of having dnsmgr in the first place.

This patch adds a function to the dnsmgr API that calls an update callback
instead of blindly updating the address itself. It also moves calls to
ast_dnsmgr_release outside of the destructor functions and into cleanup
functions that are called when we no longer need the objects and increments the
refcount of the objects using dnsmgr since those objects are stored on the
ast_dnsmgr_entry struct. A helper function for returning the proper default SIP
port (non-tls vs tls) is also added and used.

This patch also incorporates changes from a patch posted by Timo Teräs to
ASTERISK-19106 for related dnsmgr issues.

(closes issue ASTERISK-19106)

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353418 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 23:58:51 +00:00
Alec L Davis f92d6412ab Merged revisions 353369 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r353369 | alecdavis | 2012-01-31 11:42:28 +1300 (Tue, 31 Jan 2012) | 9 lines
  
  Merged revisions 353368 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r353368 | alecdavis | 2012-01-31 11:40:40 +1300 (Tue, 31 Jan 2012) | 2 lines
    
    prevent debug messsges displaying -ve Cseq numbers. Missed in R353320
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 22:44:50 +00:00
Alec L Davis 0ccc1f5274 Merged revisions 353321 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r353321 | alecdavis | 2012-01-31 11:16:22 +1300 (Tue, 31 Jan 2012) | 25 lines
  
  Merged revisions 353320 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r353320 | alecdavis | 2012-01-31 10:57:49 +1300 (Tue, 31 Jan 2012) | 18 lines
    
    RFC3261 Section 8.1.1.5. The sequence number value MUST be expressible as a 32-bit unsigned integer
    
    * fix: use %u instead of %d when dealing with CSeq numbers - to remove possibility of -ve numbers.
    
    * fix: change all uses of seqno and friends (ocseq icseq) from 'int' or 'unsigned int' to uint32_t.
    
    Summary of CSeq numbers.
    An initial CSeq number must be less than 2^31
    A CSeq number can increase in value up to 2^32-1
    An incrementing CSeq number must not wrap around to 0.
    
    Tested with Asterisk 1.8.8.2 with Grandstream phones.
     
    alecdavis (license 585)
    Tested by: alecdavis
     
    Review: https://reviewboard.asterisk.org/r/1699/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353347 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 22:28:37 +00:00
Kevin P. Fleming 82f313b7b8 Clarify log WARNING message when port-zero SDP 'm' lines received.
Previously, if an m-line in an SDP offer or answer had a port number of zero,
that line was skipped, and resulted in an 'Unsupported SDP media type...'
warning message. This was misleading, as the media type was not unsupported,
but was ignored because the m-line indicated that the media stream had been
rejected (in an answer) or was not going to be used (in an offer).
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 12:50:40 +00:00
Damien Wedhorn 843c7ef088 Allow softkey reject while device onhook.
Fixes up softkey endcall. Previous code was a copy of onhook, now
allows for endcall softkey to be used while device is still onhook.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353224 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-29 22:33:08 +00:00
Richard Mudgett 27b69e7d29 Audit of ao2_iterator_init() usage for v1.8.
Fixes numerous reference leaks and missing ao2_iterator_destroy() calls as
a result.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-27 18:47:16 +00:00
Alec L Davis e0ca02fe21 Merged revisions 352863 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r352863 | alecdavis | 2012-01-27 13:08:03 +1300 (Fri, 27 Jan 2012) | 19 lines
  
  Merged revisions 352862 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r352862 | alecdavis | 2012-01-27 13:05:30 +1300 (Fri, 27 Jan 2012) | 12 lines
    
    rfc4235 - Section 4.1: Versions MUST be representable using a non-negative 32 bit integer.
    
    If a BLF subscription exists for long enough, using %d may print negative version numbers.
    Unlikely, as 2^32 at 1 update per second is ~137 years, or half that before the versions number started going negative.
    
    Tested with Asterisk 1.8.8.2 with Grandstream phones.
     
    alecdavis (license 585)
    Tested by: alecdavis
     
    Review: https://reviewboard.asterisk.org/r/1694/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-27 00:11:41 +00:00
Jonathan Rose f4d98aeb28 Copy amaflags to sip_pvt from peer during create_addr_from_peer
For whatever reason, we don't have a single function for copying data like this
from SIP peers to the SIP pvt. This patch adds the copying of amaflags to the
sip_pvt, but it would probably be worth discussing this function along with
the others that essentially just copy some amount of data from a peer to a
private.

(Closes issue ASTERISK-19029)
Reported by: Matt Lehner
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352757 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-26 19:09:02 +00:00
Alec L Davis ed32b1c098 Merged revisions 352705 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r352705 | alecdavis | 2012-01-26 19:33:11 +1300 (Thu, 26 Jan 2012) | 27 lines
  
  Merged revisions 352704 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r352704 | alecdavis | 2012-01-26 19:27:07 +1300 (Thu, 26 Jan 2012) | 20 lines
    
    Cleanup dialog-info+xml Notify dialog
    
    Make similar to other Notify messages.
    
    sample output:
    
    <?xml version="1.0"?>
    <dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="715" state="full" entity="sip:8523@192.168.x.xx">
    <dialog id="8523">
    <state>terminated</state>
    </dialog>
    </dialog-info>
    
    Tested with Asterisk 1.8.8.2 with Grandstream phones.
     
    alecdavis (license 585)
    Tested by: alecdavis
     
    Review: https://reviewboard.asterisk.org/r/1693/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-26 06:36:23 +00:00
Terry Wilson 080ea28515 Remove some extraneous debugging from registry memleak fix
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-25 17:33:23 +00:00
Richard Mudgett cbe57b11cb Fixes for sending SIP MESSAGE outside of calls.
* Fix authenticate MESSAGE losing custom headers added by the MESSAGE_DATA
function in the authorization attempt.

* Pass up better From header contents for SIP to use.  Now is in the
"display-name" <URI> format expected by MessageSend.  (Note that this is a
behavior change that could concievably affect some people.)

* Block user from adding standard headers that are added automatically.
(To, From,...)

* Allow the user to override the Content-Type header contents sent by
MessageSend.

* Decrement Max-Forwards header if the user transferred it from an
incoming message.

* Expand SIP short header names so the dialplan and other code only has to
deal with the full names.

* Documents what SIP expects in the MessageSend(from) parameter.

(closes issue ASTERISK-18992)
Reported by: Yuri

(closes issue ASTERISK-18917)
Reported by: Shaun Clark

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-25 17:23:25 +00:00
Terry Wilson 4bf5e3716e Clean up some SIP registry-related memory leaks
1) Be sure and free at unload the epa_backend we allocate at startup
2) Do the same sip_registry cleanup at unload we do at reload

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-25 17:02:29 +00:00
Terry Wilson 213f7a65b5 Fix channel opaquification of stringfields for chan_vpb
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352475 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-25 01:21:23 +00:00
Mark Michelson 0fe9043233 Don't do a DNS lookup on an outbound REGISTER host if there is an outbound proxy configured.
(closes issue ASTERISK-16550)
reported by: Olle Johansson
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352431 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-24 22:28:08 +00:00
Terry Wilson 99cae5b750 Opaquify channel stringfields
Continue channel opaque-ification by wrapping all of the stringfields.
Eventually, we will restrict what can actually set these variables, but
the purpose for now is to hide the implementation and keep people from
adding code that directly accesses the channel structure. Semantic
changes will follow afterward.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-24 20:12:09 +00:00
Richard Mudgett 74508e3bca Fix sip_cfg.notifycid to be set with the defined enum values.
The invalid value used when notifycid was enabled was benign.  As far as
the code was concerned -1 and 1 are equivalent.

(closes issue ASTERISK-19232)
Reported by: Eike Kuiper
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-23 17:36:28 +00:00
Mark Michelson 02408a2476 Remove XXX comment that is not necessary.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-21 00:11:13 +00:00
Mark Michelson ab8ba431b6 Fix RTP reference leak.
If a blind transfer were initiated using a REFER without a prior
reINVITE to place the call on hold, AND if Asterisk were sending
RTCP reports, then there was a reference for the RTP instance
of the transferer.

This fixes the issue by merging two similar but slightly conflicting
sections of code into a single area. It also adds a stop_media_flows()
call in the case that the transferer's UA never sends a BYE to us
like it is supposed to.

(issue ASTERISK-19192)

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-21 00:10:35 +00:00
Richard Mudgett d0c765497d Make CLI sip show channel list the complete route set.
(closes issue ASTERISK-16877)
Reported by: klaus3000
Patches:
      show-complete-routeset-patch.txt (license #5054) patch uploaded by klaus3000 (modified)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351977 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-20 23:05:06 +00:00
Kinsey Moore c6fd4f5d74 SIP session timeout AMI event
Add an AMI event in the Call category that is issued when a call is terminated
due to either RTP stream inactivity or SIP session timer expiration.

Event description:

Event: SessionTimeout
Source: source
Channel: channel-name
Uniqueid: channel-unique-id

`source` can be either RTPTimeout or SIPSessionTimer

(closes issue ASTERISK-16467)
Patch-by: Kirill Katsnelson


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351939 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-20 21:26:50 +00:00
Jonathan Rose 1a6960099b Adds setting of mwi_from field to check_auth_result check_peer_ok
(closes ASTERISK-19057)
Reported By: Yuri
Patches: 348360chan_sip.diff uploaded by Yuri (license 5242)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-20 16:00:58 +00:00
Richard Mudgett ae32acfa3e Misc minor fixes in reqresp_parser.c and chan_sip.c.
* Fix corner cases in get_calleridname() parsing and ensure that the
output buffer is nul terminated.

* Make get_calleridname() truncate the name it parses if the given buffer
is too small rather than abandoning the parse and not returning anything
for the name.  Adjusted get_calleridname_test() unit test to handle the
truncation change.

* Fix get_in_brackets_test() unit test to check the results of
get_in_brackets() correctly.

* Fix parse_name_andor_addr() to not return the address of a local buffer.
This function is currently not used.

* Fix potential NULL pointer dereference in sip_sendtext().

* No need to memset(calleridname) in check_user_full() or tmp_name in
get_name_and_number() because get_calleridname() ensures that it is nul
terminated.

* Reply with an accurate response if get_msg_text() fails in
receive_message().  This is academic in v1.8 because get_msg_text() can
never fail.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351667 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-19 23:31:17 +00:00
Jonathan Rose 6fd0ac9dcd Eliminates doubling the :port part of SIP Notify Message-Account headers.
This patch prevents the domain string from getting mangled during the initreqprep
step by moving the initialization to before its immediate use.  It also documents
this pitfall for the ast_sockaddr_stringify functions.

(issue ASTERISK-19057)
Reported by: Yuri
Review: https://reviewboard.asterisk.org/r/1678/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-19 21:55:41 +00:00
Joshua Colp ddf421bd5c Prevent crash when an SDP offer is received with an encrypted video stream when support for video is disabled and res_srtp is loaded.
(closes issue ASTERISK-19202)
Reported by: Catalin Sanda
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351506 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-19 21:13:02 +00:00
Stefan Schmidt f69fd136f4 The get_pai function in chan_sip.c didn't recognized a proper callerid name and
number from a P-Asserted-Identity cause the header parsing logic was wrong. 
Changing the parsing functions to the sip header parsing APIs in 
reqresp_parser.h solves this problem.

Review: https://reviewboard.asterisk.org/r/1673
Reviewed by: wdoekes2 and Mark Michelson
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-18 16:02:15 +00:00
Mark Michelson 5af788ccd0 Use built-in parsing functions for Contact and Record-Route headers.
If a Contact or a Record-Route header had a quoted string with an
item in angle brackets, then we would mis-parse it. For instance,
"Bob <1234>" <1234@example.org>
would be misparsed as having the URI "1234"
The fix for this is to use parsing functions from reqresp_parser.h
since they are heavily tested and are awesome.

(issue ASTERISK-18990)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351288 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-17 16:56:04 +00:00
Matthew Jordan f86621eb93 Fix udptl issue with initial INVITE introduced by r351027
When an inital INVITE occurs that contains image media, a channel
is not yet associated with the SIP dialog.  The file descriptor
associated with the udptl session needs to be set in
initialize_udptl or in sip_new to account for this scenario.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351235 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-17 16:08:43 +00:00
Russell Bryant 141dd18848 Merged revisions 351183 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r351183 | russell | 2012-01-16 20:43:19 -0500 (Mon, 16 Jan 2012) | 29 lines
  
  Merged revisions 351182 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r351182 | russell | 2012-01-16 20:37:03 -0500 (Mon, 16 Jan 2012) | 22 lines
    
    Add some missing locking in chan_sip.
    
    This patch adds some missing locking to the function 
    send_provisional_keepalive_full().  This function is called from the scheduler,
    which is processed in the SIP monitor thread.  The associated channel (or pbx)
    thread will also be using the same sip_pvt and ast_channel so locking must be
    used.  The sip_pvt_lock_full() function is used to ensure proper locking order
    in a safe manner.
    
    In passing, document a suspected reference counting error in this function.
    The "fix" is left commented out because when the "fix" is present, crashes
    occur.  My theory is that fixing it is exposing a reference counting error
    elsewhere, but I don't know where.  (Or my analysis of this being a problem
    could have been completely wrong in the first place).  Leave the comment in
    the code for so that someone may investigate it again in the future.
    
    Also add a bit of doxygen to transmit_provisional_response().
    
    (closes issue ASTERISK-18979)
    
    Review: https://reviewboard.asterisk.org/r/1648
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-17 01:48:12 +00:00
Terry Wilson aacc158072 Ensure ACK retransmit & hangup on non-200 response to INVITE
When handling a non-2xx final response on an INVITE transaction, we have to
keep the transaction around after we send an ACK in case we receive a
retransmission of the response so we can re-transmit the ACK, but also tear
down the ast_channel as soon as we transmit the ACK. Before this patch, we
could fail at both of these things. Calling sip_alreadygone/needdestroy
prevented us from keeping the transaction up and retransmitting the ACK, and
queueing CONGESTION was not sufficient to cause the channel to be torn down
when originating calls via the CLI, for example.

This patch queues a hangup with CONGESTION instead of just queueing CONGESTION
for these responses and removes the sip_alreadygone and sip_needdestroy calls
from handle_response_invite on non-2xx responses. It relies on the hangup
calling sip_scheddestroy.

For more information, see section 17.1.1.1 of RFC 3261.

(closes issue ASTERISK-17717)
Review: https://reviewboard.asterisk.org/r/1672/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-16 21:50:10 +00:00
Terry Wilson fb5924ebe8 Don't prematurely stop SIP session timer
When Asterisk is the UAS (incoming call, endpoint is re-inviting) the SIP session timer expires after half the time the sip endpoint indicates in the Session-expires header in proc_session_timer(). The session timer was being stopped totally and being handled as an error case instead of running again until the second expiry. This patch treats the half-time expiry as a non-error case and continues the timer until the true expiry.

(closes issue ASTERISK-18996)
Reported by: Thomas Arimont
Tested by: Thomas Arimont
Patches: session_timer_fix.diff by Terry Wilson (License #5357)
  based on session_timer.patch by Thomas Arimont (License #5525)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-16 20:15:24 +00:00
Matthew Jordan e09527b10d Create and initialize udptl only when dialog negotiates for image media
Prior to this patch, the udptl struct was allocated and initialized when a
dialog was associated with a peer that supported T.38, when a new SIP
channel was allocated, or what an INVITE request was received.  This resulted
in any dialog associated with a peer that supported T.38 having udptl support
assigned to it, including the UDP ports needed for communication.  This
occurred even in non-INVITE dialogs that would never send image media.

This patch creates and initializes the udptl structure only when the SDP
for a dialog specifies that image media is supported, or when Asterisk
indicates through the appropriate control frame that a dialog is to support
T.38.

(closes issue ASTERISK-16698)
Reported by: under
Tested by: Stefan Schmidt
Patches: udptl_20120113.diff uploaded by mjordan (License #6283)

(closes issue ASTERISK-16794)
Reported by: Elazar Broad
Tested by: Stefan Schmidt

review: https://reviewboard.asterisk.org/r/1668/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-16 19:13:56 +00:00
Kevin P. Fleming 0f83634984 Multiple revisions 350788-350789
........
  r350788 | kpfleming | 2012-01-14 09:22:33 -0600 (Sat, 14 Jan 2012) | 8 lines
  
  Ensure that two prerequisites are properly installed on Debian-style distributions.
  
  * Don't specify a specific version of libgmime; newer versions are available
    now and acceptable.
  
  * Install libsrtp so that res_srtp can be built.
........
  r350789 | kpfleming | 2012-01-14 09:23:32 -0600 (Sat, 14 Jan 2012) | 3 lines
  
  Correct some 'set-but-not-used' variable warnings.
........

Merged revisions 350788-350789 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350791 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-14 15:51:43 +00:00
Mark Michelson 9c161503dc Set port to a default sane value if a bogus one is provided when parsing hostnames.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350681 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-13 20:32:19 +00:00
Matthew Jordan a8276fe8ef Fix crash from bridge channel hangup race condition in ConfBridge
This patch addresses two issues in ConfBridge and the channel bridge layer:
1. It fixes a race condition wherein the bridge channel could be hung up
2. It removes the deadlock avoidance from the bridging layer and makes the
   bridge_pvt an ao2 ref counted object

Patch by David Vossel (mjordan was merely the commit monkey)

(issue ASTERISK-18988)
(closes issue ASTERISK-18885)
Reported by: Dmitry Melekhov
Tested by: Matt Jordan
Patches: chan_bridge_cleanup_v.diff uploaded by David Vossel (license 5628)

(closes issue ASTERISK-19100)
Reported by: Matt Jordan
Tested by: Matt Jordan

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-13 16:48:06 +00:00
Terry Wilson 04da92c379 Replace direct access to channel name with accessor functions
There are many benefits to making the ast_channel an opaque handle, from
increasing maintainability to presenting ways to kill masquerades. This patch
kicks things off by taking things a field at a time, renaming the field to
'__do_not_use_${fieldname}' and then writing setters/getters and converting the
existing code to using them. When all fields are done, we can move ast_channel
to a C file from channel.h and lop off the '__do_not_use_'.

This patch sets up main/channel_interal_api.c to be the only file that actually
accesses the ast_channel's fields directly. The intent would be for any API
functions in channel.c to use the accessor functions. No more monkeying around
with channel internals. We should use our own APIs.

The interesting changes in this patch are the addition of
channel_internal_api.c, the moving of the AST_DATA stuff from channel.c to
channel_internal_api.c (note: the AST_DATA stuff will have to be reworked to
use accessor functions when ast_channel is really opaque), and some re-working
of the way channel iterators/callbacks are handled so as to avoid creating fake
ast_channels on the stack to pass in matching data by directly accessing fields
(since "name" is a stringfield and the fake channel doesn't init the
stringfields, you can't use the ast_channel_name_set() function). I went with
ast_channel_name(chan) for a getter, and ast_channel_name_set(chan, name) for a
setter.

The majority of the grunt-work for this change was done by writing a semantic
patch using Coccinelle ( http://coccinelle.lip6.fr/ ).

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 22:15:50 +00:00
Richard Mudgett 64d1b247c4 Fix joinable thread terminating without joiner memory leak in chan_iax.c.
The iax2_process_thread() can exit without anyone waiting to join the
thread.  If noone is waiting to join the thread then a large memory leak
occurs.

* Made iax2_process_thread() deatach itself if nobody is waiting to join
the thread.

(closes issue ASTERISK-17339)
Reported by: Tzafrir Cohen
Patches:
      asterisk-1.8.4.4-chan_iax2-detach-thread-on-non-stop-exit.patch (license #5617) patch uploaded by Alex Villacis Lasso (modified)

(closes issue ASTERISK-17825)
Reported by: wangjin
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350222 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 21:56:29 +00:00
Terry Wilson b35a3a5c4a Don't leak CID in From header when presentation=unavailable
When someone does Set(CALLERPRES()=unavailable) (or
Set(CALLERID(pres)=unavailable)) when sendrpid=no, the From header shows
"Anonymous" <anonymous@anonymous.invalid>. When sendrpid=yes/pai, the From
header will still display the callerid info, even though we supply an rpid
header with the anonymous info. It seems like we shouldn't leak that info in
any case. Skimming http://tools.ietf.org/html/draft-ietf-sip-privacy-04 seems
to indicate that one shouldn't send identifying info in the From in this case.

This patch anonymizes the From header as well even when sendrpid=yes/pai.

(closes issue ASTERISK-16538)

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349978 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-06 23:31:25 +00:00
Richard Mudgett 963d52f63e Fix segfault in chan_dahdi for CHANNEL(dahdi_span) evaluation on hangup.
* Added NULL private pointer checks in the following chan_dahdi channel
callbacks: dahdi_func_read(), dahdi_func_write(), dahdi_setoption(), and
dahdi_queryoption().

(closes issue ASTERISK-19142)
Reported by: Diego Aguirre
Tested by: rmudgett
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349560 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-04 20:55:59 +00:00
Jonathan Rose dd3f9b51c8 Adds Subscription-State header to notify with call completion. per RFC3265
(Closes issue ASTERISK-17953)
Reported by: George Konopacki
Patches:
	19400.patch uploaded by mmichelson (license 5049)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349503 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-04 19:53:49 +00:00
Russell Bryant 1a8b769fdc Fix some minor formatting issues based on coding guidelines.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-31 15:48:09 +00:00
Russell Bryant 2b2d34b3c9 Constify tag argument in REF_DEBUG related code.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-31 15:45:57 +00:00
Jonathan Rose 19a4928fee INFO/Record request configurable to use dynamic features
Adds two new options to SIP peers allowing them to specify features (dynamic or builtin)
to use when sending INFO/record requests. Recordonfeature activates whatever feature
is specified when recieving a record: on request while recordofffeature activates
whatever feature is specified when receiving a record: off request. Both of these
features can be disabled by setting the feature to an empty string.

(closes issue ASTERISK-16507)
Reported by: Jon Bright
Review: https://reviewboard.asterisk.org/r/1634/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-23 20:42:21 +00:00
Jonathan Rose 03596bcb47 chan_sip autocreatepeer=persist option for auto-created peers to survive reload
This patch moves destruction of sip peers to immediately after the general section of
sip.conf is read so that autocreatepeer setting can be read before deletion of peers.
If autocreatepeer=persist at reload, then peers created by the autocreatepeer setting
will be skipped when purging the current SIP peer list.

(closes ASTERISK-16508)
Reported by: Kirill Katsnelson
Patches:
	017797-kkm-persist-autopeers-1.8.patch uploaded by Kirill Katsnelson (license 5845)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349097 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-23 20:19:33 +00:00
Richard Mudgett 32e35e5fcd Fix extension state callback references in chan_sip.
Chan_sip gives a dialog reference to the extension state callback and
assumes that when ast_extension_state_del() returns, the callback cannot
happen anymore.  Chan_sip then reduces the dialog reference count
associated with the callback.  Recent changes (ASTERISK-17760) have
resulted in the potential for the callback to happen after
ast_extension_state_del() has returned.  For chan_sip, this could be very
bad because the dialog pointer could have already been destroyed.

* Added ast_extension_state_add_destroy() so chan_sip can account for the
sip_pvt reference given to the extension state callback when the extension
state callback is deleted.

* Fix pbx.c awkward statecbs handling in ast_extension_state_add_destroy()
and handle_statechange() now that the struct ast_state_cb has a destructor
to call.

* Ensure that ast_extension_state_add_destroy() will never return -1 or 0
for a successful registration.

* Fixed pbx.c statecbs_cmp() to compare the correct information.  The
passed in value to compare is a change_cb function pointer not an object
pointer.

* Make pbx.c ast_merge_contexts_and_delete() not perform callbacks with
AST_EXTENSION_REMOVED with locks held.  Chan_sip is notorious for
deadlocking when those locks are held during the callback.

* Removed unused lock declaration for the pbx.c store_hints list.

(closes issue ASTERISK-18844)
Reported by: rmudgett

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-23 02:35:13 +00:00
Damien Wedhorn 48f9a8f668 Fix segfault on answer.
Only update/change RTP source if RTP has already been started and 
connected to the subchannel.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-22 21:12:57 +00:00
Richard Mudgett e58d4e4093 Fix chan_iax2 to not report an RDNIS number if it is blank.
Some ISDN switches complain or block the call if the RDNIS number is
empty.

* Made chan_iax2 not save a RDNIS number into the ast_channel if the
string is blank.  This is what other channel drivers do.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348737 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-20 23:11:29 +00:00
Stefan Schmidt 7d1c55d093 Fix possible misshandling of an incoming SIP response as a peer poke response.
Also make sure peer has even qualify enabled when handle a peer poke response.

(closes issue ASTERISK-18940)
Reported by: Vitaliy
Tested by: Vitaliy and UnixDev

Review: https://reviewboard.asterisk.org/r/1620
Reviewed by: David Vossel
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-13 15:22:48 +00:00
Walter Doekes 463bfdb400 Fix regression when using tcpenable=no and tlsenable=yes.
The tlsenable settings are tucked away in main/tcptls.c, so I missed
them when resolving ASTERISK-18837. This should resolve the test suite
breakage of the sip tls tests.

Review: https://reviewboard.asterisk.org/r/1615
Reviewed by: Matt Jordan
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-08 21:32:36 +00:00
Terry Wilson e279b30f5a Don't crash on INFO automon request with no channel
AST-2011-014. When automon was enabled in features.conf, it was possible
to crash Asterisk by sending an INFO request if no channel had been
created yet.

(closes issue ASTERISK-18805)
........

Merged revisions 347530 from http://svn.asterisk.org/svn/asterisk/branches/1.6.2
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347533 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-08 16:24:29 +00:00
Damien Wedhorn 5952117559 Fix segfault on answer.
Fix a segfault if an attempt to answer a call is made between when
the inbound call gives up (and the channel is removed) and when the
device is notified and removes the call from the device.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347490 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-08 06:59:01 +00:00
Richard Mudgett 7e634c21f8 Make SIP INFO messages for dtmf-relay signals case insensitive.
(closes issue ASTERISK-18924)
Reported by: Kevin Taylor
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-06 23:58:44 +00:00
Walter Doekes e14f572132 Don't allow transport=tcp when tcpenable=no.
When tcpenable=no, sending to transport=tcp hosts was still allowed.
Resolving the source address wasn't possible and yielded the string
"(null)" in SIP messages. Fixed that and a couple of not-so-correct
log messages.

(closes issue ASTERISK-18837)
Reported by: Andreas Topp

Review: https://reviewboard.asterisk.org/r/1585
Reviewed by: Matt Jordan
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347168 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-06 19:44:27 +00:00
Matthew Jordan b8dba87a4c Fixed crash from orphaned MWI subscriptions in chan_sip
This patch resolves the issue where MWI subscriptions are orphaned
by subsequent SIP SUBSCRIBE messages.  When a peer is removed, either
by pruning realtime SIP peers or by unloading / loading chan_sip, the
MWI subscriptions that were orphaned would still be on the event engine
list of valid subscriptions but have a pointer to a peer that no longer
was valid.  When an MWI event would occur, this would cause a seg fault.

(closes issue ASTERISK-18663)
Reported by: Ross Beer
Tested by: Ross Beer, Matt Jordan
Patches:
  blf_mwi_diff_12_06_11.txt uploaded by Matt Jordan (license 6283)

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-06 17:34:35 +00:00
Richard Mudgett 938b642245 Restore call progress code for analog ports.
Extracting sig_analog from chan_dahdi lost call progress detection
functionality.

* Fix analog ports from considering a call answered immediately after
dialing has completed if the callprogress option is enabled.

(closes issue ASTERISK-18841)
Reported by: Richard Miller
Patches:
      chan_dahdi.diff (license #5685) patch uploaded by Richard Miller (Modified by me)
      sig_analog.c.diff (license #5685) patch uploaded by Richard Miller (Modified by me)
      sig_analog.h.diff (license #5685) patch uploaded by Richard Miller
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347008 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-05 17:44:15 +00:00
Walter Doekes 6209c5a894 For SIP REGISTER fix domain-only URIs and domain ACL bypass.
The code that allowed admins to create users with domain-only uri's had
stopped to work in 1.8 because of the reqresp parser rewrites. This is
fixed now: if you have a [mydomain.com] sip user, you can register with
useraddr sip:mydomain.com. Note that in that case -- if you're using
domain ACLs (a configured domain list) -- mydomain.com must be in the
allow list as well.

Reviewboard r1606 shows a list of registration combinations and which
SIP response codes are returned.

Review: https://reviewboard.asterisk.org/r/1533/
Reviewed by: Terry Wilson

(closes issue ASTERISK-18389)
(closes issue ASTERISK-18741)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346901 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-04 10:08:19 +00:00
Matthew Jordan fa4a7dcc45 Update SIP MESSAGE To parsing to correctly handle URI
The previous patch (r346040) incorrectly parsed the URI in the presence
of a port, e.g., user@hostname:port would fail as the port would be
double appended to the SIP message.  This patch uses the parse_uri function
to correctly parse the URI into its username and hostname parts, and places
them in the correct fields in the sip_pvt structure.

(issue ASTERISK-18903)
Review: https://reviewboard.asterisk.org/r/1597/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-02 23:30:21 +00:00
Alexandr Anikin db0ed2e5c8 Merged revisions 346763 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r346763 | may | 2011-12-02 20:42:32 +0400 (Fri, 02 Dec 2011) | 14 lines
  
  Merged revisions 346762 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r346762 | may | 2011-12-02 20:19:19 +0400 (Fri, 02 Dec 2011) | 7 lines
    
    process null frame pointer returned by ast_rtp_instance_read correctly
    
    (closes issue ASTERISK-16697)
    Reported by: under
    Patches: 
            segfault.diff (License #5871) patch uploaded by under
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346777 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-02 18:03:31 +00:00
Jonathan Rose 39424ebad2 Change 183 Ringing in sipfrag body to 180 ringing. 183 Ringing isn't even a thing.
183 is actually a session progress message.

(closes issue ASTERISK-18925)
Reported by: Sebastian Denz
Tested by: jrose
Patches:
	asterisk18-use_180_instead_of_183_in_sipfrag.diff by Sebastian Denz (License #6139)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346699 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-01 20:46:12 +00:00
Tilghman Lesher 56b21b4683 Remove the few places where we try to ast_verbose() without a newline.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-30 23:38:34 +00:00
Jonathan Rose 9ef171ffe0 r346525 | jrose | 2011-11-30 15:10:38 -0600 (Wed, 30 Nov 2011) | 18 lines
Cleaning up chan_sip/tcptls file descriptor closing.

This patch attempts to eliminate various possible instances of undefined behavior caused
by invoking close/fclose in situations where fclose may have already been issued on a
tcptls_session_instance and/or closing file descriptors that don't have a valid index
for fd (-1). Thanks for more than a little help from wdoekes.

(closes issue ASTERISK-18700)
Reported by: Erik Wallin

(issue ASTERISK-18345)
Reported by: Stephane Cazelas

(issue ASTERISK-18342)
Reported by: Stephane Chazelas

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346566 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-30 22:03:02 +00:00
Jonathan Rose fb4c483eb7 Reverting 346525 due to accidental patch against trunk instead of 1.8
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346563 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-30 21:32:23 +00:00
Jonathan Rose 6fa827b5d0 Cleaning up chan_sip/tcptls file descriptor closing.
This patch attempts to eliminate various possible instances of undefined behavior caused
by invoking close/fclose in situations where fclose may have already been issued on a
tcptls_session_instance and/or closing file descriptors that don't have a valid index
for fd (-1). Thanks for more than a little help from wdoekes.

(closes issue ASTERISK-18700)
Reported by: Erik Wallin

(issue ASTERISK-18345)
Reported by: Stephane Cazelas

(issue ASTERISK-18342)
Reported by: Stephane Chazelas

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-30 21:10:38 +00:00
Tilghman Lesher 77b670c4ab Allow each logging destination and console to have its own notion of the verbosity level.
Review: https://reviewboard.asterisk.org/r/1599


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-29 18:43:16 +00:00
Richard Mudgett 7d9ba4875b Fix calls to ast_get_ip() not initializing the address family.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-23 23:03:32 +00:00
Walter Doekes 2ee874178e Minor cleanup in chan_sip get_msg_text() function.
In r116240, get_msg_text() got an extra parameter to fix the unwanted
addition of trailing newlines to SIP MESSAGE bodies. This caused all
linefeeds to be trimmed, which isn't right either. This is a stop-gap;
the right fix is to return the original SIP request body.

Review: https://reviewboard.asterisk.org/r/1586
Reviewed by: Matt Jordan
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346199 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-23 20:48:42 +00:00
Kinsey Moore e6ca768081 Fix res_jabber resource leaks
This should fix almost all resource leaks in res_jabber that involve
ASTOBJ_CONTAINER_FIND and resolves an ambiguous situation where
ast_aji_get_client would sometimes bump an object's refcount and sometimes not.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-23 17:16:33 +00:00
Matthew Jordan 76394a727f Fixed SendMessage stripping extension from To: header in SIP MESSAGE
When using the MessageSend application to send a SIP MESSAGE to a non-peer,
chan_sip attempted to validate the hostname or IP Address.  In the process,
it stripped off the extension and failed to add it back to the sip_pvt
structure before transmitting.  This patch adds the full URI passed in
from the message core to the sip_pvt structure.

(closes issue ASTERISK-18903)
Reported by: Shaun Clark
Tested by: Matt Jordan

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-23 16:23:34 +00:00
Terry Wilson 32d0faac9c Default to nat=yes; warn when nat in general and peer differ
It is possible to enumerate SIP usernames when the general and user/peer
nat settings differ in whether to respond to the port a request is sent
from or the port listed for responses in the Via header. In 1.4 and 1.6.2,
this would mean if one setting was nat=yes or nat=route and the other was
either nat=no or nat=never. In 1.8 and 10, this would mean when one was
nat=force_rport and the other was nat=no.

In order to address this problem, it was decided to switch the default
behavior to nat=yes/force_rport as it is the most commonly used option
and to strongly discourage setting nat per-peer/user when at all possible.

For more discussion of the issue, please see:
  http://lists.digium.com/pipermail/asterisk-dev/2011-November/052191.html

(closes issue ASTERISK-18862)
Review: https://reviewboard.asterisk.org/r/1591/
........

Merged revisions 345776 from http://svn.asterisk.org/svn/asterisk/branches/1.4
........

Merged revisions 345800 from http://svn.asterisk.org/svn/asterisk/branches/1.6.2
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@345831 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-21 21:09:59 +00:00
Richard Mudgett 4a125f45a0 Remove dead code since pri_grab() can never fail.
Dead code makes programmers sick.  I am sick of looking at it.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@345559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-17 17:31:16 +00:00
Richard Mudgett bd4f81b51f Fix typo in sig_pri using wrong structure name.
It is fortunate that the typo does not alter generated code since the
e->restart.channel and e->ring.channel members are in the same position.

(closes issue ASTERISK-18868)
Reported by: zvision
Patches:
      sig_pri.c.diff (License #5755) patch uploaded by zvision
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@345375 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-15 18:18:11 +00:00
Richard Mudgett 113612b9d6 Restore SIP DTMF overlap dialing method.
The recent fix for ASTERISK-17288 to get RFC3578 SIP overlap support
working correctly removed a long standing ability to do overlap dialing
using DTMF in the early media phase of a call.

See ASTERISK-18702 it has a very good description of the issue.

I started with Pavel Troller's chan_sip.diff patch on issue
ASTERISK-18702.

* Added 'dtmf' enum value to sip.conf allowoverlap config option.  The new
option value causes the Incomplte application to not send anything with
chan_sip so the caller can supply more digits via DTMF.

* Renames SIP_GET_DEST_PICKUP_EXTEN_FOUND to SIP_GET_DEST_EXTEN_MATCHMORE
since that is what it really means.

* Fixed get_destination() inconsistency with the pickup extension
matching.

* Fixed initialization of PAGE3 of global_flags in reload_config().

(closes issue ASTERISK-18702)
Reported by: Pavel Troller

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@345276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-14 22:05:39 +00:00
Walter Doekes 6ef49c3214 Update reqresp_parser parse_uri doxygen comments.
The issue mentioned in the bug report had been fixed recently by
twilson. The reporter included this documentation fix.

(closes issue ASTERISK-18572)
Reported by: Richard Miller
Patch by: Richard Miller (modified)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@345162 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-14 19:03:29 +00:00
Kinsey Moore 818ac23b92 Ensure that a null vmexten does not cause a segfault
When sip_send_mwi_to_peer was modified recently to avoid deadlocks, vmexten
was not expected to be null.  This change handles that situation to avoid
a segfault.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@345065 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-14 15:11:09 +00:00
Gregory Nietsky 3845299e46 mISDN Round Robin break when no channel is available
Prevent channels been parsed repetitively.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@344979 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-12 16:32:45 +00:00
Walter Doekes 863d7189b9 Remove unneeded if(params) checks in reqresp_parser.
Nick Lewis added them in https://reviewboard.asterisk.org/r/549/diff/1-2/
for no apparent reason. There is no way that params could become NULL in
that piece of code, so I removed these excess checks again.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@344840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-11 21:37:53 +00:00
Kinsey Moore a4365a8ae2 Fix regression introduced by SDP fixups
If capability is adjusted when switching to UDPTL during fax transmission, fax
teardown fails.  Make sure capability is only touched if RTP is active.  This
regression was introduced in R344385.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@344771 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-11 20:15:16 +00:00
Richard Mudgett e48cecc848 Check sip.conf maxforwards parameter for range 1 <= x <= 255.
JIRA AST-710
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@344717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-11 18:37:32 +00:00
Kinsey Moore c225800646 Fix several bugs with SDP parsing and well-formedness of responses
Fix bug ASTERISK-16558 which dealt with the order of responses to incoming
streams defined by SDP.

Fix unreported bug where offering multiple same-type streams would cause
Asterisk to reply with an incorrect SDP response missing one or more streams
without a proper declination.

Fix bugs related to a single non-audio stream being offered with responses
requesting codecs that were not offered in the initial invite along with an
additional audio stream that was not in the initial invite.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@344387 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-10 18:15:02 +00:00
Richard Mudgett 6d481420ce Fix deadlock during dialplan reload.
Another deadlock between the conlock/hints and channels/channel locking
orders.

* Don't hold the channel and private lock in sip_new() when calling
ast_exists_extension().

(closes issue ASTERISK-18740)
Reported by: Byron Clark
Patches:
      sip_exists_exten_dlock_3.diff (license #5041) patch uploaded by Gregory Hinton Nietsky
      ASTERISK-18740.patch (license #6157) patch uploaded by Byron Clark
Tested by: Byron Clark
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@344272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-09 20:55:43 +00:00
Terry Wilson 04f04ff39d Don't treat a host:port string as a domain
The domain matching code prior to 1.8 used to manually remove the port
from the host:port string when determining if an incoming request
matched the list of domains. When switching to the new parsing
functions, the documentation implied that the "domain" was being
returned by these functions, when instead it was returning the
"hostport" as defined by RFC 3261. This led to confusion and resulted
in 1.8+ rejecting an incoming request from x.x.x.x:xxxxx when
domain=x.x.x.x was set in sip.conf.

This patch renames the "domain" variables in the parsing functions to
"hostport" to more accurately describe what it is that they are
returning and also properly truncates the resulting hostport strings
when dealing with domain matching.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@344217 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-09 20:10:52 +00:00
Richard Mudgett 9537f22c54 Residual changes for Asterisk v10 branch from ASTERISK-18747.
Residual changes for Asterisk v10 branch from ASTERISK-18747 after
https://reviewboard.asterisk.org/r/1564/ commit and associated dialogs
callid hash key change fix.

* Make check_rtp_timeout() return CMP_MATCH if need to delete dialog from
dialogs_rtpcheck.  This is an optimization to avoid an unneeded
lock/unlock and object search when using ao2_unlink.

* Prevent crash in check_rtp_timeout() if dialog->rtp is NULL.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@344005 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-08 22:14:38 +00:00
David Vossel 5cb719acec Merged revisions 343900 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

........
  r343900 | dvossel | 2011-11-08 12:29:33 -0600 (Tue, 08 Nov 2011) | 11 lines
  
  Fixes regression caused by r343635
  
  There was a missing unlock for a function return that is only
  present in Asterisk 10 and Asterisk Trunk.
  
  (closes issue ASTERISK-18839)
  Reported by: Michael L. Young
  Patches:
      asterisk-18839-missing-lock-trunk-v2.diff (License #5026) patch uploaded by Michael L. Young
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@343905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-08 18:35:19 +00:00
Richard Mudgett cee432c9d8 Fixed reference to incorrect variable if unknown host configured crash.
* Fixed a LOG_ERROR message referencing the config variable list v that
had previously been processed and became NULL.

* Added error return value set that was missing in an ast_append_ha()
error return path.

(closes issue ASTERISK-18743)
Reported by: Michele
Patches:
      issueA18743-fix_dynamic_exclude_static_bad_host_log.patch (license #5674) patch uploaded by Walter Doekes
Tested by: Michele
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@343853 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-08 18:02:51 +00:00
Kinsey Moore 5249a147b8 Make "sip show settings" CLI command get RPID flags from the right global page
The "Trust RPID" and "Send RPID" entries in the "sip show settings" CLI command
pulled the flags from the incorrect global flags page.  These are now read from
sip global flags page 0.

(closes issue AST-711)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@343744 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-07 22:37:51 +00:00
Matthew Nicholson 2b6ebcb9e9 respect case changes in peer names on sip reload
ASTERISK-18669
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@343692 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-07 21:44:05 +00:00
Richard Mudgett 98e494d4a0 Fix __sip_subscribe_mwi_do() incorectly changing dialogs hash key callid.
Changing an object value used as a container key requires removing the
object from the container and reinserting it.

* Created change_callid_pvt() to call instead of build_callid_pvt().  The
change_callid_pvt() will correctly change the dialog callid so the ao2
conainter can explicitly unlink it.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@343684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-07 21:29:01 +00:00
Kinsey Moore 1c526d3d7d Prevent BLF subscriptions from causing deadlocks
Fix a locking inversion in sip_send_mwi_to_peer that was causing deadlocks.
This function now requires that both the peer and associated pvt be unlocked
before it is called for cases where peer and peer->mwipvt form a circular
reference.

(closes issue ASTERISK-18663)
Review: https://reviewboard.asterisk.org/r/1563/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@343636 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-07 20:35:58 +00:00
Richard Mudgett 7a5f6684f0 Fix deadlock if peer is destroyed while sending MWI notice.
A dialog cannot be destroyed by the ao2_callback dialog_needdestroy
because of a deadlock between the dialogs container lock and the RWLOCK of
the events subscription list.

* Create dialogs_to_destroy container to hold dialogs that will be
destroyed.

* Ensure that the event subscription callback will never happen with an
invalid peer pointer by making the event callback removal the first thing
in the peer destructor callback.

NOTE: This particular deadlock will not happen with Asterisk 10, but some
of the changes still apply.

(closes issue ASTERISK-18747)
Reported by: Gregory Hinton Nietsky

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@343579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-07 19:54:09 +00:00