Commit Graph

91 Commits

Author SHA1 Message Date
Matthew Jordan
6f63555e9e Multiple revisions 369436,369557,369579,369626,369652,372628 for 1.8.11-cert8
........
  r369436 | twilson | 2012-06-27 15:58:51 -0500 (Wed, 27 Jun 2012) | 17 lines
  
  AST-2012-010: Clean up after a reinvite that never gets a final response
  
  The basic problem is that if a re-INVITE is sent by Asterisk and it receives a
  provisional response, but no final response, then the dialog is never torn
  down. In addition to leaking memory, this also leaks file descriptors and will
  eventually lead to Asterisk no longer being able to process calls.
  
  This patch just keeps track of whether there is an outstanding re-INVITE, and if
  there is goes ahead and cleans up everything as though there was no outstanding
  reinvite.
  
  Review: https://reviewboard.asterisk.org/r/2009/
  
  (closes issue ASTERISK-19992)
  Reported by: Steve Davies
  Tested by: Steve Davies, Terry Wilson
........
  r369557 | twilson | 2012-07-03 09:27:02 -0500 (Tue, 03 Jul 2012) | 11 lines
  
  Better handle re-INVITEs with provisional but no final repsonses
  
  A previous attempt at fixing this issue had negative side effects related
  to attended transfers which this patch should resolve. Many thanks to
  Steve Davies for all of the good suggestions and testing.
  
  (closes issue ASTERISK-19992)
  Reported by: Steve Davies
  Tested by: Steve Davies, Terry Wilson
  Review: https://reviewboard.asterisk.org/r/2009/
........
  r369579 | twilson | 2012-07-03 11:58:16 -0500 (Tue, 03 Jul 2012) | 8 lines
  
  More improvements to re-INVITEs timing out after a provisional response
  
  There is no need to call check_pendings() on a final response to an INVITE
  when destroying the scheduler entry as it will be done later during normal
  processing.
  
  (issue ASTERISK-19992)
