Commit Graph

6880 Commits

Author SHA1 Message Date
Richard Mudgett
c5ad2f12a0 The dahdi_hangup() call does not clean up the channel fully.
After dahdi_hangup() has supposedly hungup an ISDN channel there is still
traffic on the S0-bus because the channel was not cleaned up fully.

Shuffled the hangup code to include some missing cleanup.  Also fixed some
code formatting in the area.  I think the primary missing clean up code
was the call to tone_zone_play_tone() to turn off any active tones on the
channel.

(closes issue #19188)
Reported by: jg1234
Patches:
      issue19188_v1.8.patch uploaded by rmudgett (license 664)
Tested by: jg1234


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@316224 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-03 19:18:30 +00:00
David Vossel
981716535a Never put the Require: timer header in an Invite.
This has already been discussed and should have been resolved earlier.  View
revsion 285565's log for more information about why it is important to not
put timer in the Require header.

(closes issue #18704)
Reported by: mfrager


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@316217 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-03 18:59:06 +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
Terry Wilson
e4ef679575 Merged revisions 315672 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r315672 | twilson | 2011-04-26 15:52:25 -0700 (Tue, 26 Apr 2011) | 18 lines
  
  Merged revisions 315671 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r315671 | twilson | 2011-04-26 15:47:56 -0700 (Tue, 26 Apr 2011) | 11 lines
    
    Make sure unregistering a peer unlinks it from the peer container
    
    Instead of mostly copying the code from expire_register, just use the function
    that "does the right thing".
    
    (closes issue #16033)
    Reported by: kkm
    Patches: 
          016033-tilgman-fixed-refcount.diff uploaded by kkm (license 888)
    Tested by: kkm, tilghman, twilson
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@315673 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-26 22:56:19 +00:00
Russell Bryant
4e99831b16 chan_local: resolve a deadlock.
This patch resolves a fairly complex deadlock that can occur with the
combination of chan_local and a dialplan switch, such as dynamic realtime
extensions, which pulls autoservice into the picture when doing a dialplan
lookup.

(closes issue #18818)
Reported by: nic
Patches:
      issue18818.patch uploaded by jthurman (license 614)
      18818.v1.txt uploaded by russell (license 2)
Tested by: nic, jthurman, kterzi, steve-howes, sysreq, IshMalik


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@315446 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-26 17:40:23 +00:00
Richard Mudgett
ced679eef9 When using MGCP realtime gateway definitions, random crashes occur.
Fixed incorrect linked list node removal for realtime gateways.

(closes issue #18291)
Reported by: nahuelgreco
Patches:
      dangling-pointers-when-pruning.patch uploaded by nahuelgreco (license 162)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@315349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-25 21:49:00 +00:00
Russell Bryant
f575dd5397 Merged revisions 315212 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r315212 | russell | 2011-04-25 14:00:24 -0500 (Mon, 25 Apr 2011) | 7 lines
  
  Don't link non-cached realtime peers into the peers_by_ip container.
  
  (closes issue #18924)
  Reported by: wdoekes
  Patches:
        issue18924_uncached_realtime_peers_leak-1.6.2.17.patch uploaded by wdoekes (license 717)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@315213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-25 19:04:28 +00:00
Alec L Davis
d67b2b00b3 Merged revisions 315052 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r315052 | alecdavis | 2011-04-25 19:11:12 +1200 (Mon, 25 Apr 2011) | 16 lines
  
  Merged revisions 315051 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r315051 | alecdavis | 2011-04-25 19:06:29 +1200 (Mon, 25 Apr 2011) | 11 lines
    
    chan_local:check_bridge() misplaced misplaced ast_mutex_unlock 
    
    if !p->chan->_bridge->_softhangup path isn't followed, brigde remains locked.
    
    (closes issue #19176)
    Reported by: alecdavis
    Patches: 
          bug19176.diff.txt uploaded by alecdavis (license 585)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@315053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-25 07:14:32 +00:00
Alec L Davis
f014ffa9d0 chan_dahdi: Can't return to normal ring after distinctive ring on FXS
clear a previous distinctivering pattern before each new call

(closes issue #18985)
Reported by: bromont
Patches: 
      bug18985.diff.txt uploaded by alecdavis (license 585)
Tested by: alecdavis, bromont




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@315001 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-22 22:59:18 +00:00
Matthew Nicholson
1e0234afd6 Merged revisions 314958 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r314958 | mnicholson | 2011-04-22 15:49:45 -0500 (Fri, 22 Apr 2011) | 17 lines
  
  Merged revisions 311203,314908 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r311203 | mnicholson | 2011-03-17 14:14:37 -0500 (Thu, 17 Mar 2011) | 4 lines
    
    Don't hold the pvt lock while streaming a file.
    
    ABE-2756
  ........
    r314908 | mnicholson | 2011-04-22 15:01:48 -0500 (Fri, 22 Apr 2011) | 4 lines
    
    Prevent the login thread and the app threads from using the asterisk channel at the same time.
    
    ABE-2756
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@314959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-22 21:20:08 +00:00
Tzafrir Cohen
51be3664e1 Fix a few typos (shown by Lintian)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@314779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-22 13:59:43 +00:00
Richard Mudgett
1310fd4175 Correct DAHDIShowChannels XML documentation.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@314732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-21 22:38:44 +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
Terry Wilson
459ab135c2 Merged revisions 314549 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r314549 | twilson | 2011-04-20 17:17:34 -0700 (Wed, 20 Apr 2011) | 6 lines
  
  Don't allocate more space than necessary for a sip_pkt
  
  This extra allocation is a hold-over from when pkt->data was a 
  character array. Now that it is an allocated string, just allocate 
  enough for the sip_pkt.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@314550 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-21 00:23:04 +00:00
David Vossel
4c1dd375f7 Remove the need for deadlock avoidance in chan_sip do_monitor.
Deadlock avoidance between the sip pvt and the pvt->owner is
very difficult.  Now that channel's are ao2 objects, this complication
is no longer necessary.  It turns out the pvt's msg queue only
exists because of deadlock avoidance (when deadlock avoidance fails
msgs were added to a queue to be processed later), so this goes away as well.

The technique used in the new sip_lock_pvt_full() function should
be used as a template for replacing all locations where deadlock
avoidance occurs between a channel tech_pvt and the pvt's owner.
My hope is that this will begin a reversal of the invalid channel
driver locking architecture we have been using for so long. 

This patch also resolves an issue where the pvt->owner gets
unlocked during processing the msg queue.

(closes issue #18690)
Reported by: dvossel

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@314067 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-18 15:23:45 +00:00
David Vossel
2998c62fc4 sip codec negotiation of dynamic rtp payloads error fix
This patch fixes how chan_sip handles dynamic rtp payload types
it does not understand.  At the moment if a dynamic payload's mime
type does not match one we understand, the payload does not get
removed from our payload table.  As a result of this, the payload
is set to whatever dynamic codec we use internally for that payload
number on outgoing INVITES.  This is incorrect.

This patch fixes this by properly checking the rtpmap set function's
return code to make sure it was found.  The function can return both
-1 and -2 depending on the source of the mismatch.  We were just
checking -1 explicitly.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@314017 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-18 13:41:06 +00:00
Richard Mudgett
89f98df5d8 Leftover debug messages unconditionally sent to the console.
Executing Dial(DAHDI/1/18475551212,300,) with the echotraining config
option enabled outputs the following debug messages unconditionally:

Dialing T1847555121 on 1
Dialing www2w on 1

* Made debug messages in my_dial_digits() normal debug messages that do
not get output unless enabled.

* Reworded some debug messages in my_dial_digits() to be clearer.

* Replace strncpy() with ast_copy_string() in my_dial_digits() which does
the same job better.

(closes issue #18847)
Reported by: vmikhelson
Tested by: rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@313780 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-14 20:59:56 +00:00
Jonathan Rose
2600de8c9f fixing stupid mistake with putting code before variable declaration
........

  Merged revisions 313435 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
	
  ........
	  
    r313432 | jrose | 2011-04-12 13:12:29 -0500 (Tue, 12 Apr 2011) | 14 lines
		      
	reload Chan_dahdi memory leak caused by variables
			
	chan_dahdi reloading with variables set via setvar in chan_dahdi.conf would
	stay in the dahdi_pvt structs for individual channels (causing them to just
	continue adding the new ones to the list) and also there was a memory leak
	causes by the conf objects. This patch resolves both of these by using 
	ast_variables_destroy during the loading process.
									
	(closes issue #17450)
	Reported by: nahuelgreco
	Patches:
		patch.diff uploaded by jrose (license 1225)
	Tested by: tilghman, jrose
	Review: https://reviewboard.asterisk.org/r/1170/
																	
  ........

........
																	  
																	  																																	














git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@313436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-12 18:47:05 +00:00
Jonathan Rose
833c42ce4b Merged revisions 313432 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........

  r313432 | jrose | 2011-04-12 13:12:29 -0500 (Tue, 12 Apr 2011) | 14 lines
  
  reload Chan_dahdi memory leak caused by variables

  chan_dahdi reloading with variables set via setvar in chan_dahdi.conf would
  stay in the dahdi_pvt structs for individual channels (causing them to just
  continue adding the new ones to the list) and also there was a memory leak
  causes by the conf objects. This patch resolves both of these by using 
  ast_variables_destroy during the loading process.

  (closes issue #17450)
  Reported by: nahuelgreco
  Patches:
	  patch.diff uploaded by jrose (license 1225)
	  Tested by: tilghman, jrose

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

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@313434 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-12 18:25:48 +00:00
Richard Mudgett
46067d2dc4 Merged revisions 313189 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r313189 | rmudgett | 2011-04-11 10:32:53 -0500 (Mon, 11 Apr 2011) | 32 lines
  
  Merged revisions 313188 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r313188 | rmudgett | 2011-04-11 10:27:52 -0500 (Mon, 11 Apr 2011) | 25 lines
    
    Stuck channel using FEATD_MF if caller hangs up at the right time.
    
    The cause was actually a caller hanging up just at the end of the Feature
    Group D DTMF tones that setup the call.  The reason for this is a "guard
    timer" that's implemented using ast_safe_sleep(100).  If the caller
    happens to hang up AFTER the final tone of the DTMF string but BEFORE the
    end of that ast_safe_sleep(), then ast_safe_sleep() will return non-zero.
    This causes the code to bounce to the end of ss_thread(), but it does NOT
    tear down the call properly.
    
    This should be a rare occurrence because the caller has to hang up at
    EXACTLY the right time.  Nonetheless, it was happening quite regularly on
    the reporter's system.  It's not easily reproducible, unless you purposely
    increase the guard-time to 2000 or more.  Once you do that, you can
    reproduce it every time by watching the DTMF debug and hanging up just as
    it ends.
    
    Simply add an ast_hangup() before goto quit.
    
    (closes issue #15671)
    Reported by: jcromes
    Patches:
          issue15671.patch uploaded by pabelanger (license 224)
    Tested by: jcromes
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@313190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-11 15:40:30 +00:00
Alec L Davis
20ef1e9c95 Fix ISDN calling subaddr User Specified Odd/Even Flag
Calculation of the Odd/Even flag was wrong.
Implement correct algo, and set odd/even=0 if data would be truncated.
Only allow automatic calculation of the O/E flag, don't let dialplan influence.

(closes issue #19062)
Reported by: festr
Patches: 
      bug19062.diff2.txt uploaded by alecdavis (license 585)
Tested by: festr, alecdavis, rmudgett



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@313001 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-07 10:19:31 +00:00
Richard Mudgett
4242cb82f4 Crash if ISDN span layer 1 is down on initial load.
Regression from -r312575 B channel shifting during negotiation.

* Also combine updating the alarm flag with clearing the resetting flag.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@312949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-05 18:45:24 +00:00
Richard Mudgett
ddc3fac28b Add 416 response to OPTIONS packet.
RFC3261 Section 11.2 says the response code to an OPTIONS packet needs to
be the same as if it were an INVITE.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@312889 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-05 16:19:35 +00:00
Richard Mudgett
0acdb60dbd Responding to OPTIONS packet with 404 because Asterisk not looking for "s" extension.
The get_destination() function was not using the "s" extension when the
request URI did not specify an extension.  This is a regression caused
when the URI parsing code was extracted into parse_uri().

Made get_destination() substitute the "s" extension when the parsed URI
results in an empty string.

(closes issue #18348)
Reported by: shmaize
Patches:
      issue18348_v1.8.patch uploaded by rmudgett (license 664)
Tested by: shmaize


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@312866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-05 15:38:14 +00:00
Richard Mudgett
458a57d1d3 Merged revisions 312574 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r312574 | rmudgett | 2011-04-04 11:00:02 -0500 (Mon, 04 Apr 2011) | 45 lines
  
  Merged revisions 312573 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r312573 | rmudgett | 2011-04-04 10:49:30 -0500 (Mon, 04 Apr 2011) | 38 lines
    
    Issues with ISDN calls changing B channels during call negotiations.
    
    The handling of the PROCEEDING message was not using the correct call
    structure if the B channel was changed.  (The same for PROGRESS.) The call
    was also not hungup if the new B channel is not provisioned or is busy.
    
    * Made all call connection messages (SETUP_ACKNOWLEDGE, PROCEEDING,
    PROGRESS, ALERTING, CONNECT, CONNECT_ACKNOWLEDGE) ensure that they are
    using the correct structure and B channel.  If there is any problem with
    the operations then the call is now hungup with an appropriate cause code.
    
    * Made miscellaneous messages (INFORMATION, FACILITY, NOTIFY) find the
    correct structure by looking for the call and not using the channel ID.
    NOTIFY is an exception with versions of libpri before v1.4.11 because a
    call pointer is not available for Asterisk to use.
    
    * Made all hangup messages (DISCONNECT, RELEASE, RELEASE_COMPLETE) find
    the correct structure by looking for the call and not using the channel
    ID.
    
    (closes issue #18313)
    Reported by: destiny6628
    Tested by: rmudgett
    JIRA SWP-2620
    
    (closes issue #18231)
    Reported by: destiny6628
    Tested by: rmudgett
    JIRA SWP-2924
    
    (closes issue #18488)
    Reported by: jpokorny
    JIRA SWP-2929
    
    JIRA AST-437 (The issues fixed here are most likely causing this JIRA issue.)
    JIRA DAHDI-406
    JIRA LIBPRI-33 (Stuck resetting flag likely fixed)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@312575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-04 16:10:50 +00:00
Richard Mudgett
d01f7b6dd8 When a call going out an NT-PTMP port gets rejected, Asterisk crashes.
If a call is sent to an ISDN phone that rejects the call with
RELEASE_COMPLETE(cause: call reject(21), or busy(17)) Asterisk crashes.

I could not get my setup to crash.  However, I could see the possibility
from a race condition between queuing an AST_CONTROL_BUSY to the core and
then queueing an AST_CONTROL_HANGUP.  If the AST_CONTROL_BUSY is processed
before the AST_CONTROL_HANGUP is queued, the ast_channel could be
destroyed out from under chan_misdn.

Avoid this particular crash scenario by not queueing the
AST_CONTROL_HANGUP if the AST_CONTROL_BUSY was queued.

(closes issue #18408)
Reported by: wimpy
Patches:
      issue18408_v1.8.patch uploaded by rmudgett (license 664)
Tested by: rmudgett, wimpy

JIRA SWP-2679


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@312509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-01 23:15:42 +00:00
Richard Mudgett
32e0a3510c chan_misdn segfaults when DEBUG_THREADS is enabled.
The segfault happens because jb->mutexjb is uninitialized from the
ast_malloc().  The internals of ast_mutex_init() were assuming a nonzero
value meant mutex tracking initialization had already happened.  Recent
changes to mutex tracking code to reduce excessive memory consumption
exposed this uninitialized value.

Converted misdn_jb_init() to use ast_calloc() instead of ast_malloc().
Also eliminated redundant zero initialization code in the routine.

(closes issue #18975)
Reported by: irroot


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@312022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-31 20:11:40 +00:00
Richard Mudgett
28bfbccfb7 Update some setup_dahdi_int() comments.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@311874 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-30 01:56: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
7cf95da39a Changes some print statements/events to use a blank string in place of NULL if the string in question is NULL.
This is supposed to improve Solaris compatibility since Solaris goes berserk when trying to output NULL strings.

(closes issue #18759)
Reported by: bklang
Patches:
      null-strings.patch uploaded by bklang (license 919)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@311352 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-18 16:19:05 +00:00
Richard Mudgett
4f3cf039f4 Race condition when ISDN CallRerouting/CallDeflection invoked.
The queued AST_CONTROL_BUSY could sometimes be processed before the
call_forward dial string is recognized.

* Moved setting the call_forwarding dial string after sending a response
to the initiator and just queue an empty frame to wake up the media thread
instead of an AST_CONTROL_BUSY.

* Added check for empty rerouting/deflection number and respond with an
error.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@311297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-18 02:59:05 +00:00
Mark Michelson
d409098f0e Be more tolerant of what URI we accept for call completion PUBLISH requests.
(closes issue #18946)
Reported by: GeorgeKonopacki
Patches: 
      18946.patch uploaded by mmichelson (license 60)
Tested by: GeorgeKonopacki



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@310231 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-10 15:17:04 +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
Richard Mudgett
8bfde13607 Make pri parameter description consistent.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@309994 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-08 16:37:02 +00:00
Tilghman Lesher
56cd7709a5 Merged revisions 309251 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r309251 | tilghman | 2011-03-01 19:06:02 -0600 (Tue, 01 Mar 2011) | 7 lines
  
  Revert previous 2 commits, and instead conditionally redefine the same macro used in flex 2.5.35 that clashed with our workaround.
  
  Not surprisingly, the workaround was exactly the same code as was provided by
  the Flex maintainers, albeit in two different places, in different macros.
  
  This should fix the FreeBSD builds, which have an older version of Flex.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@309808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-07 00:54:42 +00:00
Moises Silva
3770b4d7cb Fix caller id passed to openr2_chan_make_call
(closes issue #18894)
Reported by: malufrj
Tested by: moy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@309720 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-05 17:44:30 +00:00
Richard Mudgett
5b9f9f78ca Get real channel of a DAHDI call.
Starting with Asterisk v1.8, the DAHDI channel name format was changed for
ISDN calls to: DAHDI/i<span>/<number>[:<subaddress>]-<sequence-number>

There were several reasons that the channel name had to change.

1) Call completion requires a device state for ISDN phones.  The generic
device state uses the channel name.

2) Calls do not necessarily have B channels.  Calls placed on hold by an
ISDN phone do not have B channels.

3) The B channel a call initially requests may not be the B channel the
call ultimately uses.  Changes to the internal implementation of the
Asterisk master channel list caused deadlock problems for chan_dahdi if it
needed to change the channel name.  Chan_dahdi no longer changes the
channel name.

4) DTMF attended transfers now work with ISDN phones because the channel
name is "dialable" like the chan_sip channel names.

For various reasons, some people need to know which B channel a DAHDI call
is using.

* Added CHANNEL(dahdi_span), CHANNEL(dahdi_channel), and
CHANNEL(dahdi_type) so the dialplan can determine the B channel currently
in use by the channel.  Use CHANNEL(no_media_path) to determine if the
channel even has a B channel.

* Added AMI event DAHDIChannel to associate a DAHDI channel with an
Asterisk channel so AMI applications can passively determine the B channel
currently in use.  Calls with "no-media" as the DAHDIChannel do not have
an associated B channel.  No-media calls are either on hold or
call-waiting.

(closes issue #17683)
Reported by: mrwho
Tested by: rmudgett

(closes issue #18603)
Reported by: arjankroon
Patches:
      issue17683_18603_v1.8_v2.patch uploaded by rmudgett (license 664)
Tested by: stever28, rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@309445 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-04 15:22:04 +00:00
Jason Parker
546b652f1f Merged revisions 309255 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r309255 | qwell | 2011-03-02 13:53:47 -0600 (Wed, 02 Mar 2011) | 8 lines
  
  Fix usage of "hasvoicemail=yes" and "mailbox=" in users.conf for SIP.
  
  Since it's a duplicate, nothing is going to be done, so delme doesn't need to
  be set at all.  Strangely, when this was added, this was being set to 1 in 1.6,
  and 0 in trunk.
  
  (issue AST-439)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@309256 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-02 19:54:20 +00:00
Richard Mudgett
10e378b07c Chan_dahdi does not retain CID when detecting DTMF CID without polarity reversal.
Looks like an unintended change when sig_analog.c was extracted from
chan_dahdi.c.

Removed useless conditional around needed code and fixed resulting
compiler warning.

(closes issue #18667)
Reported by: enegaard
Patches:
      issue18667.patch uploaded by enegaard (license 1197)
Tested by: enegaard

JIRA SWP-2965


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@309126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-01 18:44:05 +00:00
David Vossel
0a577f6cdd Merged revisions 309083 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r309083 | dvossel | 2011-03-01 10:05:25 -0600 (Tue, 01 Mar 2011) | 9 lines
  
  Fixes thread blocking issue in the sip TCP/TLS implementation.
  
  (closes issue #18497)
  Reported by: vois
  Patches:
        issues_18497.diff uploaded by dvossel (license 671)
  Tested by: vois, rossbeer, kowalma, Freddi_Fonet
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@309084 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-01 16:09:11 +00:00
Alec L Davis
73254a28cb Fix Deadlock with attended transfer of SIP call
Call path 
  sip_set_rtp_peer (locks chan then pvt)
   transmit_reinvite_with_sdp
    try_suggested_sip_codec
     pbx_builtin_getvar_helper (locks p->owner)

But by the time p->owner lock was attempted, seems as though chan and p->owner were different.

So in sip_set_rtp_peer, lock pvt first then lock p->owner using deadlocking methods.

(closes issue #18837)
Reported by: alecdavis
Patches: 
      bug18837-trunk.diff3.txt uploaded by alecdavis (license 585)
Tested by: alecdavis, Irontec, ZX81, cmaj

Review: [https://reviewboard.asterisk.org/r/1126/]



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@308945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-25 18:52:53 +00:00
Terry Wilson
f0992a0b5e Merged revisions 308678 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r308678 | twilson | 2011-02-23 21:38:22 -0600 (Wed, 23 Feb 2011) | 8 lines
  
  Use remotesecret to authenticate with a remote party
  
  The remotesecret option was only being used for outbound registration
  and not for placing calls. This patch uses remotesecret on outbound
  calls if it is set, otherwise secret is still used.
  
  Review: https://reviewboard.asterisk.org/r/1107/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@308679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-24 03:41:34 +00:00
Richard Mudgett
7b353a26ae sig_pri_new_ast_channel() should return NULL when new_ast_channel() fails.
(closes issue #18874)
Reported by: cmaj
Patches:
      patch-sig_pri-crash-possible-null-channel-pointer.diff.txt uploaded by cmaj (license 830)

JIRA SWP-3172


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@308622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-23 23:38:04 +00:00
Richard Mudgett
a5f6367057 No response sent for SIP CC subscribe/resubscribe request.
Asterisk does not send a response if we try to subscribe for call
completion after we have received a 180 Ringing.  You can only subscribe
for call completion when the call has been cleared.

When we receive the 180 Ringing, for this call, its call-completion state
is 'CC_AVAILABLE'.  If we then send a subscribe message to Asterisk, it
trys to change the call-completion state to 'CC_CALLER_REQUESTED'.
Because this is an invalid state change, it just ignores the message.  The
only state Asterisk will accept our subscribe message is in the
'CC_CALLER_OFFERED' state.

Asterisk will go into the 'CC_CALLER_OFFERED' when the SIP client clears
the call by sending a CANCEL.

Asterisk should always send a response.  Even if its a negative one.


The fix is to allow for the CCSS core to notify a CC agent that a failure
has occurred when CC is requested.  The "ack" callback is replaced with a
"respond" callback.  The "respond" callback has a parameter indicating
either a successful response or a specific type of failure that may need
to be communicated to the requester.

(closes issue #18336)
Reported by: GeorgeKonopacki
Tested by: mmichelson, rmudgett

JIRA SWP-2633

(closes issue #18337)
Reported by: GeorgeKonopacki
Tested by: mmichelson

JIRA SWP-2634


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@307879 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-15 16:13:55 +00:00
Terry Wilson
cd3b672f45 Merged revisions 306973 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r306973 | twilson | 2011-02-08 12:14:09 -0800 (Tue, 08 Feb 2011) | 9 lines
  
  Merged revisions 306972 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r306972 | twilson | 2011-02-08 12:05:13 -0800 (Tue, 08 Feb 2011) | 2 lines
    
    Fix comparison for REFER Replaces tags with pedantic=yes
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@306979 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-08 20:18:08 +00:00
Terry Wilson
4b54ce5ce5 Merged revisions 306618 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r306618 | twilson | 2011-02-07 13:59:54 -0800 (Mon, 07 Feb 2011) | 17 lines
  
  Merged revisions 306617 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r306617 | twilson | 2011-02-07 13:51:43 -0800 (Mon, 07 Feb 2011) | 10 lines
    
    Don't allow a REFER w/replaces to replace its own dialog
    
    Asterisk currently accepts a REFER with a Refer-To with an embedded Replaces
    header that matches the dialog of the REFER. This would be a situation like A
    calls B, A calls C, A transfers B to A, which is just silly. This patch makes
    the transfer fail instead of making Asterisk freak out and forget to hang other
    channels up.
    
    Review: https://reviewboard.asterisk.org/r/1093/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@306619 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-07 22:15:27 +00:00
Jeff Peeler
6bb8cc3a9b Fix SIP deadlock involving state changes.
Once again a call to pbx_builtin_getvar_helper (and pbx_builtin_setvar_helper)
has caused locking problems. Both of these functions lock the channel when
the channel argument is passed in!

In this case, the suspected problem (the backtrace makes it impossible to tell)
was the private being locked in sip_set_rtp_peer and then:
transmit_reinvite_with_sdp
 try_suggested_sip_codec
   pbx_builtin_getvar_helper
(Traced to verify that the fix was only required in 1.8 and later.)

(closes issue #18491)
Reported by: cmaj
Patches: 
      chan_sip_fix_deadlocks_bug_18491.txt uploaded by cmaj (license 830)
Tested by: cmaj



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@306215 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03 23:49:28 +00:00
Terry Wilson
5eca7e5bd5 Merged revisions 306126 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r306126 | twilson | 2011-02-03 12:56:00 -0800 (Thu, 03 Feb 2011) | 16 lines
  
  Merged revisions 306119 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r306119 | twilson | 2011-02-03 12:36:34 -0800 (Thu, 03 Feb 2011) | 9 lines
    
    Set hangup cause in local_hangup
    
    When a call involves a local channel (like SIP -> Local -> SIP), the hangup
    cause was not being set. This resulted in SIP channels sometimes getting a
    503 error instead of a 486 when the far side sent a busy. In Asterisk 1.8+
    this also can cause issues with CCSS that involve a local channel. This patch
    sets the hangupcause for one side of the local channel to the other in
    local_hangup for outbound calls.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@306127 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03 21:03:26 +00:00
Richard Mudgett
a785544090 Merged revisions 305889 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r305889 | rmudgett | 2011-02-02 18:15:07 -0600 (Wed, 02 Feb 2011) | 17 lines
  
  Merged revisions 305888 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r305888 | rmudgett | 2011-02-02 18:02:43 -0600 (Wed, 02 Feb 2011) | 8 lines
  
    Minor AST_FRAME_TEXT related issues.
  
    * Include the null terminator in the buffer length.  When the frame is
    queued it is copied.  If the null terminator is not part of the frame
    buffer length, the receiver could see garbage appended onto it.
  
    * Add channel lock protection with ast_sendtext().
  
    * Fixed AMI SendText action ast_sendtext() return value check.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@305923 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03 00:24:40 +00:00