All pastes #1309316 Raw Edit

Mine

public text v1 · immutable
#1309316 ·published 2009-01-15 17:47 UTC
rendered paste body
------------------------------------------------------------------------
r165537 | file | 2008-12-18 11:07:37 -0500 (Thu, 18 Dec 2008) | 6 lines

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)

------------------------------------------------------------------------
r165591 | file | 2008-12-18 12:11:42 -0500 (Thu, 18 Dec 2008) | 4 lines

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

------------------------------------------------------------------------
r165661 | russell | 2008-12-18 13:52:18 -0500 (Thu, 18 Dec 2008) | 7 lines

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)

------------------------------------------------------------------------
r165767 | tilghman | 2008-12-18 16:14:47 -0500 (Thu, 18 Dec 2008) | 8 lines

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

------------------------------------------------------------------------
r165796 | russell | 2008-12-18 16:39:25 -0500 (Thu, 18 Dec 2008) | 11 lines

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/

------------------------------------------------------------------------
r165889 | russell | 2008-12-19 10:03:02 -0500 (Fri, 19 Dec 2008) | 9 lines

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)

------------------------------------------------------------------------
r165991 | jpeeler | 2008-12-19 14:48:00 -0500 (Fri, 19 Dec 2008) | 15 lines

(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);


------------------------------------------------------------------------
r166093 | murf | 2008-12-19 17:30:32 -0500 (Fri, 19 Dec 2008) | 133 lines

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/


------------------------------------------------------------------------
r166157 | mmichelson | 2008-12-19 18:34:57 -0500 (Fri, 19 Dec 2008) | 9 lines

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


------------------------------------------------------------------------
r166262 | russell | 2008-12-22 09:45:27 -0500 (Mon, 22 Dec 2008) | 7 lines

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/

------------------------------------------------------------------------
r166297 | russell | 2008-12-22 12:22:56 -0500 (Mon, 22 Dec 2008) | 2 lines

Fix up timeout handling in ast_carefulwrite().

------------------------------------------------------------------------
r166380 | mmichelson | 2008-12-22 15:56:29 -0500 (Mon, 22 Dec 2008) | 36 lines

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/


------------------------------------------------------------------------
r166509 | tilghman | 2008-12-22 23:05:25 -0500 (Mon, 22 Dec 2008) | 4 lines