........
  r369626 | mjordan | 2012-07-05 12:01:52 -0500 (Thu, 05 Jul 2012) | 16 lines
  
  Do not send a BYE when a provisional response arrives during a re-INVITE
  
  Commits r369557 and r369579 were done to improve handling of re-INVITEs
  when the UA that was supposed to receive the re-INVITE fails to respond.
  A limitation of those patches occurred when a UA sent a provisional
  response to the re-INVITE.  This triggered a sending of a BYE in
  check_pending.  This patch tweaks the handling of the re-INVITE such that
  a BYE is not sent in response to those messages.
  
  (issue ASTERISK-19992)
  Reported by: Steve Davies
  Tested by: Steve Davies
  patches:
    (reinvite_tweak.diff license #5012 by Steve Davies)
........
  r369652 | kmoore | 2012-07-05 14:01:52 -0500 (Thu, 05 Jul 2012) | 22 lines
  
  AST-2012-011: Resolve heap corruption issue with voicemail
  
  The heard and deleted arrays in the voicemail state structure were not
  handled properly following the memory leak fix in r354890 and a fix for
  an invalid free in r356797.  This could result in accessing and writing
  into freed memory.  The allocation for these arrays has been reworked
  to avoid the possibility of invalid frees, access of freed memory, and
  crashes that were occurring as a result of this.
  
  Locking around accesses and modifications of the voicemail state
  structure members dh_arraysize, heard, and deleted has been added to
  prevent simultaneous modification and access when IMAP storage is in
  use.  If IMAP storage is not in use, this locking is not compiled in.
  
  Review: https://reviewboard.asterisk.org/r/1994/
  (closes issue ASTERISK-19923)
  Reported by: Dan Delaney
  Tested by: Dan Delaney, Julian Yap
  Patches:
    vm_alloc_fix.diff uploaded by kmoore (license 6273)
........
  r372628 | rmudgett | 2012-09-07 17:06:29 -0500 (Fri, 07 Sep 2012) | 5 lines
  
  Remove annoying unconditional debug message from INC/DEC functions.
  
  (closes issue AST-1001)
  Reported by: Guenther Kelleter
........

Merged revisions 369436,369557,369579,369626,369652,372628 from http://svn.asterisk.org/svn/asterisk/branches/1.8


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

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@375024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-15 14:11:46 +00:00
Matthew Jordan
3afd7feda3 Merge patches for 1.8.11-cert6
This includes the following
 * r369351 for AST-883
 * r368807 for AST-884
 * r356604, r356650, r364203 for AST-890
 * r370618 for AST-896
 * r370205, r370273, r370360 for AST-916
 * r371469 for AST-932



git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@371651 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-24 13:55:18 +00:00
Mark Michelson
7b0ada11d4 Fix error in the "IPorHost" section of a SIP dialstring.
This is based on the review request posted by Walter Doekes
(referenced lower in the commit message)

The main fix here is to treat the IPorHost portion of the dial
string as a temporary outbound proxy. This ensures requests
get sent to the proper location.

Due to the age of the request, some parts were no longer relevant.
For instance, the request moved outbound proxy parsing code into
a single method. This is done in a previous commit, so it was not
necessary to do again.

Also, the review request fixed some errors with regards to request
routing for CANCEL and ACK requests. This has also been fixed in
more recent commits.

(closes issue ASTERISK-19677)
reported by Walter Doekes

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@370843 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-07 15:40:46 +00:00
Jason Parker
f9834fd128 Add support for Digium Phones.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@357459 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-28 21:52:48 +00:00
Richard Mudgett
534213a074 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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@356677 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24 18:23:28 +00:00
Matthew Jordan
032962f1a2 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)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@356604 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24 15:07:09 +00:00
Alec L Davis
8fc0050b54 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/branches/1.8@353320 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:57:49 +00:00
Alec L Davis
4d2f8a9cfd 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/branches/1.8@352862 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-27 00:05:30 +00:00
Richard Mudgett
f3c3de4c71 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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@351618 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-19 23:17:31 +00:00
Mark Michelson
f7876c1dfe Set port to a default sane value if a bogus one is provided when parsing hostnames.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-13 20:29:03 +00:00
Matthew Jordan
7c0ead6cb8 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/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@347058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-06 17:05:05 +00:00
Richard Mudgett
f435f45c50 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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@345273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-14 21:43:39 +00:00
Walter Doekes
f1762a4633 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)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@345160 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-14 19:00:28 +00:00
Walter Doekes
0b3270601a 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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@344837 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-11 21:33:13 +00:00
Kinsey Moore
47cff21b6d 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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@344385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-10 18:12:43 +00:00
Terry Wilson
a2a11ee737 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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@344215 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-09 19:57:04 +00:00
Terry Wilson
702726c917 Make room for the fax detect flags
The original REGISTERTRYING flag, in addition to being impossible to
check, also encroached on the space for the flag above it. This
patch moves the flags that were below REGISTERTRYING back to where
they were as though we had just removed the REGISTERTRYING option.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@343276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-03 15:33:37 +00:00
Terry Wilson
5844133aba Remove registertrying option in chan_sip
This option is not only useless, but has been broken since inception since
the flag was never copied from the peer where it is set to the pvt where
it was checked. RFC 3261 specificially states that you should not send a
provisional response to a non-INVITE request, and if we did fix the code
so that it worked, it would cause the same kind of user enumeration
vulnerability that we've discussed with the nat= setting. This patch
removes registertrying option and any code that would have sent a 100
response to a register.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@343220 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-02 22:59:36 +00:00
Richard Mudgett
f2b371fedf More parking issues.
* Fix potential deadlocks in SIP and IAX blind transfer to parking.

* Fix SIP, IAX, DAHDI analog, and MGCP channel drivers to respect the
parkext_exclusive option with transfers (Park(,,,,,exclusive_lot)
parameter).  Created ast_park_call_exten() and ast_masq_park_call_exten()
to maintian API compatibility.

* Made masq_park_call() handle a failed ast_channel_masquerade() setup.

* Reduced excessive struct parkeduser.peername[] size.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@341254 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-18 21:03:04 +00:00
Richard Mudgett
a458ac621e Fix some potential deadlocks pointed out by helgrind.
* Fixed deadlock potential calling dialog_unlink_all() in
__sip_autodestruct().  Found by helgrind.

