Brett Bryant [Wed, 27 Jun 2007 23:22:13 +0000 (23:22 +0000)]
Reinstating patch. This actually fixes the problem, however I was running a development branch without it and mistakenly thought it wasn't fixed.
Fixes issue #10010, and #9654: 100% CPU usage caused by an asterisk console losing it's controlling terminal.
Russell Bryant [Wed, 27 Jun 2007 21:06:45 +0000 (21:06 +0000)]
Fix a minor issue with parsing the priority number. You could have as much
whitespace as you want around a numeric priority, but you couldn't have any
whitespace around a special priority like "n" or "hint".
(issue #10039, reported by mitheloc, fixed by me)
Joshua Colp [Wed, 27 Jun 2007 20:23:24 +0000 (20:23 +0000)]
I may possibly get shot for doing this... but... defer CDR processing until after the channel has been dealt with. This should eliminate all of the issues with channels going funky (SIP/PRI) when you are posting CDRs to a database that is either slow or unavailable and do not want to enable batching.
simplified generation for dummy bchannels, also we mark them as dummies, so they are not used later as real-bchannels, optimized the RESTART mechanisms, we block a channel now on cause:44, and send out a RESTART automatically, then on reception of RESTART_ACKNOWLEDGE we unblock the channel again.
for inbound TE calls, we setup the bchannel when we get the CONNECT_ACKNOWLEDGE, to make sure mISDN has everything ready. removed some #if 0 areas which weren't used anymore.
Brett Bryant [Fri, 22 Jun 2007 14:39:34 +0000 (14:39 +0000)]
Fixed infinite loop when controlling terminal was lost
and return value of input function wasn't checked for
errors. This would cause 100% cpu to be taken up.
(closes issue #9654, issue #10010)
Reported by: mnicholson, and eserra
Steve Murphy [Thu, 21 Jun 2007 22:29:50 +0000 (22:29 +0000)]
This little fix is in response to bug 10016, but may not cure it. The code is wrong, clearly. In a situation where you set the CDR's amaflags, and then ForkCDR, and then set the new CDR's amaflags to some other value, you will see that all CDRs have had their amaflags changed. This is not good. So I fixed it.
Steve Murphy [Thu, 21 Jun 2007 19:13:17 +0000 (19:13 +0000)]
it was pointed out that the cdr_custom config load could get a lock, and under certain circumstances, would never release it. I also noted that the situation where more than one mapping spec was warned about, but did not ignore further mappings as it had promised. I think I have fixed both situations.
Russell Bryant [Wed, 20 Jun 2007 18:45:38 +0000 (18:45 +0000)]
Fix a problem where an established call would not be properly disconnected
when a PRI disconnect is received depending on which cause code was received.
(issue #9588, original patch by softins, updated patch from jtexter3, and some
additional feedback from mhardeman)
on receiption of cause:44 we mark the channel as in use and inform the user about the situation, we need to test the RESTART stuff then. Also shuffled the empty_chan_in_stack function after the bchannel cleaning functions, to avoid race conditions.
Steve Murphy [Tue, 19 Jun 2007 18:07:59 +0000 (18:07 +0000)]
This fixes 9246, where channel variables are not available in the 'h' exten, on a 'ZOMBIE' channel. The fix is to consolidate the channel variables during a masquerade, and then copy the merged variables back onto the clone, so the zombie has the same vars that the 'original' has.
Russell Bryant [Tue, 19 Jun 2007 16:45:37 +0000 (16:45 +0000)]
Backport fix for crashes related to subscriptions from 1.4 ...
Fix a crash that could occur when handing device state changes.
When the state of a device changes, the device state thread tells the extension
state handling code that it changed. Then, the extension state code calls the
callback in chan_sip so that it can update subscriptions to that extension.
A pointer to a sip_pvt structure is passed to this function as the call which
needs a NOTIFY sent. However, there was no locking done to ensure that the pvt
struct didn't disappear during this process.
(issue #9946, reported by tdonahue, patch by me, patch updated to trunk to use
the sip_pvt lock wrappers by eliel)
Joshua Colp [Tue, 19 Jun 2007 12:57:55 +0000 (12:57 +0000)]
Add parked call extension AFTER the parking slot has been announced, otherwise two threads will try to handle the same channel and it will go kaboom. (issue #9191 reported by japple)
Joshua Colp [Mon, 18 Jun 2007 18:13:03 +0000 (18:13 +0000)]
Set the peer name on the dialog to the one configured in sip.conf and NOT the username to be used for authentication attempts. (issue #9967 reported by achauvin)
Russell Bryant [Thu, 14 Jun 2007 20:56:19 +0000 (20:56 +0000)]
Backport rev 69010 from the 1.4 branch ...
In ast_channel_make_compatible(), just return if the channels' read and write
formats already match up. There are code paths that call this function on a
pair of channels multiple times. This made calls fail that were using g729
in some cases. The reason is that codec_g729a will unregister itself from the
list of available translators will all licenses are in use. So, the first
time the function got called, the right translation path was allocated.
However, the second time it got called, the code would not find a translation
path to/from g729 and make the call fail, even if the channel actually already
had a g729 translation path allocated.
added check for NULL Pointer when calling misdn_new. Asterisk does not allow us to create channels anymore when stop gracefully is used :). also modified the restart_indicator to 0
fixed problem that the dummybc chanels had no lock, checking for the lock now. Also fixed the channel restart stuff, we can now specify and restart particular channels too.
Joshua Colp [Fri, 8 Jun 2007 00:15:33 +0000 (00:15 +0000)]
Don't call ast_waitstream_full when the control file descriptor and audio file descriptor are not set, simply call ast_waitstream! (issue #8530 reported by rickead2000)
Russell Bryant [Thu, 7 Jun 2007 23:13:33 +0000 (23:13 +0000)]
Fix a problem where saying a character wouldn't properly break out when the caller pressed '#'
(issue #8113, reported by patbaker82, patch from jamesgolovich (hey, long time no see!) and patbaker82)
Russell Bryant [Wed, 6 Jun 2007 16:40:51 +0000 (16:40 +0000)]
We have some bug reports showing crashes due to a double free of a channel.
Add a sanity check to ast_channel_free() to make sure we don't go on trying
to free a channel that wasn't found in the channel list.
(issue #8850, and others...)
simplified the EVENT_SETUP handling in the cb_events function a lot. Commented the different possibilities a bit and made functions of shared code. When the dialed extension does not exist in the extensions.conf we'll jump into the 'i' extension if this does exist, else we disconnect the call with the cause:1 = No Route to Destination.
Joshua Colp [Thu, 31 May 2007 16:12:39 +0000 (16:12 +0000)]
It is now possible for this path of execution to have the frame pointer be NULL, therefore we need to check for it before trying to access it. (issue #9836 reported by barthpbx)
we should only activate the generator in chan_misdn, when asterisk hask not yet taken the call (WAITING4DIGS state). Alerting audio will be generated fomr asterisk for example.
Russell Bryant [Tue, 22 May 2007 13:07:03 +0000 (13:07 +0000)]
Fix a memory leak that I just noticed in the device state handling in app_queue.
On most device state changes, it would leak roughly 8 to 64 bytes (the length of
the name of the device).
we stop the tones only when we're in the pre-call phase, otherwise e.g. when in CONNECTED state we should not stop tones when we receive an Information Message
Steve Murphy [Fri, 18 May 2007 20:56:20 +0000 (20:56 +0000)]
This update will fix the situation that occurs as described by 9717, where when several targets are specified for a dial, if any one them reports FAIL, the whole call gets FAIL, even though others were ringing OK. I rearranged the priorities, so that a new disposition, NULL, is at the lowest level, and the disposition get init'd to NULL. Then, next up is FAIL, and next up is BUSY, then NOANSWER, then ANSWERED. All the related set routines will only do so if the disposition value to be set to is greater than what's already there. This gives the intended effect. So, if all the targets are busy, you'd get BUSY for the call disposition. If all get BUSY, but one, and that one rings is not answered, you get NOANSWER. If by some freak of nature, the NULL value doesn't get overridden, then the disp2str routine will report NOANSWER as before.
Olle Johansson [Fri, 18 May 2007 15:12:09 +0000 (15:12 +0000)]
Issue 9235 - part of the problem, maybe not all. Please retry with this patch (and no
other patch) if you have problems with hanging SIP channels. Thank you.
A special Thank You to WeBRainstorm that gave me access to his system.
in the case immediate=yes, we directly jump into the dialplan, where people can use PlayTones to indicate a Dialtone, so we don't need to to that by ourself. also we should not do a dialtone_indicate for incoming calls on a TE port in overlapdialmode.
Joshua Colp [Mon, 14 May 2007 18:34:06 +0000 (18:34 +0000)]
Only perform stripping of - strings from the channel name for Zap channels. Anywhere else we might remove a legitimate part of a device name. (issue #9668 reported by stevedavies)
Joshua Colp [Wed, 9 May 2007 16:51:03 +0000 (16:51 +0000)]
Properly handle hints that point to multiple devices in chan_sip. Why chan_sip is even doing this I have no idea but I would rather not go into a rant. (issue #9536 reported by rlister)
added application misdn_check_l2l1 which tries to pull up the L1/L2 on all ports that have the layers down in a group. It waits then for a timeout. This helps for scenarios where multiple PMP BRIs are grouped together, or where a provider has a faulty PTP Implementation, that looses the L2 after a while.