Russell Bryant [Wed, 27 Sep 2006 16:54:30 +0000 (16:54 +0000)]
Fix a problem that occurred if a user entered a digit that matched a bridge
feature that was configured using multiple digits, and the digit that was
pressed timed out in the feature digit timeout period. For example, if blind
transfer is configured as '##', and a user presses just '#'. In this situation,
the call would lock up and no longer pass any frames.
(issue #7977 reported by festr, and issue #7982 reported by michaels and
valuable input provided by mneuhauser and kuj. Fixed by me, with testing help
and peer review from Joshua Colp).
There are a couple of issues involved in this fix:
1) When ast_generic_bridge determines that there has been a timeout, it returned
AST_BRIDGE_RETRY. Then, when ast_channel_bridge gets this result, it calls
ast_generic_bridge over again with the same timestamp for the next event.
This results in an endless loop of nothing until the call is terminated.
This is resolved by simply changing ast_generic_bridge to return
AST_BRIDGE_COMPLETE when it sees a timeout.
2) I also changed ast_channel_bridge such that if in the process of calculating
the time until the next event, it knows a timeout has already occured, to
immediately return AST_BRIDGE_COMPLETE instead of attempting to bridge the
channels anyway.
3) In the process of testing the previous two changes, I ran into a problem in
res_features where ast_channel_bridge would return because it determined
that there was a timeout. However, ast_bridge_call in res_features would
then determine by its own calculation that there was still 1 ms before the
timeout really occurs. It would then proceed, and since the bridge broke
out and did *not* return a frame, it interpreted this as the call was over
and hung up the channels.
The reason for this was because ast_bridge_call in res_features and
ast_channel_bridge in channel.c were using different times for their
calculations. channel.c uses the start_time on the bridge config, which
is the time that the feature digit was recieved. However, res_features
had another time, 'start', which was set right before calling
ast_channel_bridge. 'start' will always be slightly after start_time in the
bridge config, and sometimes enough to round up to one ms.
This is fixed by making ast_bridge_call use the same time as
ast_channel_bridge for the timeout calculation.
fixed a bug which led to chan_list zombies, when the call could not be properly established in misdn_call. also removed the ACK_HDLC stuff which is not really needed.
Russell Bryant [Tue, 26 Sep 2006 20:49:21 +0000 (20:49 +0000)]
Back in revision 4798, this message was changed from using ast_cli() to directly
calling write(). During this change, checking if this was a remote console was
removed. This caused this message about using "exit" or "quit" to exit an
Asterisk console to come up in times where it did not make sense. This change
restores the check to see if this is a remote console before printing the
message. (fixes BE-4)
Russell Bryant [Tue, 26 Sep 2006 20:23:15 +0000 (20:23 +0000)]
When parsing the sections of voicemail.conf that contain mailbox definitions,
don't introduce a length limit on the definition by using a 256 byte temporary
storage buffer. Instead, make the temporary buffer just as big as it needs
to be to hold the entire mailbox definition.
(fixes BE-68)
Russell Bryant [Sun, 24 Sep 2006 13:50:30 +0000 (13:50 +0000)]
Check to see if the channel that is activating the IAXPEER function is actually
an IAX2 channel before proceeding to process it to avoid crashing.
(issue #8017, reported by admott, fixed by myself)
Yay another 'round of spy fixes! This fixes a small logic flaw with the cleanup function and a memory allocation issue. (issue #7960 reported by jojo & issue #7999 reported by aster1) Special thanks to csum77 for letting me into a box where this issue was happening.
When paging, only wait 5 seconds for the marked user to enter the conference.
After that, assume the paging already completed by the time the channel entered
the conference and drop back out. (Issue 7275)
Only truly consider the channel in the same format if the format matches the raw format OR if a translation path already exists to translate between them. (issue #7887 reported by softins & issue #7803 reported by alvaro_palma_aste). Thanks goes to stubert for giving me access to a box and showing me a scenario where this occured.
Steve Murphy [Thu, 7 Sep 2006 02:14:14 +0000 (02:14 +0000)]
This should fix the problem reported in 7564: logger config file errors getting lost because logging isn't configured yet. The problem was that the code that exists to handle this case was not getting reached, because other tests were causing an early return from ast_log().
Don't close the second file descriptor if it's the same as the first one, as it will have already been closed elsewhere and could cause massive panic. (issue #7699 reported by bn999)
As posted from #7458 and others similar to it in Mantis:
p->app_lock was a mutex really designed for use with agents not in callback mode. That being the case, I've tried to code it so that when callback mode is used, the app_lock mutex will not be locked/unlocked at all. Please let me know how you make out - and if you continue to deadlock now, please reproduce the deadlock logging information and post to Mantis.
Make realtime regseconds work as people expected (0 on registration expiration or release, and actual on normal state) (issue #7684 reported by kshumard)
Merge in last round of spy fixes. This should hopefully eliminate all the issues people have been seeing by distinctly separating what each component (core/spy) is responsible for. Core is responsible for adding a spy to a channel, feeding frames to the spy, removing the spy from a channel, and telling the spy to stop. Spy is responsible for reading frames in, and cleaning up after itself.
Don't keep trying the same member in certain strategies when members of the queue are unavailable (#7278 - diLLec reported and patched) - This should have been patched here first and then merged into /trunk. My bad!
Russell Bryant [Wed, 30 Aug 2006 18:59:44 +0000 (18:59 +0000)]
Restore original functionality of 1.2 in places where ANI was not set, but was
changed to be set. The original change was done to ensure that the behavior of
the "callerid" option in each channel driver was consistent, but it caused an
unexpected behavior change of CDR records for users, so this change is being
reverted in 1.2. (issue #7695)
Steve Murphy [Mon, 28 Aug 2006 20:51:08 +0000 (20:51 +0000)]
Removed from the docs the mention of the ! and =~ operators, as these
were knocked out of ast_expr2 because they were new features. Let's hope
I can keep them from getting knocked out of the trunk, too!
Russell Bryant [Thu, 24 Aug 2006 19:41:26 +0000 (19:41 +0000)]
Fix a few issues related to the handling of channel variables
- in pbx_builtin_serialize_variables(), the variable list traversal would stop
on a variables with empty name/values, which is not appropriate
- When removing the GROUP variables, use AST_LIST_REMOVE_CURRENT instead of
AST_LIST_REMOVE
- During masquerading, when copying the variables list from one channel to the
other, using AST_LIST_INSERT_TAIL is not valid for appending a whole list.
It leaves the tail pointer of the list invalid. Introduce a new macro,
AST_LIST_APPEND_LIST that appends a list properly.
(issue #7802, softins)
Joshua Colp [Thu, 17 Aug 2006 16:22:58 +0000 (16:22 +0000)]
Use the last CDR entry instead of the first CDR entry for variable retrieving variables using the CDR dialplan function. (issue #7689 reported by voipgate)
Steve Murphy [Thu, 17 Aug 2006 16:07:21 +0000 (16:07 +0000)]
In app_macro, changed the previously changed upper recursion depth limit to a variable, default of the original val of 7. MACRO_RECURSION is a channel variable that will override the limit, but until I can understand and fix why this limit is neccessary, I am not advertising this variable in the docs. This fix mirrors the changes made in r40200 in trunk.
Steve Murphy [Tue, 15 Aug 2006 22:13:47 +0000 (22:13 +0000)]
This revision fixes bug 7731, the inability for macros to be called more than one level deep in the 'h' extension.
It also pushes up the limit of recursion depth from 7 to 20.
Russell Bryant [Mon, 7 Aug 2006 01:28:29 +0000 (01:28 +0000)]
Fix a crash reported to me by hads on IRC. This crash would occur with the use
of the "distinctiveringaftercid" option. Also, on this user's system, the crash
would only occur when built without optimizations. This is because the bug is
that the code would write past the end of an array that was allocated on the
stack, and the structure of the stack is different with or without optimizations
enabled.
Joshua Colp [Mon, 7 Aug 2006 00:15:51 +0000 (00:15 +0000)]
Reset our stream and vstream pointers back to NULL so that any generator that uses them (file based MOH) will not try to close them again. (issue #7668 reported by jmls)
Russell Bryant [Sat, 5 Aug 2006 09:01:37 +0000 (09:01 +0000)]
Always generate a Newstate event in ast_setstate() instead of making it a
Newchannel event if the state was AST_STATE_DOWN. The Newchannel event will
always be generated in ast_request(), so this just causes a duplicated
Newchannel event in some cases.
(issue #7506, repoted by capouch, fixed by me)
Russell Bryant [Sat, 5 Aug 2006 05:08:50 +0000 (05:08 +0000)]
Fix an issue that would cause a NewCallerID manager event to be generated
before the channel's NewChannel event. This was due to a somewhat recent
change that included using ast_set_callerid() where it wasn't before. This
function should not be used in the channel driver "new" functions.
(issue #7654, fixed by me)
Also, fix a couple minor bugs in usecount handling. chan_iax2 could have
increased the usecount but then returned an error. The place where chan_sip
increased the usecount did not call ast_update_usecount()
fix brain-damage I introduced when trying to fix the CANCEL/BYE sending mechanism for pending INVITES
accept unknown 1xx responses as 183 responses (as RFC3261 mandates we should do)
ensure that the 'feature digit timeout' value is taken into account when deciding how long the bridge should run (this fixes a problem report where a digit press that did not invoke a feature is never passed across the bridge)
Joshua Colp [Tue, 1 Aug 2006 19:20:05 +0000 (19:20 +0000)]
Close the stream when file based MOH stop. This won't get rid of their position in the file but it will cause the translation path to be setup again. (issue #7634 reported by asimpson)
Kevin P. Fleming [Mon, 31 Jul 2006 21:14:11 +0000 (21:14 +0000)]
don't reissue hangup requests for SIP channels that have expired their RTP timeouts (one time is enough)
don't rescan the SIP private structure list too fast, it can cause channels to not be able to hang up (issue #7495, and probably others)
use ast_softhangup_nolock() since we already hold the channel's lock
Add missing code to bring transferee channel out of MOH/autoservice under certain circumstance (issue #7611 reported by guillecabeza with minor mods by myself)