* Fixed deadlock potential in handle_request_invite() after calling
sip_new().  Found by helgrind.

* The sip_new() function now returns with the created channel already
locked.

* Removed the dead code that starts a PBX in in sip_new().  No sip_new()
callers caused that code to be executed and it was a bad thing to do
anyway.

* Removed unused parameters and return value from dialog_unlink_all().

* Made dialog_unlink_all() and __sip_autodestruct() safely obtain the
owner and private channel locks without a deadlock avoidance loop.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@340284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-11 19:16:47 +00:00
Gregory Nietsky
e7d6d7ee19 The rtptimeout setting is ignored on a per peer basis.
Not only is the rtptimeout ignored in some cases but 
rtpkeepalive and rtpholdtimeout is affected.

this commit also removes rtptimeout/rtpholdtimeout on
text rtp.

(closes issue ASTERISK-18559)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@338416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-29 12:13:05 +00:00
Matthew Nicholson
c9325708c8 default 'sipstorecause' to no
We've decided to disable this feature by default in future 1.8 versions.  This
would be an unexpected behavior change for anyone depending on that SIP_CAUSE
update in their dialplan.

Please refer to the asterisk-dev mailing list more information:
http://lists.digium.com/pipermail/asterisk-dev/2011-August/050626.html

(issue AST-580)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@333009 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-23 18:11:50 +00:00
Matthew Nicholson
3d709a2b55 use DEFAULT_STORE_SIP_CAUSE to set the default value for the 'storesipcause' option
AST-580


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@332026 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-16 15:06:31 +00:00
Richard Mudgett
48e78804e2 Used auth= parameter freed during "sip reload" causes crash.
If you use the auth= parameter and do a "sip reload" while there is an
ongoing call.  The peer->auth data points to free'd memory.

The patch does several things:

1) Puts the authentication list into an ao2 object for reference counting
to fix the reported crash during a SIP reload.

2) Converts the authentication list from open coding to AST list macros.

3) Adds display of the global authentication list in "sip show settings".

