Mark Michelson [Thu, 29 Nov 2007 19:38:39 +0000 (19:38 +0000)]
This patch handles the case where a queue member with a negative penalty is added
via the manager. If a negative value is submitted for a member penalty, we set it to 0.
(closes issue #11411, reported and patched by Laureano)
Russell Bryant [Thu, 29 Nov 2007 00:20:34 +0000 (00:20 +0000)]
This set of changes is to make some callerID handling thread-safe.
The ast_set_callerid() function needed to lock the channel. Also, the handlers
for the CALLERID() dialplan function needed to lock the channel when reading
or writing callerid values directly on the channel structure.
Mark Michelson [Wed, 28 Nov 2007 22:08:50 +0000 (22:08 +0000)]
Removing some seemingly pointless code. This sets a channel variable for every priority
executed in the dialplan if you have debug set to anything non-zero. This seems pointless
due to the fact that these channel variables are not referenced anywhere else in the code and
their names are esoteric enough that they would not be practical to reference in the dialplan. Plus
the fact that this behavior isn't documented anywhere means that the change is not likely to cause
any disruption. If anything, this may actually cause a slight performance increase if running with
debug on.
The motivating influence for this code change is the eventwhencalled option for queues. If set to
vars, all channel variables will be output to the manager. These unnecessary channel variables make
the output a lot more difficult to deal with.
Mark Michelson [Wed, 28 Nov 2007 17:30:47 +0000 (17:30 +0000)]
Recording greetings when using IMAP storage was causing zero-length files to be stored.
Since greetings are not retrieved from IMAP anyway, it is pointless to attempt storing them there.
(closes issue #11359, reported by spditner, patched by me)
Russell Bryant [Wed, 28 Nov 2007 00:20:13 +0000 (00:20 +0000)]
- update documentation for some of the goto functions to note that they
handle locking the channel as needed
- update ast_explicit_goto() to lock the channel as needed
Mark Michelson [Tue, 27 Nov 2007 23:10:05 +0000 (23:10 +0000)]
Two changes with regards to the 'eventwhencalled' option of queues.conf
1) Due to some signed vs. unsigned silliness, setting 'eventwhencalled' to
'vars' or 'yes' did exactly the same thing. Thus the sign change of the
ast_true call.
2) The vars2manager function overwrote a \n for every channel variable it parsed, resulting
in bizarre output for the channel variables. This patch remedies this.
(related to issue #11385, however I'm not sure if this will actually be enough to close it)
Russell Bryant [Tue, 27 Nov 2007 21:45:51 +0000 (21:45 +0000)]
Merge changes from team/russell/autoservice_1.4
This set of changes fixes an issue that was reported to me on IRC yesterday.
The user, d1mas, was using chan_zap for incoming calls and was having DTMF
recognition issues in some situations. Specifically, he noticed that the
problem occurred when using DISA or WaitExten. He also noticed that when
using Read, the problem did not occur. His system also used DUNDi for
dialplan lookups.
So, he theorized that if the DUNDi lookups blocked for some period of time,
that audio from the zap channel could get lost. If the audio got lost, then
it wouldn't be run through the DTMF detector, and digits could get lost.
He was correct, and the following set of changes fixes the problem. However,
the changes go a little bit further than what was necessary to fix this exact
problem.
1) I updated pbx_extension_helper() to autoservice the associated channel to
handle cases where extension lookups may take a long time. This would
normally be a dialplan switch that does some lookup over the network, such
as the DUNDi or IAX2 switches.
This ensures that even while a DUNDi lookup is blocking, the channel will be
continuously serviced.
2) I made a change to the autoservice code. This is actually something that
has bothered me for a long time. When a channel is in autoservice, _all_
frames get thrown away. However, some frames really shouldn't be thrown
away. The most notable examples are signalling (CONTROL) frames, and DTMF.
So, this patch queues up important frames while a channel is in autoservice.
When autoservice is stopped on the channel, the queued up frames get stuck
back on the channel so that they can get processed instead of thrown away.
3) I made another change to the autoservice code to handle the case where
autoservice is started on channels recursively.
Previously, you could call ast_autoservice_start() multiple times on a
channel, and it would stop the first time ast_autoservice_stop() gets
called. Now, it will ensure that autoservice doesn't actually stop until
the final call to ast_autoservice_stop().
Kevin P. Fleming [Tue, 27 Nov 2007 20:16:56 +0000 (20:16 +0000)]
on second thought... revert all the other changes i've made in app options parsing leaving only one: if an empty argument is supplied for an option, set that argument pointer to point to an empty string rather than NULL, so that the application can do normal checks on it without worrying about it being NULL
Olle Johansson [Tue, 27 Nov 2007 15:23:17 +0000 (15:23 +0000)]
If we get a codec offer using a well-known payload type, but using it for another
codec that we don't know, Asterisk did not remove that codec from the list.
With this patch, we remove the codec from audio and video rtp objects and
deny it ever existed. Thanks to lasse for testing.
(closes issue #11376)
Reported by: lasse
Patches:
bug11376.txt uploaded by oej (license 306)
Tested by: lasse
Steve Murphy [Tue, 27 Nov 2007 06:24:02 +0000 (06:24 +0000)]
closes issue #11379; OK, this is an attempt to make both sides happy. To the cdr.conf file, I added the option 'unanswered', which defaults to 'no'. In this mode, you will see a cdr for a call, whether it was answered or not. The disposition will be NO ANSWER or ANSWERED, as appropriate. The src is as you'd expect, the destination channel will be one of the channels from the Dial() call, usually the last in the list if more than one chan was specified. With unanswered set to 'yes', you will still see this cdr entry in both cases. But in the case where the dial timed out, you will also see a cdr for each line attempted, marked NO ANSWER, with no destination channel name. The new option defaults to 'no', so you don't see the pesky extra cdr's by default, and you will not see the irritating 'not posted' messages.
Mark Michelson [Mon, 26 Nov 2007 23:10:49 +0000 (23:10 +0000)]
After issuing a "say load new", if a caller hangs up during the middle of playback of a number,
app_playback will continue to try to play the remaining files. With this change, no more files will
be played back upon hangup.
(closes issue #11345, reported and patched by IgorG)
Mark Michelson [Mon, 26 Nov 2007 23:02:30 +0000 (23:02 +0000)]
After issuing a "say load new" tons of warning messages are printed
out to the CLI every time do_say in app_playback is called. Removing these
warnings
Joshua Colp [Mon, 26 Nov 2007 21:10:29 +0000 (21:10 +0000)]
Fix issues with async dialing with an application executing. The application has to be terminated and control returned to the thread before hanging things up. (issue #BE-252)
Joshua Colp [Mon, 26 Nov 2007 17:36:45 +0000 (17:36 +0000)]
Use ast_free to free memory, or else we shall implode if MALLOC_DEBUG is enabled.
(closes issue #11347)
Reported by: ys
Patches:
pbx.pbx_config.c.diff uploaded by ys (license 281)
Joshua Colp [Mon, 26 Nov 2007 17:20:58 +0000 (17:20 +0000)]
Close the audio file before sending it to the post processing application.
(closes issue #11357)
Reported by: reformed
Patches:
mixmonitor.patch uploaded by reformed (license 330)
Joshua Colp [Mon, 26 Nov 2007 15:34:38 +0000 (15:34 +0000)]
If channel allocation fails because the alert pipe could not be created also free the scheduler context.
(closes issue #11355)
Reported by: eliel
Patches:
main.channel.c.patch uploaded by eliel (license 64)
Tilghman Lesher [Sun, 25 Nov 2007 17:17:10 +0000 (17:17 +0000)]
We previously attempted to use the ESCAPE clause to set the escape delimiter to
a backslash. Unfortunately, this does not universally work on all databases,
since on databases which natively use the backslash as a delimiter, the
backslash itself needs to be delimited, but on other databases that have no
delimiter, backslashing the backslash causes an error.
So the only solution that I can come up with is to create an option in res_odbc
that explicitly specifies whether or not backslash is a native delimiter. If
it is, we use it natively; if not, we use the ESCAPE clause to make it one.
Tilghman Lesher [Sat, 24 Nov 2007 06:19:23 +0000 (06:19 +0000)]
Currently, zero-length voicemail messages cause a hangup in VoicemailMain.
This change fixes the problem, with a multi-faceted approach. First, we
do our best to avoid these messages from being created in the first place,
and second, if that fails, we detect when the voicemail message is
zero-length and avoid exiting at that point.
Reported by: dtyoo
Patch by: gkloepfer,tilghman
(Closes issue #11083)
Tilghman Lesher [Fri, 23 Nov 2007 17:18:26 +0000 (17:18 +0000)]
Up until this point, the XML output of the manager has been technically
invalid, due to the repetition of certain parameters in a single event.
This caused various issues for XML parsers, some of which refused to parse
at all, given the invalidity of the rendered XML. So this commit fixes
the XML output, ensuring that each entity parameter has a unique name, thus
ensuring valid XML.
Reported by: msetim
Patch by: tilghman
(Closes issue #10220)
Mark Michelson [Wed, 21 Nov 2007 19:24:22 +0000 (19:24 +0000)]
Changing an inaccurate debug message to be less inaccurate. Under the circumstances, this
message would always report that there were 0 members available, even though that may not be true.
Terry Wilson [Wed, 21 Nov 2007 18:59:27 +0000 (18:59 +0000)]
If a channel gets masqueraded in the middle of a park, don't play the
announcement to the masqueraded channel, and dial back to the original
channel on timeout.
Kevin P. Fleming [Tue, 20 Nov 2007 19:12:52 +0000 (19:12 +0000)]
bring back compile-option checking when loading modules, only this time use a string-based storage and comparison mechanism because it is easier to support on other platforms
Mark Michelson [Tue, 20 Nov 2007 17:50:31 +0000 (17:50 +0000)]
According to comments in main/pbx.c, it is essential that if we are going to lock
the conlock as well as the hints lock, it must be locked in that respective order.
In order to prevent a potential deadlock, we need to lock the conlock prior to
locking the hints lock in ast_hint_state_changed (see the call stack example on
issue #11323 for how this can happen).
(closes issue #11323, reported by eelcob, suggestion for patch by eelcob, patch by me)
Joshua Colp [Mon, 19 Nov 2007 15:53:32 +0000 (15:53 +0000)]
Print out the correct filename (features.conf) in the log message when parkpos options are incorrect.
(closes issue #11295)
Reported by: Laureano
Patches:
res_features.c.patch uploaded by Laureano (license 265)
Joshua Colp [Mon, 19 Nov 2007 15:24:12 +0000 (15:24 +0000)]
Clarify documentation a bit, include that a frame has to pass through the core in order for the Local channel optimization to happen.
(closes issue #11246)
Reported by: jon
Russell Bryant [Fri, 16 Nov 2007 22:26:44 +0000 (22:26 +0000)]
Temporarily revert revision 89325, which added md5 magic for keeping track of
what build options were used. We agreed that we should remove this before
making a 1.4 release, and then we can put it back in. Then, we can take a
month or so to play around with it to get it how we want it.
Kevin P. Fleming [Fri, 16 Nov 2007 16:47:46 +0000 (16:47 +0000)]
To help combat problems where people build external modules (asterisk-addons or others) and then change the build options of the Asterisk build in a way that makes the incompatible without warning, this commit introduces an MD5 signature of the important build-time options and includes that signature into modules when they are built. When the loader loads one of these modules and notices the problem, it will emit a warning to console and refuse to initialize the module, as doing so could cause the system to be unstable or even crash.
If you upgrade to this version of Asterisk, you must rebuild *all* of your modules that came from other sources before trying to run this version. If you are using Digium's G.729 binary codec module, you will need v33 or newer.
Russell Bryant [Thu, 15 Nov 2007 17:19:28 +0000 (17:19 +0000)]
Update the SLAStation application to account for the case where the SLA thread
has a call out to the station, but the user has pressed a line button to answer
the call instead of picking up the handset. If they do, the phone sends out a
new INVITE. So, the SLAStation app must check to see if it is picking up a
ringing trunk, and ensure that the other stations stop ringing.
(reported internally, patched by me, tested by mogorman)
Jason Parker [Tue, 13 Nov 2007 19:47:45 +0000 (19:47 +0000)]
Revert change from revision 67064.
It is documented behavior that if a parking extension already exists while using PARKINGEXTEN,
dialplan execution will continue. If blind transferring to a Park with PARKINGEXTEN, you
must keep this in mind, and handle the failure yourself.
Tilghman Lesher [Tue, 13 Nov 2007 13:51:53 +0000 (13:51 +0000)]
Debugging is running into the 16-lock limit. Increase to avoid.
(This define is only effective when debugging is turned on, so there's
no effect for most installations.)
Mark Michelson [Tue, 13 Nov 2007 00:56:46 +0000 (00:56 +0000)]
Some sanity checking for MixMonitor. If only 1 argument is given, then the args.options
and args.post_process strings are uninitialized and could contain garbage. This change
handles this situation properly by only using arguments that we have parsed.
Tilghman Lesher [Mon, 12 Nov 2007 20:16:18 +0000 (20:16 +0000)]
If two config writes collide, file corruption could result. Use a mkstemp() file, instead.
Reported by: paravoid
Patch by: tilghman
Closes issue #10781
if we're NT and no number was dialed and overlapdial is set, we wait for the ISDN timeout instead of starting our own timer. added a comment for the misdn.conf.sample for the overlapdial config option.
added restart all interfaces Restart_Indicator, to automatically send a RESTART after the L2 of a PTP Port comes up. Also fixed some places where we have send a RELEASE without need for it.
fixed a state/event issue with overlapdial=yes when no extension matched. removed the general sending of a RELEASE_COMPLETE when we receive a RELEASE, this is done by mISDNuser/mISDN. This makes it possible to use asterisk-1.4 with mISDN trunk, but requires users of mISDN/mISDNuser-1.1.X to upgrade to at least mISDNuser-1.1.6 (when using the NT mode at all)
aded ntkeepcalls option, to avoid droÃpping calls when the L2 goes down on a PTP link. There are some pbx which do turn off the L1 for a very short while and restart it immediately. normally T310 should be started and after 10 seconds or so the calls should be dropped, this is a simple fix wihtout this timer.
Mark Michelson [Thu, 8 Nov 2007 16:47:23 +0000 (16:47 +0000)]
I made this same adjustment in trunk to fix a bug, and it makes sense to do it in 1.4 as
well. If an imapfolder is specified in voicemail.conf, don't ever explicitly connect to
INBOX since it may not exist.
Joshua Colp [Thu, 8 Nov 2007 01:28:56 +0000 (01:28 +0000)]
Improve the devicestate logic for multiple devices. If any are available then the extension is considered available.
(closes issue #10164)
Reported by: nic_bellamy
Patches:
sip-hinting-svn-branch-1.4.patch uploaded by nic (license 299)
Joshua Colp [Thu, 8 Nov 2007 01:11:25 +0000 (01:11 +0000)]
Add support for allowing one outgoing transaction. This means if a response comes back out of order chan_sip will still handle it. I dream of a chan_sip with real transaction support.
(closes issue #10946)
Reported by: flefoll
(closes issue #10915)
Reported by: ramonpeek
(closes issue #9567)
Reported by: atca_pres
Tilghman Lesher [Wed, 7 Nov 2007 23:39:37 +0000 (23:39 +0000)]
The member refcount must be incremented, to avoid using it after deallocation.
A huge thanks go to lvl- for patiently providing the necessary valgrind output
that was necessary to finding this problem of memory corruption.
Reported by: lvl-
Patch by: tilghman
Closes issue #11174
Mark Michelson [Wed, 7 Nov 2007 22:40:35 +0000 (22:40 +0000)]
This patch makes it possible for SIP phones to dial extensions defined with '#' characters
in extensions.conf AND maintain their escaped characters when forming URI's
(closes issue #10681, reported by cahen, patched by me, code review by file)
Steve Murphy [Wed, 7 Nov 2007 21:40:28 +0000 (21:40 +0000)]
In response to 10578, I just ran 1.4 thru valgrind; some of the config leakage I've already fixed, but it doesn't hurt to double check. I found and fixed leaks in res_jabber, cdr_tds, pbx_ael. Nothing major, tho.