Use the integer form of condition for integer comparisons.
(closes issue #14127)
 Reported by: andrew

------------------------------------------------------------------------
r166568 | mmichelson | 2008-12-23 10:16:26 -0500 (Tue, 23 Dec 2008) | 12 lines

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


------------------------------------------------------------------------
r166592 | tilghman | 2008-12-23 10:35:38 -0500 (Tue, 23 Dec 2008) | 3 lines

Compile, even if both DAHDI and Zaptel are not installed.
(Closes issue #14120)

------------------------------------------------------------------------
r166772 | russell | 2008-12-28 10:13:48 -0500 (Sun, 28 Dec 2008) | 4 lines

Use strncat() instead of an sprintf() in which source and target buffers overlap

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

------------------------------------------------------------------------
r166953 | tilghman | 2008-12-31 14:20:35 -0500 (Wed, 31 Dec 2008) | 5 lines

Also inherit the musiconhold class.
(Closes #14153)
Reported by: Jerry Geis, via the users list.
Patch by: me (license 14)

------------------------------------------------------------------------
r167095 | tilghman | 2008-12-31 19:01:22 -0500 (Wed, 31 Dec 2008) | 5 lines

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)

------------------------------------------------------------------------
r167179 | mmichelson | 2009-01-05 11:51:59 -0500 (Mon, 05 Jan 2009) | 41 lines

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


------------------------------------------------------------------------
r167260 | tilghman | 2009-01-06 15:48:05 -0500 (Tue, 06 Jan 2009) | 9 lines

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.
........

------------------------------------------------------------------------
r167299 | mmichelson | 2009-01-06 16:35:57 -0500 (Tue, 06 Jan 2009) | 8 lines

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)


------------------------------------------------------------------------
r167432 | russell | 2009-01-07 12:29:53 -0500 (Wed, 07 Jan 2009) | 4 lines

Treat an empty string the same way as a NULL country argument.

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

------------------------------------------------------------------------
r167541 | russell | 2009-01-07 17:03:59 -0500 (Wed, 07 Jan 2009) | 4 lines

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

------------------------------------------------------------------------
r167545 | russell | 2009-01-07 17:19:47 -0500 (Wed, 07 Jan 2009) | 2 lines

Only try to close the file if one was actually opened

------------------------------------------------------------------------
r167554 | russell | 2009-01-07 17:26:42 -0500 (Wed, 07 Jan 2009) | 2 lines

Don't fclose() the file early, the filestream destructor will handle it.

------------------------------------------------------------------------
r167566 | russell | 2009-01-07 17:35:36 -0500 (Wed, 07 Jan 2009) | 2 lines

Fix the last couple of places where free() was improperly used directly.

------------------------------------------------------------------------
r167620 | kpfleming | 2009-01-07 18:32:21 -0500 (Wed, 07 Jan 2009) | 5 lines

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/


------------------------------------------------------------------------
r167714 | kpfleming | 2009-01-08 12:24:21 -0500 (Thu, 08 Jan 2009) | 1 line

remove an unnecessary argument to queue_request()
------------------------------------------------------------------------
r167840 | tilghman | 2009-01-08 17:08:56 -0500 (Thu, 08 Jan 2009) | 6 lines

Don't truncate database results at 255 chars.
(closes issue #14069)
 Reported by: evandro
 Patches: 
       20081214__bug14069.diff.txt uploaded by Corydon76 (license 14)

------------------------------------------------------------------------
r168128 | mmichelson | 2009-01-09 15:08:04 -0500 (Fri, 09 Jan 2009) | 13 lines

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

------------------------------------------------------------------------
r168191 | rmudgett | 2009-01-09 16:28:42 -0500 (Fri, 09 Jan 2009) | 3 lines

*  Fix for JIRA AST-175/ABE-1757
*  Miscellaneous doxygen comments added.

------------------------------------------------------------------------
r168198 | russell | 2009-01-09 17:14:38 -0500 (Fri, 09 Jan 2009) | 2 lines

Make this compile for mvanbaak

------------------------------------------------------------------------
r168267 | kpfleming | 2009-01-09 18:12:29 -0500 (Fri, 09 Jan 2009) | 1 line

update to use new sound file packages that include license files
------------------------------------------------------------------------
r168379 | kpfleming | 2009-01-10 15:38:38 -0500 (Sat, 10 Jan 2009) | 1 line

small commit to test new server
------------------------------------------------------------------------
r168382 | kpfleming | 2009-01-10 15:47:31 -0500 (Sat, 10 Jan 2009) | 1 line

small commit to test new server
------------------------------------------------------------------------
r168480 | russell | 2009-01-12 09:57:27 -0500 (Mon, 12 Jan 2009) | 2 lines

s/ringdance/ringcadence/ for Bulgaria

------------------------------------------------------------------------
r168482 | mmichelson | 2009-01-12 09:58:25 -0500 (Mon, 12 Jan 2009) | 5 lines

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.


------------------------------------------------------------------------
r168507 | jpeeler | 2009-01-12 15:26:22 -0500 (Mon, 12 Jan 2009) | 9 lines

(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/


------------------------------------------------------------------------
r168516 | jpeeler | 2009-01-12 16:42:34 -0500 (Mon, 12 Jan 2009) | 5 lines

(closes issue #13881)
Reported by: hoowa

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

------------------------------------------------------------------------
r168546 | tilghman | 2009-01-13 12:48:00 -0500 (Tue, 13 Jan 2009) | 6 lines

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)

------------------------------------------------------------------------
r168551 | twilson | 2009-01-13 13:34:14 -0500 (Tue, 13 Jan 2009) | 7 lines

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)

------------------------------------------------------------------------
r168561 | russell | 2009-01-13 14:13:05 -0500 (Tue, 13 Jan 2009) | 2 lines

Revert unnecessary indications API change from rev 122314

------------------------------------------------------------------------
r168593 | twilson | 2009-01-13 20:27:18 -0500 (Tue, 13 Jan 2009) | 20 lines

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

------------------------------------------------------------------------
r168598 | mmichelson | 2009-01-14 11:19:26 -0500 (Wed, 14 Jan 2009) | 8 lines

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.


------------------------------------------------------------------------
r168603 | tilghman | 2009-01-14 14:02:55 -0500 (Wed, 14 Jan 2009) | 7 lines

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

------------------------------------------------------------------------
r168608 | murf | 2009-01-14 14:34:35 -0500 (Wed, 14 Jan 2009) | 1 line

app_page was failing to compile in dev-mode on my gcc-4.2.4 system. This change gets rid of the warning.
------------------------------------------------------------------------
r168614 | seanbright | 2009-01-14 15:52:00 -0500 (Wed, 14 Jan 2009) | 9 lines

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)

------------------------------------------------------------------------
r168622 | rmudgett | 2009-01-14 16:48:22 -0500 (Wed, 14 Jan 2009) | 4 lines

*  Fixed create_process() allocation of process ID values.
The allocated process IDs could overflow their respective
NT and TE fields.  Affects outgoing calls.

------------------------------------------------------------------------
r168628 | mmichelson | 2009-01-14 19:11:01 -0500 (Wed, 14 Jan 2009) | 16 lines

Fix some crashes from bad datastore handling in app_queue.c

* The queue_transfer_fixup function was searching for and removing
  the datastore from the incorrect channel, so this was fixed.

* Most datastore operations regarding the queue_transfer datastore
  were being done without the channel locked, so proper channel locking
  was added, too.

(closes issue #14086)
Reported by: ZX81
Patches:
      14086v2.patch uploaded by putnopvut (license 60)
Tested by: ZX81, festr


------------------------------------------------------------------------
r168633 | tilghman | 2009-01-14 20:20:20 -0500 (Wed, 14 Jan 2009) | 5 lines

Blocked revision 168632 from /branches/1.2:

1.2 regression on security fix AST-2009-001
(Closes issue #14238)

------------------------------------------------------------------------