(closes issue ASTERISK-17939)
Reported by: wdoekes
Patches:
      jira_asterisk_17939_v1.8.patch (license #5621) patch uploaded by rmudgett

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

JIRA SWP-3526


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@326291 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-05 17:22:59 +00:00
Kinsey Moore
484a8a8363 chan_sip: cleanup from the introduction of ast_str
Remove the length field from sip_req and sip_pkt in chan_sip since they are
redundant (ast_str holds its own length) and refactor the necessary functions.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@325740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-29 21:49:21 +00:00
David Vossel
5a8af0d613 Fixes sip crash when calling remove_uri_parameters with NULL
AST-2011-009

(closes issue ASTERISK-18017)
Reported by: jaredmauch



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@324685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-23 18:31:00 +00:00
Jonathan Rose
a99d9c7770 markm committed a patch I was working on yesterday, this fixes it to mesh up with suggestions by mnicholson.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@321273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-27 14:59:34 +00:00
Mark Murawki
a35ebe0f61 Fixed build problem with dev mode enabled, which was caused by commit 321100. Reformulated patch to be more generic.
Moved the sip uri parse variable initalization to parse_uri_full in reqresp_parser.c.  This will ensure that any use of parse uri will have null output variables if the parse fails.

(closes issue #19346)
Reported by: kobaz
Tested by: kobaz,JonathanRose

Review: [full review board URL with trailing slash]


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@321155 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-26 21:48:45 +00:00
Jonathan Rose
b3a2f27111 Adds legacy_useroption_parsing to address interoperability concerns.
With the new option engaged, Asterisk should interpret user fields with useroptions
contained within the userfield of the uri by stripping them out of the original message
whenever a semicolon is encountered in the userfield string.

(closes issue #18344)
Reported by: danimal
Tested by: jrose

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@319938 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-20 13:28:24 +00:00
Matthew Nicholson
1b1961f73f Handle ipv6 addresses in the sent-by Via: field.
This change fixes a regression in via header parsing and ipv6 handling.

(closes issue #18951)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@318720 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-12 23:35:51 +00:00
Russell Bryant
1ccfa50ba8 Fix more "set but unused" warnings.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@317474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-05 22:36:33 +00:00
Matthew Nicholson
e8210addf8 Merged revisions 315893 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r315893 | mnicholson | 2011-04-27 14:03:05 -0500 (Wed, 27 Apr 2011) | 21 lines
  
  Merged revisions 315891 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r315891 | mnicholson | 2011-04-27 13:57:56 -0500 (Wed, 27 Apr 2011) | 14 lines
    
    Fix our compliance with RFC 3261 section 18.2.2.
    
    This change optimizes the free_via() function and removes some redundant null
    checking. It also fixes compliance with RFC 3261 section 18.2.2 by always using
    the port specified in the Via header for routing responses (even when maddr is
    not set). Also the htons() function is now used when setting the port.
    Additional documentation comments have been added in various places to make the
    logic in the code clearer.
    
    (closes issue #18951)
    Reported by: jmls
    Patches:
          issue18951_set_proper_port_from_via.patch uploaded by wdoekes (license 717) (modified)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@315894 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-27 19:14:27 +00:00
Matthew Nicholson
4468fe047e Merged revisions 314620 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r314620 | mnicholson | 2011-04-21 13:22:19 -0500 (Thu, 21 Apr 2011) | 20 lines
  
  Merged revisions 314607 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r314607 | mnicholson | 2011-04-21 13:19:21 -0500 (Thu, 21 Apr 2011) | 14 lines
    
    Added limits to the number of unauthenticated sessions TCP based protocols are allowed to have open simultaneously.  Also added timeouts for unauthenticated sessions where it made sense to do so.
    
    Unrelated, the manager interface now properly checks if the user has the "system" privilege before executing shell commands via the Originate action. 
    
    AST-2011-005
    AST-2011-006
    
    (closes issue #18787)
    Reported by: kobaz
    
    (related to issue #18996)
    Reported by: tzafrir
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@314628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-21 18:24:05 +00:00
Brett Bryant
a54ab29087 Fix a possible crash in sip/reqresp_parser.c that is caused by a possible null
value.

(closes issue #18821)
Reported by: cmaj
Patches: 
      patch-reqresp_parser_sip_uri_domain_cmp_c_locale-crash-1.8.3-rc2.diff.tx
      uploaded by cmaj (license 830)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@311612 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-23 21:45:46 +00:00
Terry Wilson
2f95620a2f Don't use static declared buf in parse_name_andor_addr
This function isn't used anywhere yet, but we definitely don't want
to keep the same value for buf between calls to the function.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@311558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-23 02:24:53 +00:00
Jonathan Rose
ed3e04e831 Returns with an error notice if CHANNEL function of SIP channel is read without arguments.
(Closes issue #18653)
Reported by: wuwu
Patches:
      diff.patch uploaded by jrose (license 1225)
Tested by: jrose



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@310088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-08 20:19:32 +00:00
Matthew Nicholson
15b9d1ac10 Merged revisions 304244 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r304244 | mnicholson | 2011-01-26 14:42:16 -0600 (Wed, 26 Jan 2011) | 13 lines
  
  Merged revisions 304241 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r304241 | mnicholson | 2011-01-26 14:38:22 -0600 (Wed, 26 Jan 2011) | 6 lines
    
    This patch modifies chan_sip to route responses to the address the request came from.  It also modifies chan_sip to respect the maddr parameter in the Via header.
    
    ABE-2664
    
    Review: https://reviewboard.asterisk.org/r/1059/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@304245 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-26 20:43:27 +00:00
Jeff Peeler
c9bfde6afd Add parking extension for non-default parking lots.
This is a new feature that allows for parking to custom parking lots to be
accessed directly, rather than with channel variables or by changing the
default parking lot. The extension is set with the parkext option just as the
default parking lot is done. Also, the manager action has been updated to
optionally allow a specified parking lot.

(closes issue #14882)
Reported by: vmikhnevych
Patches: 
      patch_14882.txt uploaded by mnick (license 874)
      modified by me

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@286931 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-15 19:22:15 +00:00
David Vossel
4c42713010 Disables auth_options_request option by default.
The auth_options_request option was created to do authentication
on OPTIONS request just like INVITES are done.  Since it has been
noted that some endpoints use OPTIONS requests as a way of qualifying
a peer and that a 401 authentication response could result in
interoperability issues, this option has been disabled by default.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@285006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-03 22:21:50 +00:00
David Vossel
125f089394 authenticate OPTIONS requests just like we would an INVITE
OPTIONS requests should be treated the same as an INVITE
This includes authentication.  This patch adds the ability for
incoming out of dialog OPTION requests to be authenticated
before providing a response indicating whether an extension
is available or not.  The authentication routine works the
exact same way as it does for incoming INVITEs.  This means
that if a peer has 'insecure=invite' in their peer definition,
the same will be true for the processing of the OPTIONS request.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@284950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-03 17:29:02 +00:00
David Vossel
8ae2b6a612 Merged revisions 283558 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r283558 | dvossel | 2010-08-25 10:52:54 -0500 (Wed, 25 Aug 2010) | 10 lines
  
  Asterisk will not advertise session timers are supported when 'session-timers=refuse' is used.
  
  Asterisk now dynamically builds the "Supported" header depending
  on what is enabled/disabled in sip.conf.  Session timers used
  to always be advertised as being supported even when they were disabled
  in the configuration.  This caused problems with some end points.
  
  (issue #17005)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@283559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-25 15:54:11 +00:00
David Vossel
2787a14001 Changes the default behavior for sip.conf's pedantic option from "no" to "yes".
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@283493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-24 20:34:03 +00:00
5c1c1b35bd Fix parsing of IPv6 address literals in outboundproxy
(closes issue #17757)
Reported by: oej
Patches:
      17757.diff uploaded by sperreault (license 252)
      sip.conf.diff uploaded by sperreault (license 252)
Tested by: oej


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@281687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-11 13:30:59 +00:00
Russell Bryant
7011a94fc0 Change the default value for alwaysauthreject in sip.conf to "yes".
(closes issue #17756)
Reported by: oej


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@281650 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-10 21:47:31 +00:00
Jeff Peeler
50f2b57276 Give test category missing leading slash
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@280269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-28 20:49:26 +00:00
David Vossel
610151af27 transaction matching using top most Via header
This patch modifies the way chan_sip.c does transaction to dialog
matching.  Asterisk now stores information in the top most Via header
of the initial incoming request and compares that against other Requests
that have the same call-id.  This results in Asterisk being able to
detect a forked call in which it has received multiple legs of the
fork.  I completely stripped out the previous matching code and made
the comparisons a little more explicit and easier to understand.  My
comments in the code should offer all the details involving this patch.  

This patch also fixes a bug with the usage of the OBJ-MULTIPLE flag to
find multiple dialogs with the same call-id.  Since the callback
function was returning (CMP_MATCH | CMP_STOP) only the first item
found was being returned.  I fixed this by making a new callback
function for finding multiple dialogs that only returns (CMP_MATCH)
on a match allowing for multiple items to be returned.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@279568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-26 19:59:03 +00:00
Mark Michelson
bc3b185063 Allow for systems without locale support to be usable.
A recent change to SIP URI comparison code added a locale-specific
string comparison to the mix, and certain systems do not support
such functions. This fix allows for those systems to still use
Asterisk 1.8

(closes issue #17697)
Reported by: pprindeville
Patches: 
      asterisk-trunk-bugid17697.patch uploaded by pprindeville (license 347)
Tested by: mmichelson



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@279504 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-26 16:04:09 +00:00
Mark Michelson
d1ad460b3d SIP URI comparison fixes.
This initially was created to work around the issue of
using a string comparison instead of a binary comparison
for IP addresses. It evolved a bit when test cases were
created and it was discovered that comparison of URI
parameters was not working exactly as it should.

sip_uri_cmp() and its helpers have been moved to reqresp_parser.c
and a new test has been added.

(closes issue #17662)
Reported by: oej

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-23 16:33:52 +00:00
Mark Michelson
57a92a6a7c Allow IPv6 addresses for UDPTL streams.
Review: https://reviewboard.asterisk.org/r/795



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278908 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-23 15:16:33 +00:00