]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
16 years agoUpdate autosupport script to supply info for both Zaptel and DAHDI in 1.4 and
Sean Bright [Wed, 14 Jan 2009 20:52:00 +0000 (20:52 +0000)] 
Update autosupport script to supply info for both Zaptel and DAHDI in 1.4 and
be sure to run dahdi_test in 1.6.x and trunk instead of zttest.

(closes issue #14132)
Reported by: dsedivec
Patches:
      asterisk-1.4-autosupport.patch uploaded by dsedivec (license 638)
      asterisk-trunk-autosupport.patch uploaded by dsedivec (license 638)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168614 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoapp_page was failing to compile in dev-mode on my gcc-4.2.4 system. This change gets...
Steve Murphy [Wed, 14 Jan 2009 19:34:35 +0000 (19:34 +0000)] 
app_page was failing to compile in dev-mode on my gcc-4.2.4 system. This change gets rid of the warning.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168608 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoDon't read into a buffer without first checking if a value is beyond the end.
Tilghman Lesher [Wed, 14 Jan 2009 19:02:55 +0000 (19:02 +0000)] 
Don't read into a buffer without first checking if a value is beyond the end.
(closes issue #13600)
 Reported by: atis
 Patches:
       20090106__bug13600.diff.txt uploaded by Corydon76 (license 14)
 Tested by: atis

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168603 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix a logic error I found while searching through chan_agent.c
Mark Michelson [Wed, 14 Jan 2009 16:19:26 +0000 (16:19 +0000)] 
Fix a logic error I found while searching through chan_agent.c

I found that the allow_multiple_logins function would never return
0 due to an incorrect comparison being used when traversing the
list of agents. While I was modifying this function, I also did
a little bit of coding guidelines cleanup, too.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168598 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoDon't overflow when paging more than 128 extensions
Terry Wilson [Wed, 14 Jan 2009 01:27:18 +0000 (01:27 +0000)] 
Don't overflow when paging more than 128 extensions

The number of available slots for calls in app_page was hardcoded to 128.
Proper bounds checking was not in place to enforce this limit, so if more than
128 extensions were passed to the Page() app, Asterisk would crash.  This patch
instead dynamically allocates memory for the ast_dial structures and removes
the (non-functional) arbitrary limit.

This issue would have special importance to anyone who is dynamically creating
the argument passed to the Page application and allowing more than 128
extensions to be added by an outside user via some external interface.

The patch posted by a_villacis was slightly modified for some coding guidelines
and other cleanups.  Thanks, a_villacis!
(closes issue #14217)
Reported by: a_villacis
Patches:
      20080912-asterisk-app_page-fix-buffer-overflow.patch uploaded by a (license 660)
Tested by: otherwiseguy

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168593 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoRevert unnecessary indications API change from rev 122314
Russell Bryant [Tue, 13 Jan 2009 19:13:05 +0000 (19:13 +0000)] 
Revert unnecessary indications API change from rev 122314

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168561 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoDon't pass a value with a side effect to a macro
Terry Wilson [Tue, 13 Jan 2009 18:34:14 +0000 (18:34 +0000)] 
Don't pass a value with a side effect to a macro

(closes issue #14176)
Reported by: paraeco
Patches:
      chan_sip.c.diff uploaded by paraeco (license 658)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168551 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoIf either conditional is NULL, don't try copying it.
Tilghman Lesher [Tue, 13 Jan 2009 17:48:00 +0000 (17:48 +0000)] 
If either conditional is NULL, don't try copying it.
(closes issue #14226)
 Reported by: caspy
 Patches:
       20090113__bug14226.diff.txt uploaded by Corydon76 (license 14)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168546 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years ago(closes issue #13881)
Jeff Peeler [Mon, 12 Jan 2009 21:42:34 +0000 (21:42 +0000)] 
(closes issue #13881)
Reported by: hoowa

Update the app CDR field for AGI commands that are not executing an application via "exec".

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168516 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years ago(closes issue #12269)
Jeff Peeler [Mon, 12 Jan 2009 20:26:22 +0000 (20:26 +0000)] 
(closes issue #12269)
Reported by: IgorG
Tested by: denisgalvao

This gits rid of the notion of an owning_app allowing the request and hangup to be initiated by different threads. Originating from an active agent channel requires this. The implementation primarily changes __login_exec to wait on a condition variable rather than a lock.

Review: http://reviewboard.digium.com/r/35/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168507 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoI am reverting the fix made in revision 168128 (and its upward merges)
Mark Michelson [Mon, 12 Jan 2009 14:58:25 +0000 (14:58 +0000)] 
I am reverting the fix made in revision 168128 (and its upward merges)
after being contacted by Olle Johansson and being shown how this fix is
incorrect. Thanks to Olle for clearing this up for me.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168482 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agos/ringdance/ringcadence/ for Bulgaria
Russell Bryant [Mon, 12 Jan 2009 14:57:27 +0000 (14:57 +0000)] 
s/ringdance/ringcadence/ for Bulgaria

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168480 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agosmall commit to test new server
Kevin P. Fleming [Sat, 10 Jan 2009 20:47:31 +0000 (20:47 +0000)] 
small commit to test new server

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168382 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agosmall commit to test new server
Kevin P. Fleming [Sat, 10 Jan 2009 20:38:38 +0000 (20:38 +0000)] 
small commit to test new server

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168379 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoupdate to use new sound file packages that include license files
Kevin P. Fleming [Fri, 9 Jan 2009 23:12:29 +0000 (23:12 +0000)] 
update to use new sound file packages that include license files

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168267 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoMake this compile for mvanbaak
Russell Bryant [Fri, 9 Jan 2009 22:14:38 +0000 (22:14 +0000)] 
Make this compile for mvanbaak

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168198 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years ago* Fix for JIRA AST-175/ABE-1757
Richard Mudgett [Fri, 9 Jan 2009 21:28:42 +0000 (21:28 +0000)] 
*  Fix for JIRA AST-175/ABE-1757
*  Miscellaneous doxygen comments added.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168191 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoAdd check_via calls to more request handlers
Mark Michelson [Fri, 9 Jan 2009 20:08:04 +0000 (20:08 +0000)] 
Add check_via calls to more request handlers

INFO, NOTIFY, OPTIONS, REFER, and MESSAGE requests
were not checking the topmost Via to determine where
to send the response. Adding check_via calls to those
request handlers solves this.

(closes issue #13071)
Reported by: baron
Patches:
      check_via.patch uploaded by baron (license 531)
Tested by: baron

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168128 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoDon't truncate database results at 255 chars.
Tilghman Lesher [Thu, 8 Jan 2009 22:08:56 +0000 (22:08 +0000)] 
Don't truncate database results at 255 chars.
(closes issue #14069)
 Reported by: evandro
 Patches:
       20081214__bug14069.diff.txt uploaded by Corydon76 (license 14)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167840 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoremove an unnecessary argument to queue_request()
Kevin P. Fleming [Thu, 8 Jan 2009 17:24:21 +0000 (17:24 +0000)] 
remove an unnecessary argument to queue_request()

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167714 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoWhen a SIP request or response arrives for a dialog with an associated Asterisk chann...
Kevin P. Fleming [Wed, 7 Jan 2009 23:32:21 +0000 (23:32 +0000)] 
When a SIP request or response arrives for a dialog with an associated Asterisk channel, and the lock on that channel cannot be obtained because it is held by another thread, instead of dropping the request/response, queue it for later processing when the channel lock becomes available.

http://reviewboard.digium.com/r/117/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167620 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix the last couple of places where free() was improperly used directly.
Russell Bryant [Wed, 7 Jan 2009 22:35:36 +0000 (22:35 +0000)] 
Fix the last couple of places where free() was improperly used directly.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167566 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoDon't fclose() the file early, the filestream destructor will handle it.
Russell Bryant [Wed, 7 Jan 2009 22:26:42 +0000 (22:26 +0000)] 
Don't fclose() the file early, the filestream destructor will handle it.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167554 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoOnly try to close the file if one was actually opened
Russell Bryant [Wed, 7 Jan 2009 22:19:47 +0000 (22:19 +0000)] 
Only try to close the file if one was actually opened

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167545 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoDon't use free() directly. This caused a crash since ast_filestream is now an ao2...
Russell Bryant [Wed, 7 Jan 2009 22:03:59 +0000 (22:03 +0000)] 
Don't use free() directly.  This caused a crash since ast_filestream is now an ao2 object.

Reported by JunK-Y on IRC, #asterisk-dev

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167541 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoTreat an empty string the same way as a NULL country argument.
Russell Bryant [Wed, 7 Jan 2009 17:29:53 +0000 (17:29 +0000)] 
Treat an empty string the same way as a NULL country argument.

In passing, simplify the handling of returning a default tone zone.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167432 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoUse the correct variable when creating the format string
Mark Michelson [Tue, 6 Jan 2009 21:35:57 +0000 (21:35 +0000)] 
Use the correct variable when creating the format string

(closes issue #14177)
Reported by: nic_bellamy
Patches:
      asterisk-trunk-svn-r167242-ast_db_gettree.patch uploaded by nic (license 299)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167299 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoMerged revisions 167259 via svnmerge from
Tilghman Lesher [Tue, 6 Jan 2009 20:48:05 +0000 (20:48 +0000)] 
Merged revisions 167259 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
  r167259 | tilghman | 2009-01-06 14:44:03 -0600 (Tue, 06 Jan 2009) | 2 lines

  Security fix AST-2009-001.
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167260 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoA couple of changes to T.38 SDP attribute handling
Mark Michelson [Mon, 5 Jan 2009 16:51:59 +0000 (16:51 +0000)] 
A couple of changes to T.38 SDP attribute handling

There are some boolean attributes for T.38 such
as T38FaxFillBitRemoval, T38FaxTranscodingMMR, and
T38FaxTranscodingJBIG. By simply being present, we
should treat these as a "true" value. The current
code, however, was requiring a 1 or 0 as the value
of the attribute in order to parse it. This is due
to the fact that there are some T.38 endpoints and
gateways that also transmit this information
incorrectly. This patch follows the "be liberal in
what you accept and strict in what you send"
philosophy by accepting both the correctly- and
incorrectly-formatted attributes, but only sending
information as it is supposed to be sent.

It was also discovered that a particular type of
T.38 gateway sends some non-standard T.38 SDP
attributes. Instead of using T38FaxMaxDatagram
and T38MaxBitRate, it used T38MaxDatagram and
T38FaxMaxRate respectively. We now will properly
accept these attributes as well.

Note that there are a lot of patches cited in
the below commit message template. This is
because the person who submitted these patches is
an awesome person and wrote 1.4, 1.6.0, and 1.6.1
variants.

(closes issue #13976)
Reported by: linulin
Patches:
     chan_sip.c.1.4-update1.diff uploaded by arcivanov (license 648)
 chan_sip.c.1.6.0-update1.diff uploaded by arcivanov (license 648)
 chan_sip.c.1.6.1-update1.diff uploaded by arcivanov (license 648)
 chan_sip.c.1.4-relaxedT38_update1.diff uploaded by arcivanov (license 648)
 chan_sip.c.1.6.0-relaxedT38_update1.diff uploaded by arcivanov (license 648)
 chan_sip.c.1.6.1-relaxedT38_update1.diff uploaded by arcivanov (license 648)
Tested by: arcivanov

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167179 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoRepeat attempts to write when we receive -EAGAIN from the driver, as detailed
Tilghman Lesher [Thu, 1 Jan 2009 00:01:22 +0000 (00:01 +0000)] 
Repeat attempts to write when we receive -EAGAIN from the driver, as detailed
in the ALSA sample code (see http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2pcm_8c-example.html#a32)
Reported by: Jerry Geis (via the -users list)
Fixed by: me (license 14)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167095 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoAlso inherit the musiconhold class.
Tilghman Lesher [Wed, 31 Dec 2008 19:20:35 +0000 (19:20 +0000)] 
Also inherit the musiconhold class.
(Closes #14153)
Reported by: Jerry Geis, via the users list.
Patch by: me (license 14)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166953 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoUse strncat() instead of an sprintf() in which source and target buffers overlap
Russell Bryant [Sun, 28 Dec 2008 15:13:48 +0000 (15:13 +0000)] 
Use strncat() instead of an sprintf() in which source and target buffers overlap

http://lists.digium.com/pipermail/asterisk-dev/2008-December/035919.html

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166772 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoCompile, even if both DAHDI and Zaptel are not installed.
Tilghman Lesher [Tue, 23 Dec 2008 15:35:38 +0000 (15:35 +0000)] 
Compile, even if both DAHDI and Zaptel are not installed.
(Closes issue #14120)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166592 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix a crash resulting from a datastore with inheritance but no duplicate callback
Mark Michelson [Tue, 23 Dec 2008 15:16:26 +0000 (15:16 +0000)] 
Fix a crash resulting from a datastore with inheritance but no duplicate callback

The fix for this is to simply set the newly created datastore's data pointer
to NULL if it is inherited but has no duplicate callback.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166568 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoUse the integer form of condition for integer comparisons.
Tilghman Lesher [Tue, 23 Dec 2008 04:05:25 +0000 (04:05 +0000)] 
Use the integer form of condition for integer comparisons.
(closes issue #14127)
 Reported by: andrew

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166509 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix a deadlock relating to channel locks and autoservice
Mark Michelson [Mon, 22 Dec 2008 20:56:29 +0000 (20:56 +0000)] 
Fix a deadlock relating to channel locks and autoservice

It has been discovered that if a channel is locked prior
to a call to ast_autoservice_stop, then it is likely that
a deadlock will occur. The reason is that the call to
ast_autoservice_stop has a check built into it to be sure
that the thread running autoservice is not currently trying
to manipulate the channel we are about to pull out of
autoservice.

The autoservice thread, however, cannot advance beyond where
it currently is, though, because it is trying to acquire
the lock of the channel for which autoservice is attempting
to be stopped.

The gist of all this is that a channel MUST NOT be locked
when attempting to stop autoservice on the channel.

In this particular case, the channel was locked by a call
to ast_read. A call to ast_exists_extension led to autoservice
being started and stopped due to the existence of dialplan
switches.

It may be that there are future commits which handle the same
symptoms but in a different location, but based on my looks through
the code, it is very rare to see a construct such as this one.

(closes issue #14057)
Reported by: rtrauntvein
Patches:
      14057v3.patch uploaded by putnopvut (license 60)
Tested by: rtrauntvein

Review: http://reviewboard.digium.com/r/107/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166380 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix up timeout handling in ast_carefulwrite().
Russell Bryant [Mon, 22 Dec 2008 17:22:56 +0000 (17:22 +0000)] 
Fix up timeout handling in ast_carefulwrite().

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166297 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoRe-work ref count handling of MoH classes using astobj2 to resolve crashes.
Russell Bryant [Mon, 22 Dec 2008 14:45:27 +0000 (14:45 +0000)] 
Re-work ref count handling of MoH classes using astobj2 to resolve crashes.

(closes issue #13566)
Reported by: igorcarneiro
Tested by: russell
Review: http://reviewboard.digium.com/r/106/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166262 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoBackport of AUDIOHOOK_INHERIT for Asterisk 1.4
Mark Michelson [Fri, 19 Dec 2008 23:34:57 +0000 (23:34 +0000)] 
Backport of AUDIOHOOK_INHERIT for Asterisk 1.4

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166157 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoThis merges the masqpark branch into 1.4
Steve Murphy [Fri, 19 Dec 2008 22:30:32 +0000 (22:30 +0000)] 
This merges the masqpark branch into 1.4

These changes eliminate the need for (and use of)
the KEEPALIVE return code in res_features.c;
There are other places that use this result code
for similar purposes at a higher level, these appear
to be left alone in 1.4, but attacked in trunk.

The reason these changes are being made in 1.4, is
that parking ends a channel's life, in some situations,
and the code in the bridge (and some other places),
was not checking the result code properly, and dereferencing
the channel pointer, which could lead to memory corruption
and crashes.

Calling the masq_park function eliminates this danger
in higher levels.

A series of previous commits have replaced some parking calls
with masq_park, but this patch puts them ALL to rest,
(except one, purposely left alone because a masquerade
is done anyway), and gets rid of the code that tests
the KEEPALIVE result, and the NOHANGUP_PEER result codes.

While bug 13820 inspired this work, this patch does
not solve all the problems mentioned there.

I have tested this patch (again) to make sure I have
not introduced regressions.

Crashes that occurred when a parked party hung up
while the parking party was listening to the numbers
of the parking stall being assigned, is eliminated.

These are the cases where parking code may be activated:

1. Feature one touch (eg. *3)
2. Feature blind xfer to parking lot (eg ##700)
3. Run Park() app from dialplan (eg sip xfer to 700)
   (eg. dahdi hookflash xfer to 700)
4. Run Park via manager.

The interesting testing cases for parking are:
I. A calls B, A parks B
    a. B hangs up while A is getting the numbers announced.
    b. B hangs up after A gets the announcement, but
       before the parking time expires
    c. B waits, time expires, A is redialed,
       A answers, B and A are connected, after
       which, B hangs up.
    d. C picks up B while still in parking lot.

II. A calls B, B parks A
    a. A hangs up while B is getting the numbers announced.
    b. A hangs up after B gets the announcement, but
       before the parking time expires
    c. A waits, time expires, B is redialed,
       B answers, A and B are connected, after
       which, A hangs up.
    d. C picks up A while still in parking lot.

Testing this throroughly involves acting all the permutations
of I and II, in situations 1,2,3, and 4.

Since I added a few more changes (ALL references to KEEPALIVE in the bridge
code eliimated (I missed one earlier), I retested
most of the above cases, and no crashes.

H-extension weirdness.

Current h-extension execution is not completely
correct for several of the cases.

For the case where A calls B, and A parks B, the
'h' exten is run on A's channel as soon as the park
is accomplished. This is expected behavior.

But when A calls B, and B parks A, this will be
current behavior:

After B parks A, B is hung up by the system, and
the 'h' (hangup) exten gets run, but the channel
mentioned will be a derivative of A's...

Thus, if A is DAHDI/1, and B is DAHDI/2,
the h-extension will be run on channel
Parked/DAHDI/1-1<ZOMBIE>, and the
start/answer/end info will be those
relating to Channel A.

And, in the case where A is reconnected to
B after the park time expires, when both parties
hang up after the joyful reunion, no h-exten
will be run at all.

In the case where C picks up A from the
parking lot, when either A or C hang up,
the h-exten will be run for the C channel.

CDR's are a separate issue, and not addressed
here.

As to WHY this strange behavior occurs,
the answer lies in the procedure followed
to accomplish handing over the channel
to the parking manager thread. This procedure
is called masquerading. In the process,
a duplicate copy of the channel is created,
and most of the active data is given to the
new copy. The original channel gets its name
changed to XXX<ZOMBIE> and keeps the PBX
information for the sake of the original
thread (preserving its role as a call
originator, if it had this role to begin
with), while the new channel is without
this info and becomes a call target (a
"peer").

In this case, the parking lot manager
thread is handed the new (masqueraded)
channel. It will not run an h-exten
on the channel if it hangs up while
in the parking lot. The h exten will
be run on the original channel instead,
in the original thread, after the bridge
completes.

See bug 13820 for our intentions as
to how to clean up the h exten behavior.

Review: http://reviewboard.digium.com/r/29/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166093 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years ago(closes issue #13480)
Jeff Peeler [Fri, 19 Dec 2008 19:48:00 +0000 (19:48 +0000)] 
(closes issue #13480)
Reported by: tzafrir

Replace a bunch of if defined checks for Zaptel/DAHDI through several new defines in dahdi_compat.h. This removes a lot of code duplication. Example from bug:

#ifdef HAVE_ZAPTEL
  fd = open("/dev/zap/pseudo", O_RDWR);
#else
  fd = open("/dev/dahdi/pseudo", O_RDWR);
#endif

is replaced with:
  fd = open(DAHDI_FILE_PSEUDO, O_RDRW);

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@165991 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoEnsure that the chanspy datastore is fully initialized.
Russell Bryant [Fri, 19 Dec 2008 15:03:02 +0000 (15:03 +0000)] 
Ensure that the chanspy datastore is fully initialized.

This patch resolved some random crash issues observed by a user on a BSD system

(closes issue #14111)
Reported by: ys
Patches:
      app_chanspy.c.diff uploaded by ys (license 281)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@165889 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoMake ast_carefulwrite() be more careful.
Russell Bryant [Thu, 18 Dec 2008 21:39:25 +0000 (21:39 +0000)] 
Make ast_carefulwrite() be more careful.

This patch handles some additional cases that could result in partial writes
to the file description.  This was done to address complaints about partial
writes on AMI.

(issue #13546) (more changes needed to address potential problems in 1.6)
Reported by: srt
Tested by: russell
Review: http://reviewboard.digium.com/r/99/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@165796 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoAdd mutexes around accesses to the IMAP library interface. This prevents
Tilghman Lesher [Thu, 18 Dec 2008 21:14:47 +0000 (21:14 +0000)] 
Add mutexes around accesses to the IMAP library interface.  This prevents
certain crashes, especially when shared mailboxes are used.
(closes issue #13653)
 Reported by: howardwilkinson
 Patches:
       asterisk-1.4.21.2-appvoicemail-sharedimap-lock.patch uploaded by howardwilkinson (license 590)
 Tested by: jpeeler

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@165767 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoSet the process group ID on the MOH process so that all children will get killed
Russell Bryant [Thu, 18 Dec 2008 18:52:18 +0000 (18:52 +0000)] 
Set the process group ID on the MOH process so that all children will get killed

(closes issue #14099)
Reported by: caspy
Patches:
      res_musiconhold.c.patch.killpg.try2 uploaded by caspy (license 645)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@165661 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoOnly care about a compatible codec for early bridging if we are actually bridging...
Joshua Colp [Thu, 18 Dec 2008 17:11:42 +0000 (17:11 +0000)] 
Only care about a compatible codec for early bridging if we are actually bridging to another channel. If we are not we actually want to bring the audio back to us.
(closes issue #13545)
Reported by: davidw

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@165591 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoDo not crash if we are not passed in a followme id.
Joshua Colp [Thu, 18 Dec 2008 16:07:37 +0000 (16:07 +0000)] 
Do not crash if we are not passed in a followme id.
(closes issue #14106)
Reported by: ys
Patches:
      app_followme.c.2.diff uploaded by ys (license 281)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@165537 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoReverse the fix from issue #6176 and add proper handling for that issue.
Tilghman Lesher [Wed, 17 Dec 2008 21:14:37 +0000 (21:14 +0000)] 
Reverse the fix from issue #6176 and add proper handling for that issue.
(Closes issue #13962, closes issue #13363)
Fixed by myself (license 14)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@165317 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix some memory leaks found while looking at how realtime
Mark Michelson [Wed, 17 Dec 2008 20:51:38 +0000 (20:51 +0000)] 
Fix some memory leaks found while looking at how realtime
configs are handled.

Also cleaned up some coding guidelines violations in app_realtime.c,
mostly related to spacing

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@165255 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoAfter looking through SIP registration code most of the day, this
Mark Michelson [Tue, 16 Dec 2008 23:04:27 +0000 (23:04 +0000)] 
After looking through SIP registration code most of the day, this
is one of the few things I could find that was just plain wrong.
Even though it probably isn't possible for it to happen, it seems weird
to have code that checks if a pointer is NULL and then immediately dereferences
that pointer if it was NULL.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164977 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix an issue where DEBUG_THREADS may erroneously report that a thread
Russell Bryant [Tue, 16 Dec 2008 21:38:29 +0000 (21:38 +0000)] 
Fix an issue where DEBUG_THREADS may erroneously report that a thread
is exiting while holding a lock.

If the last lock attempt was a trylock, and it failed, it will still be in the
list of locks so that it can be reported.

(closes issue #13219)
Reported by: pj

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164881 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoDo not dereference the channel if AST_PBX_KEEPALIVE has been returned.
Russell Bryant [Tue, 16 Dec 2008 21:10:44 +0000 (21:10 +0000)] 
Do not dereference the channel if AST_PBX_KEEPALIVE has been returned.

This is a bug I noticed while looking at the code for app_macro.  This return code
means that another thread has assumed ownership of the channel and it can no longer
be touched.  (I hate this return code with a passion, by the way.)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164876 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoAdd "restart gracefully" to the AMI blacklist of CLI commands.
Russell Bryant [Tue, 16 Dec 2008 20:35:25 +0000 (20:35 +0000)] 
Add "restart gracefully" to the AMI blacklist of CLI commands.

"module unload" was already identified as a command that can not be used
from the AMI.  "restart gracefully" effectively unloads all modules, and will
run in to the same problems.

(closes issue #13894)
Reported by: kernelsensei

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164806 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix memory leak and invalid reporting issues with DEBUG_THREADLOCALS.
Russell Bryant [Tue, 16 Dec 2008 17:06:29 +0000 (17:06 +0000)] 
Fix memory leak and invalid reporting issues with DEBUG_THREADLOCALS.

One issue was that the ast_mutex_* API was being used within the context of the
thread local data destructors.  We would go off and allocate more thread local data
while the pthread lib was in the middle of destroying it all.  This led to a memory
leak.

Another issue was an invalid argument being provided to the the object_add
API call.

(closes issue #13678)
Reported by: ys
Tested by: russell

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164736 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix a memory leak related to the use of the "setvar" configuration option.
Russell Bryant [Tue, 16 Dec 2008 15:56:37 +0000 (15:56 +0000)] 
Fix a memory leak related to the use of the "setvar" configuration option.

The problem was that these variables were being appended to the list of vars
on the sip_pvt every time a re-registration or re-subscription came in.
Since it's just a waste of memory to put them there unless the request was an
INVITE, then the fix is to check the request type before copying the vars.

(closes issue #14037)
Reported by: marvinek
Tested by: russell

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164672 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoI added a sentence to clarify why - and ' ' are ignored in patterns
Steve Murphy [Tue, 16 Dec 2008 15:15:58 +0000 (15:15 +0000)] 
I added a sentence to clarify why - and ' ' are ignored in patterns
as per bug 14076. Leif says he'll put some stuff about it in the
extensions.conf sample, etc.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164634 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoDon't try to change working directory if a directory was not configured.
Russell Bryant [Tue, 16 Dec 2008 14:28:10 +0000 (14:28 +0000)] 
Don't try to change working directory if a directory was not configured.

(closes issue #14089)
Reported by: caspy

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164605 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoAdd the deadlock note to ast_spawn_extension as well
Mark Michelson [Mon, 15 Dec 2008 19:53:08 +0000 (19:53 +0000)] 
Add the deadlock note to ast_spawn_extension as well

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164422 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoAdd notes to autoservice and pbx doxygen regarding a potential
Mark Michelson [Mon, 15 Dec 2008 19:45:07 +0000 (19:45 +0000)] 
Add notes to autoservice and pbx doxygen regarding a potential
deadlock scenario so that it is avoided in the future

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164416 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoDo not try to unlock a non-existant channel if the transfer fails.
Joshua Colp [Mon, 15 Dec 2008 18:11:21 +0000 (18:11 +0000)] 
Do not try to unlock a non-existant channel if the transfer fails.
(closes issue #13800)
Reported by: dwagner
Patches:
      asterisk-1.4.22-chan-sip-nullp.patch uploaded by tweety (license 608)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164350 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoUse autoconf logic to determine whether the system has timersub or not. Do not blindl...
Joshua Colp [Mon, 15 Dec 2008 17:43:59 +0000 (17:43 +0000)] 
Use autoconf logic to determine whether the system has timersub or not. Do not blindly assume Solaris does not.
(closes issue #13838)
Reported by: ano

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164343 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoCan we try not to assign an unsigned int to -1?
Joshua Colp [Mon, 15 Dec 2008 15:05:08 +0000 (15:05 +0000)] 
Can we try not to assign an unsigned int to -1?
(closes issue #14074)
Reported by: wetwired

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164204 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoHandle a case where a call can be bridged to a channel that is still ringing.
Russell Bryant [Mon, 15 Dec 2008 14:31:37 +0000 (14:31 +0000)] 
Handle a case where a call can be bridged to a channel that is still ringing.

The issue that was reported was about a case where a RINGING channel got
redirected to an extension to pick up a call from parking.  Once the parked
call got taken out of parking, it heard silence until the other side answered.
Ideally, the caller that was parked would get a ringing indication.  This patch
fixes this case so that the caller receives ringback once it comes out of
parking until the other side answers.

The fixes are:

 - Make sure we remember that a channel was an outgoing channel when doing
   a masquerade.  This prevents an erroneous ast_answer() call on the channel,
   which causes a bogus 200 OK to be sent in the case of SIP.

 - Add some additional comments to explain related parts of code.

 - Update the handling of the ast_channel visible_indication field.  Storing
   values that are not stateful is pointless.  Control frames that are events
   or commands should be ignored.

 - When a bridge first starts, check to see if the peer channel needs to be
   given ringing indication because the calling side is still ringing.

 - Rework ast_indicate_data() a bit for the sake of readability.

(closes issue #13747)
Reported by: davidw
Tested by: russell
Review: http://reviewboard.digium.com/r/90/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164201 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoChange the default calldurationlimit from the special value 0 to -1, so we
Tilghman Lesher [Sat, 13 Dec 2008 23:22:02 +0000 (23:22 +0000)] 
Change the default calldurationlimit from the special value 0 to -1, so we
can better detect an exceptional case.  This follows on to the changes made
in revision 156386.  Related to issue #13851.
(closes issue #13974)
 Reported by: paradise
 Patches:
       20081208__bug13974.diff.txt uploaded by Corydon76 (license 14)
 Tested by: file, blitzrage, ZX81

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164082 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoSet the reviewboard:url property on 1.4, as well
Russell Bryant [Fri, 12 Dec 2008 22:20:26 +0000 (22:20 +0000)] 
Set the reviewboard:url property on 1.4, as well

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163785 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoSimple fix for Ctrl-C not immediately exiting Asterisk, but also add a
Tilghman Lesher [Fri, 12 Dec 2008 22:03:10 +0000 (22:03 +0000)] 
Simple fix for Ctrl-C not immediately exiting Asterisk, but also add a
pointer inside editline to look back to asterisk.c, so others don't spend
as much time as I did looking (in the wrong place) for the appropriate
function.
Reported by: ZX81, via the #asterisk-users channel
Fixed by: me (license 14)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163761 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoSpecify uint32_t for variables storing a CRC32 so that it is actually 32 bits
Russell Bryant [Fri, 12 Dec 2008 14:40:31 +0000 (14:40 +0000)] 
Specify uint32_t for variables storing a CRC32 so that it is actually 32 bits
on 64-bit machines, as well.

(inspired by issue #13879)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163511 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoResolve issues that could cause DTMF to be processed out of order.
Russell Bryant [Fri, 12 Dec 2008 13:44:08 +0000 (13:44 +0000)] 
Resolve issues that could cause DTMF to be processed out of order.

These changes come from team/russell/issue_12658

1) Change autoservice to put digits on the head of the channel's frame readq
   instead of the tail.  If there were frames on the readq that autoservice
   had not yet read, the previous code would have resulted in out of order
   processing.  This required a new API call to queue a frame to the head
   of the queue instead of the tail.

2) Change up the processing of DTMF in ast_read().  Some of the problems
   were the result of having two sources of pending DTMF frames.  There
   was the dtmfq and the more generic readq.  Both were used for pending
   DTMF in various scenarios.  Simplifying things to only use the frame
   readq avoids some of the problems.

3) Fix a bug where a DTMF END frame could get passed through when it
   shouldn't have.  If code set END_DTMF_ONLY in the middle of digit emulation,
   and a digit arrived before emulation was complete, digits would get
   processed out of order.

(closes issue #12658)
Reported by: dimas
Tested by: russell, file
Review: http://reviewboard.digium.com/r/85/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163448 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoWhen a Ctrl-C or Ctrl-D ends a remote console, on certain shells, the terminal
Tilghman Lesher [Thu, 11 Dec 2008 23:35:55 +0000 (23:35 +0000)] 
When a Ctrl-C or Ctrl-D ends a remote console, on certain shells, the terminal
is messed up.  By intercepting those events with a signal handler in the remote
console, we can avoid those issues.
(closes issue #13464)
 Reported by: tzafrir
 Patches:
       20081110__bug13464.diff.txt uploaded by Corydon76 (license 14)
 Tested by: blitzrage

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163383 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoClean up the dundi cache every 5 minutes.
Matthew Nicholson [Thu, 11 Dec 2008 22:44:31 +0000 (22:44 +0000)] 
Clean up the dundi cache every 5 minutes.

(closes issue #13819)
Reported by: adomjan
Patches:
      pbx_dundi.c-clearcache.patch uploaded by adomjan (license 487)
      dundi_clearecache3.diff uploaded by mnicholson (license 96)
Tested by: adomjan

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163316 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix some observed slowdowns in dialplan processing.
Russell Bryant [Thu, 11 Dec 2008 21:46:29 +0000 (21:46 +0000)] 
Fix some observed slowdowns in dialplan processing.

The change is to remove autoservice usage from dialplan functions that do not
need it because they do not perform operations that potentially block.

(closes issue #13940)
Reported by: tbelder

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163253 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix an issue that made it so you could only have a single caller executing
Russell Bryant [Thu, 11 Dec 2008 16:54:51 +0000 (16:54 +0000)] 
Fix an issue that made it so you could only have a single caller executing
a custom feature at a time.  This was especially problematic when custom
features ran for any appreciable amount of time.

The fix turned out to be quite simple.  The dynamic features are now stored
in a read/write list instead of a list using a mutex.

(closes issue #13478)
Reported by: neutrino88
Fix suggested by file

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163092 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoDon't wait forever, if there's a specified recording timeout.
Tilghman Lesher [Thu, 11 Dec 2008 16:51:27 +0000 (16:51 +0000)] 
Don't wait forever, if there's a specified recording timeout.
(closes issue #13885)
 Reported by: bamby
 Patches:
       res_agi.c.patch uploaded by bamby (license 430)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163088 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoRevert this cast to long. Using time_t here causes build failures on a
Mark Michelson [Thu, 11 Dec 2008 16:46:22 +0000 (16:46 +0000)] 
Revert this cast to long. Using time_t here causes build failures on a
FreeBSD 32-bit build.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163084 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix a potential crash due to unsafe datastore handling.
Mark Michelson [Thu, 11 Dec 2008 16:24:43 +0000 (16:24 +0000)] 
Fix a potential crash due to unsafe datastore handling.

This patch also contains a conversion from using long to time_t
for representing times for a queue, as well as some whitespace
fixes.

(closes issue #14060)
Reported by: nivek
Patches:
      datastore_fixup.patch.corrected uploaded by nivek (license 636)
  with slight modification from me
Tested by: nivek

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163080 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoOops, inverted logic for a strcasecmp check. Pointed out by mmichelson, thanks!
Jeff Peeler [Wed, 10 Dec 2008 22:52:51 +0000 (22:52 +0000)] 
Oops, inverted logic for a strcasecmp check. Pointed out by mmichelson, thanks!

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162926 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years ago(closes issue #13229)
Jeff Peeler [Wed, 10 Dec 2008 22:04:18 +0000 (22:04 +0000)] 
(closes issue #13229)
Reported by: clegall_proformatique

Ensure that moh_generate does not return prematurely before local_ast_moh_stop is called. Also, the sleep in mp3_spawn now only occurs for http locations since it seems to have been added originally only for failing media streams.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162874 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix subscription based MWI up a bit. We only want to put sip: at the beginning of...
Joshua Colp [Wed, 10 Dec 2008 19:01:17 +0000 (19:01 +0000)] 
Fix subscription based MWI up a bit. We only want to put sip: at the beginning of the URI if it is not already there and revert code to ignore destination check if subscribing for MWI.
(closes issue #12560)
Reported by: vsauer
Patches:
      patch001.diff uploaded by ramonpeek (license 266)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162804 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoWhen a SIP peer unregisters set the expiry time back to 0 so that the 200 OK contains...
Joshua Colp [Wed, 10 Dec 2008 17:50:43 +0000 (17:50 +0000)] 
When a SIP peer unregisters set the expiry time back to 0 so that the 200 OK contains an expires of 0.
(closes issue #13599)
Reported by: hjourdain
Patches:
      chan_sip.c.diff uploaded by hjourdain (license 583)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162738 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years ago(closes issue #14022)
Steve Murphy [Wed, 10 Dec 2008 16:45:01 +0000 (16:45 +0000)] 
(closes issue #14022)
Reported by: wetwired
Tested by: murf

I checked, and I added a mod to the trunk version
of Asterisk that would make it 8-bit transparent
on 27 Nov 2007, but I made no such updates to
1.4. My best guess is that 1.4 was released, and
it was not appropriate to commit an enhancement.

But I'm going to add the same fixes to 1.4 now,
for the following reasons:
1. wetwired is correct; 1.4 is **mostly** 8-bit
   transparent now. This is because the lexical
   token forming rules use . in most 'word'
   state continuances.  It's just the beginning
   of a 'word' that is picky.
2. Accepting 8-bit chars in some places and
   not others leads to bug reports like this.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162671 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoUpdate to stringfield handling so that side-effects on
Mark Michelson [Wed, 10 Dec 2008 16:44:37 +0000 (16:44 +0000)] 
Update to stringfield handling so that side-effects on
parameters are not evaluated multiple times.

An example where this caused a problem was in chan_sip.c, with
the line

  ast_string_field_set(p, fromdomain, ++fromdomain);

This patch was originally uploaded to issue #13783 by
jamessan. While the issue was closed for other reasons, this
patch is valid and fixes a separate problem, and is thus
being committed.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162670 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoRevert fix for issue 13570. It has caused more problems than
Mark Michelson [Wed, 10 Dec 2008 16:24:56 +0000 (16:24 +0000)] 
Revert fix for issue 13570. It has caused more problems than
it helped to fix.

(closes issue #13783)
Reported by: navkumar

(closes issue #14025)
Reported by: ffs

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162663 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoAdd missing documentation to misdn.txt
Mark Michelson [Wed, 10 Dec 2008 16:10:25 +0000 (16:10 +0000)] 
Add missing documentation to misdn.txt

(closes issue #14052)
Reported by: festr
Patches:
      misdn.txt.patch uploaded by festr (license 443)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162659 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoIncrement the sequence number on the end packets for RFC2833. After reading the RFC...
Joshua Colp [Wed, 10 Dec 2008 16:05:29 +0000 (16:05 +0000)] 
Increment the sequence number on the end packets for RFC2833. After reading the RFC some more and doing some testing I agree with this change.
(closes issue #12983)
Reported by: vt
Patches:
      dtmf_inc_seqnum_on_end_pkts.diff uploaded by vt (license 520)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162653 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoOops, should be "tz", not "zonetag".
Tilghman Lesher [Tue, 9 Dec 2008 23:08:53 +0000 (23:08 +0000)] 
Oops, should be "tz", not "zonetag".

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162463 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoRemove the test_for_thread_safety() function completely.
Russell Bryant [Tue, 9 Dec 2008 22:17:39 +0000 (22:17 +0000)] 
Remove the test_for_thread_safety() function completely.

The test is not valid.  Besides, if we actually suspected that recursive
mutexes were not working, we would get a ton of LOG_ERROR messages when
DEBUG_THREADS is turned on.

(inspired by a discussion on the asterisk-dev list)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162413 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoWe appear to have documented tz= in the [general] section of voicemail.conf,
Tilghman Lesher [Tue, 9 Dec 2008 21:53:25 +0000 (21:53 +0000)] 
We appear to have documented tz= in the [general] section of voicemail.conf,
without actually having implemented it.  Oops.
(Reported by Olivier on the -users list)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162348 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoAdd 'down' as a valid state for directed call pickup. This creeps up when we receive...
Joshua Colp [Tue, 9 Dec 2008 21:14:29 +0000 (21:14 +0000)] 
Add 'down' as a valid state for directed call pickup. This creeps up when we receive session progress when dialing a device and not ringing.
(closes issue #14005)
Reported by: ddl

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162341 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix an issue where callers on an incoming call on an SLA trunk would not hear ringback.
Russell Bryant [Tue, 9 Dec 2008 20:57:35 +0000 (20:57 +0000)] 
Fix an issue where callers on an incoming call on an SLA trunk would not hear ringback.

We need to make sure that we don't start writing audio to the trunk channel until we're
actually ready to answer it.  Otherwise, the channel driver will treat it as inband
progress, even though all they are getting is silence.

(closes issue #12471)
Reported by: mthomasslo

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162286 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix double declaration of 'x' on the PPC platform.
Joshua Colp [Tue, 9 Dec 2008 20:44:32 +0000 (20:44 +0000)] 
Fix double declaration of 'x' on the PPC platform.
(closes issue #14038)
Reported by: ffloimair

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162273 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoIf we fail to start a thread for the pbx to run in, we need to
Mark Michelson [Tue, 9 Dec 2008 20:28:44 +0000 (20:28 +0000)] 
If we fail to start a thread for the pbx to run in, we need to
be sure to decrease the number of active calls on the system.

This fix may relate to ABE-1713, but it is not certain yet.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162265 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoIn discussion with seanbright on #asterisk-dev, I have added a default rule, and...
Steve Murphy [Tue, 9 Dec 2008 20:20:54 +0000 (20:20 +0000)] 
In discussion with seanbright on #asterisk-dev,  I have added a default rule, and an option to suppress the default rule from being generated in the flex output, for the sake of those OS's where they didn't tweak flex's ECHO macro, and the compiler doesn't like it. The regressions are OK with this.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162264 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoMake sure that the timestamp for DTMF is not the same as the previous voice frame...
Joshua Colp [Tue, 9 Dec 2008 19:47:07 +0000 (19:47 +0000)] 
Make sure that the timestamp for DTMF is not the same as the previous voice frame and do not send audio when transmitting DTMF as this confuses some equipment.
(closes issue #13209)
Reported by: ip-rob
Patches:
      13209.diff uploaded by file (license 11)
Tested by: ip-rob, bujones

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162204 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoTake video into account when early bridging RTP.
Joshua Colp [Tue, 9 Dec 2008 19:06:14 +0000 (19:06 +0000)] 
Take video into account when early bridging RTP.
(closes issue #13535)
Reported by: davidw

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162188 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoPrevious fix used ast_malloc and ast_copy_string and messed up the standalone stuff...
Steve Murphy [Tue, 9 Dec 2008 18:13:39 +0000 (18:13 +0000)] 
Previous fix used ast_malloc and ast_copy_string and messed up the standalone stuff. Fixed.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162136 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFor some reason, after a distclean, gcc started returning
Tilghman Lesher [Tue, 9 Dec 2008 17:07:50 +0000 (17:07 +0000)] 
For some reason, after a distclean, gcc started returning
'value computed is not used'.  Fixing (for --enable-dev-mode).

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162071 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoAllow DISA to handle extensions that start with #.
Russell Bryant [Tue, 9 Dec 2008 16:46:53 +0000 (16:46 +0000)] 
Allow DISA to handle extensions that start with #.

(closes issue #13330)
Reported by: jcovert

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162014 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years ago(closes issue #14019)
Steve Murphy [Tue, 9 Dec 2008 16:31:55 +0000 (16:31 +0000)] 
(closes issue #14019)
Reported by: ckjohnsonme
Patches:
      14019.diff uploaded by murf (license 17)
Tested by: ckjohnsonme, murf

This crash was the result of a few small errors that
would combine in 64-bit land to result in a crash.

32-bit land might have seen these combine to mysteriously
drop the args to an application call, in certain
circumstances.

Also, in trying to find this bug, I spotted
a situation in the flex input, where, in passing
back a 'word' to the parser, it would allocate
a buffer larger than necessary. I changed the
usage in such situations, so that strdup was
not used, but rather, an ast_malloc, followed
by ast_copy_string.

I removed a field from the pval struct, in
u2, that was never getting used, and set in
one spot in the code. I believe it was an
artifact of a previous fix to make switch
cases work invisibly with extens.

And, for goto's I removed a '!' from
before a strcmp, that has been there
since the initial merging of AEL2, that
might prevent the proper target of a
goto from being found. This was pretty
harmless on its own, as it would just
louse up a consistency check for users.

Many thanks to ckjohnsonme for providing
a simplified and complete set of information
about the bug, that helped considerably in
finding and fixing the problem.

Now, to get aelparse up and running again
in trunk, and out of its "horribly broken" state,
so I can run the regression suite!

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162013 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix a problem with GROUP() settings on a masquerade.
Russell Bryant [Tue, 9 Dec 2008 14:52:25 +0000 (14:52 +0000)] 
Fix a problem with GROUP() settings on a masquerade.

The previous code carried over group settings from the old channel to the new
one.  However, it did nothing with the group settings that were already on the
new channel.  This patch removes all group settings that already existed on the
new channel.

I have a more complicated version of this patch which addresses only the most
blatant problem with this, which is that a channel can end up with multiple
group settings in the same category.  However, I could not think of a use case
for keeping any of the group settings from the old channel, so I went this route
for now.

(closes AST-152)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@161948 65c4cc65-6c06-0410-ace0-fbb531ad65f3

17 years agoMake the usereqphone option work again.
Joshua Colp [Mon, 8 Dec 2008 17:52:10 +0000 (17:52 +0000)] 
Make the usereqphone option work again.
(closes issue #13474)
Reported by: mmaguire
Patches:
      20080912_bug13474.diff uploaded by mmaguire (license 571)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@161725 65c4cc65-6c06-0410-ace0-fbb531ad65f3