Commit Graph

1908 Commits

Author SHA1 Message Date
Mark Michelson
d6aef7347a Allow Spiraled INVITEs to work correctly within Asterisk.
Prior to this change, a spiraled INVITE would cause a 482
Loop Detected to be sent to the caller. With this change,
if a potential loop is detected, the Request-URI is inspected
to see if it has changed from what was originally received. If
pedantic mode is on, then this inspection is fully RFC 3261
compliant. If pedantic mode is not on, then a string comparison
is used to test the equality of the two R-URIs.

This has been tested by using OpenSER to rewrite the R-URI
and send the INVITE back to Asterisk.

(closes issue #7403)
Reported by: stephen_dredge



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-22 22:14:24 +00:00
Olle Johansson
fe25fe728c The most common question on the #asterisk iRC channel and on mailing lists
seems to be in regards to an error message when retransmit fails. This
is frequently misunderstood as a failure of Asterisk, not a failure of
the network to reach the other party.

This document tries to assist the Asterisk user in sorting out these
issues by explaining the logic and pointing at some possible 
causes. Hopefully, we will get other questions now :-)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132645 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-22 20:10:26 +00:00
Tilghman Lesher
9fda1e767c astman_send_error does not need a newline appended -- the API takes care of
that for us.
(closes issue #13068)
 Reported by: gknispel_proformatique
 Patches: 
       asterisk_1_4_astman_send.patch uploaded by gknispel (license 261)
       asterisk_trunk_astman_send.patch uploaded by gknispel (license 261)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@130959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-15 17:19:13 +00:00
Tilghman Lesher
e46bb5f5bc Cause SIP to return a 480 instead of a 404 when a sip peer exists, but is not
registered.
(closes issue #12885)
 Reported by: ibc
 Patches: 
       20080701__bug12885__2.diff.txt uploaded by Corydon76 (license 14)
 Tested by: ibc


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@129149 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-08 20:27:47 +00:00
Olle Johansson
3b0f179912 Don't hangup the call if we can't resolve the Contact if there's a proxy
route set for the call.
----
This comment was added a while ago and today it hit me badly. 

/* OEJ: Possible issue that may need a check:
	If we have a proxy route between us and the device,
	should we care about resolving the contact
	or should we just send it?
*/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@128950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-08 09:52:21 +00:00
Olle Johansson
9a253f3fe6 Fix issues where repeated messages where ignored, but retransmitted reliably instead of unreliably.
Reported by: johan
Patches: 
      12746.txt uploaded by oej (license 306)
Tested by: johan
(issue #12746)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@128912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-08 09:06:08 +00:00
Steve Murphy
e9f5152eba The CDRfix4/5/6 omnibus cdr fixes.
(closes issue #10927)
Reported by: murf
Tested by: murf, deeperror

(closes issue #12907)
Reported by: falves11
Tested by: murf, falves11


(closes issue #11849)
Reported by: greyvoip

As to 11849, I think these changes fix the core problems 
brought up in that bug, but perhaps not the more global
problems created by the limitations of CDR's themselves
not being oriented around transfers.

Reopen if necc, but bug reports are not the best
medium for enhancement discussions. We need to start
a second-generation CDR standardization effort to cover
transfers.

(closes issue #11093)
Reported by: rossbeer
Tested by: greyvoip, murf




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@127663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-03 00:16:25 +00:00
Olle Johansson
d3ba59fdc7 Use domain part of SIP uri in register= configuration as fromdomain.
Reported by: one47
Patches: 
      sip-reg-fromdom2.dpatch uploaded by one47 (license 23)
(closes issue #12474)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@126902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 14:59:31 +00:00
Olle Johansson
c68c56c3f6 Handle escaped URI's in call pickups. Patch by oej and IgorG.
Reported by: IgorG
Patches: 
      bug12299-11062-v2.patch uploaded by IgorG (license 20)
Tested by: IgorG, oej
(closes issue #12299)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@126899 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 14:27:33 +00:00
Olle Johansson
d96900ad80 Report 200 OK to all in-dialog OPTIONs requests (to confirm that the dialog
exist). Don't bother checking the request URI.

(closes issue #11264)
Reported by: ibc


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@126789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 11:51:38 +00:00
Olle Johansson
8e0a99b7e3 Fix bad XML for hold notification.
Reported by: gowen72
Patches: 
      hold.patch uploaded by gowen72 (license 432)
(closes issue #12942)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@126735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 07:49:15 +00:00
Olle Johansson
af5c8fedce Send all responses to an INVITE reliably, so that we retransmit if we don't get an ACK and
also fail if we don't get the very same precious ACK. Based on patch by tsearle, with
my own additions.

(closes issue #12951)

Reported by: tsearle
Patches: 
      busy_retransmit.patch uploaded by tsearle (license 373)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@126516 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-30 12:50:55 +00:00
Tilghman Lesher
16b6a965d8 When we get a 408 Timeout, don't stop trying to re-register.
(closes issue #12863)
 Reported by: ricvil


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@126056 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-27 22:01:09 +00:00
Olle Johansson
bd8199b12c Add support for peer realm based auth (a few missing lines, the rest is well documented but never worked)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@125384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-26 16:32:08 +00:00
Tilghman Lesher
f54c6f52ac Don't access the pvt structure if unable to acquire the lock.
(closes issue #12162)
 Reported by: norman
 Patches: 
       12162-lockfail.diff uploaded by qwell (license 4)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@124908 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-24 20:52:43 +00:00
Mark Michelson
524f305187 Make chan_sip build under dev mode with compilers >= GCC 4.2
Thanks to jpeeler for alerting me of this



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@123485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-17 20:26:38 +00:00
Mark Michelson
1335983061 Cisco BTS sends SIP responses with a tab between the Cseq number and
SIP request method in the Cseq: header. Asterisk did not handle this
properly, but with this patch, all is well.

(closes issue #12834)
Reported by: tobias_e
Patches:
      12834.patch uploaded by putnopvut (license 60)
Tested by: tobias_e



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@123333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-17 18:09:16 +00:00
Tilghman Lesher
b815ecf349 People expect that if "hasvoicemail" is set in users.conf, even if "mailbox"
isn't set, that SIP will detect a mailbox.
(closes issue #12855)
 Reported by: PLL
 Patches: 
       20080614__bug12855__2.diff.txt uploaded by Corydon76 (license 14)
 Tested by: PLL


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@123110 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-16 19:21:58 +00:00
Joshua Colp
461020bed4 Only compare the first 15 characters so that even if the charset is specified we still accept it as SDP.
(closes issue #12803)
Reported by: lanzaandrea
Patches:
      chan_sip.c.diff uploaded by lanzaandrea (license 496)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122919 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-16 12:31:09 +00:00
Joshua Colp
5ce568d24d Don't send a BYE on a dialog that is already gone during a REFER.
(closes issue #12865)
Reported by: flefoll
Patches:
      chan_sip.c.br14.121495.patch-ALREADYGONE uploaded by flefoll (license 244)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122869 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-16 12:08:28 +00:00
Joshua Colp
fb87cc02f9 If we are destroying a dialog only set the MWI dialog pointer on the related peer to NULL if it is the dialog currently being destroyed.
(closes issue #12828)
Reported by: ramonpeek


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@121495 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-10 13:34:27 +00:00
Jeff Peeler
4162c566ad add another LOW_MEMORY define I forgot
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-06 18:29:14 +00:00
Jeff Peeler
b9eb1170df only define thread storage variable if necessary for LOW_MEMORY
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120908 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-06 18:05:15 +00:00
Jeff Peeler
a8281b2bcc Correction to commmit 120863, make sure proper destructor function is called as well define two thread storage local variables.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120885 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-06 16:39:20 +00:00
Jeff Peeler
6d12307629 This fixes a crash when LOW_MEMORY is turned on. Two allocations of the ast_rtp struct that were previously allocated on the stack have been modified to use thread local storage instead.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120863 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-06 15:33:15 +00:00
Joshua Colp
6d78e78947 Treat ECONNREFUSED as an error that will stop further retransmissions. (issue #AST-58, patch from Switchvox)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119926 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 14:46:24 +00:00
Tilghman Lesher
65808210e9 Add some debugging code that ensures that when we do deadlock avoidance, we
don't lose the information about how a lock was originally acquired.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-29 17:20:16 +00:00
Joshua Colp
405dfcb54a Add an option to use the source IP address of RTP as the destination IP address of UDPTL when a specific option is enabled. If the remote side is properly configured (ports forwarded) then UDPTL will flow.
(closes issue #10417)
Reported by: cstadlmann


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-28 14:23:34 +00:00
Joshua Colp
a403fd8ea1 Fix an issue where codec preferences were not set on dialogs that were not authenticated via a user or peer and allow framing to work without rtpmap in the SDP.
(closes issue #12501)
Reported by: slimey


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-27 19:32:38 +00:00
Tilghman Lesher
0dab692af5 Realtime flag affects construction in multiple ways, so consulting whether
rtcachefriends was set was done too soon (needed to be done inside build_peer,
not just as a flag to build_peer).
Also, fullcontact needed to be reconstructed, because realtime separates the
embedded ';' into multiple fields.
(closes issue #12722)
 Reported by: barthpbx
 Patches: 
       20080525__bug12722.diff.txt uploaded by Corydon76 (license 14)
 Tested by: barthpbx
 (Much of the discussion happened on #asterisk-dev for diagnosing this issue)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118251 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-25 16:02:04 +00:00
Joshua Colp
6627976f63 Apply the autoframing setting to dialogs that do not get matched against a user or peer.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@117574 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 19:38:28 +00:00
Olle Johansson
59adcca238 Accept text messages even with
Content-Type: text/plain;charset=Södermanländska


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@116230 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-14 12:51:06 +00:00
Russell Bryant
442079ab0b Don't give up on attempting an outbound registration if we receive a 408 Timeout.
(closes issue #12323)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-08 16:11:33 +00:00
Russell Bryant
f27d0168a2 Track peer references when stored in the sip_pvt struct as the peer related to
a qualify ping or a subscription.  This fixes some realtime related crashes.
(closes issue #12588)
(closes issue #12555)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-07 18:17:19 +00:00
Russell Bryant
fbf07008d9 Avoid putting opaque="" in Digest authentication. This patch came from switchvox.
It fixes authentication with Primus in Canada, and has been in use for a very long
time without causing problems with any other providers.
(closes issue AST-36)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 19:49:25 +00:00
Olle Johansson
26fc3d5ac6 Don't crash on bad SIP replys.
Fix created in Huntsville together with Mark M (putnopvut)

(closes issue #12363)
Reported by: jvandal
Tested by: putnopvut, oej


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-30 16:23:17 +00:00
Mark Michelson
709502b119 Re-invite RTP during a masquerade so that, for instance, an AMI
redirect of two channels which are natively bridged will preserve audio
on both channels. This prevents a problem with Asterisk not re-inviting
due to one of the channels having being a zombie.

(closes issue #12513)
Reported by: mneuhauser
Patches:
      asterisk-1.4-114602_restore-RTP-on-fixup.patch uploaded by mneuhauser (license 425)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114632 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24 21:35:08 +00:00
Olle Johansson
2acde60c29 Only have one max-forwards header in outbound REFERs.
Discovered in the Asterisk SIP Masterclass in Orlando. Thanks Joe!


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24 14:55:18 +00:00
Olle Johansson
5980514bb0 Add 502 support for both directions, not only one... (see r114571)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23 16:51:41 +00:00
Tilghman Lesher
0c777767c9 Treat a 502 just like a 503, when it comes to processing a response code
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22 23:51:44 +00:00
Russell Bryant
39d1303e14 Merge changes from team/russell/issue_9520
These changes make sure that the reference count for sip_peer objects properly
reflects the fact that the peer is sitting in the scheduler for a scheduled
callback for qualifying peers or for expiring registrations.  Without this, it
was possible for these callbacks to happen at the same time that the peer was
being destroyed.  This was especially likely to happen with realtime peers, and
for people making use of the realtime prune CLI command.

(closes issue #9520)
Reported by: kryptolus
Committed patch by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114522 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22 15:20:37 +00:00
Joshua Colp
3053679ade Only drop audio if we receive it without a progress indication. We allow other frames through such as DTMF because they may be needed to complete the call.
(closes issue #12440)
Reported by: aragon


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114322 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-21 14:39:32 +00:00
Sean Bright
da91e55eaf Only complete the SIP channel name once for 'sip show channel <channel>'
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114245 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-18 13:33:32 +00:00
Olle Johansson
29c90c2fa0 Handle subscribe queues in all situations... Thanks to festr_ on irc for telling me about this bug.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114148 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-15 20:26:05 +00:00
Joshua Colp
1e771acf2e It is possible for the remote side to say they want T38 but not give any capabilities.
(closes issue #12414)
Reported by: MVF


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-14 14:52:46 +00:00
Mark Michelson
98b06bace4 Be sure that we're not about to set bridgepvt NULL prior to dereferencing it.
(closes issue #11775)
Reported by: fujin



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114045 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-10 19:55:33 +00:00
Joshua Colp
5cfba06089 Don't add custom URI options if they don't exist OR they are empty.
(closes issue #12407)
Reported by: homesick
Patches:
      uri_options-1.4.diff uploaded by homesick (license 91)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114021 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-10 13:27:11 +00:00
Mark Michelson
38e66ce8a2 We need to set the persistant_route [sic] parameter for the sip_pvt
during the initial INVITE, no matter if we're building the route set from
an INVITE request or response.

(closes issue #12391)
Reported by: benjaminbohlmann
Tested by: benjaminbohlmann


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113927 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-09 20:54:31 +00:00
Mark Michelson
784d1b7b3e If Asterisk receives a 488 on an INVITE (not a reinvite), then
we should not send a BYE.

(closes issue #12392)
Reported by: fnordian
Patches:
      chan_sip.patch uploaded by fnordian (license 110) with small modification from me



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113681 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-09 14:40:05 +00:00
Tilghman Lesher
3949ff32df Move check for still-bridged channels out a little further, to avoid possible
deadlocks.  (Closes issue #12252)
Reported by: callguy
 Patches: 
       20080319__bug12252.diff.txt uploaded by Corydon76 (license 14)
 Tested by: callguy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-08 15:39:16 +00:00