Allow autofill to work in the general section of queues.conf.
Additionally, don't try to (re)set options when they have empty values in realtime (all unset columns would have an empty value).
Terry Wilson [Mon, 14 Apr 2008 19:12:27 +0000 (19:12 +0000)]
Don't unref user twice on failure. Also, when adding sorted list of users, it is best to check the entry already in the list for a "next" entry instead of the newly created entry...
Increase the retry count when attempting to show channels. This apparently
cleared an issue someone was seeing when attempting to show channels when
the load was high.
(closes issue #11667)
Reported by: falves11
Patches:
11677.txt uploaded by russell (license 2)
Tested by: falves11
If the datastore has been moved to another channel due to a masquerade, then
freeing the datastore here causes an eventual double free when the new channel
hangs up. We should only free the datastore if we were able to successfully remove
it from the channel we are referencing (i.e. the datastore was not moved).
During hangup it is possible for p->chan or p->owner to be NULL, so just return what the channel is bridged to instead of what they are *really* bridged to. Thanks Matt Nicholson!
Save a local copy of the generate callback prior to unlocking the channel in
case the generate callback goes NULL on us after the channel is unlocked. Thanks
to Russell for pointing this need out to me.
Don't change the SSRC when a new source comes into play, this might happen quite often and depending on the remote side... they might not like this.
(closes issue #12353)
Reported by: dimas
Make sure we start incoming calls on SS7 with echo cancellation enabled. Also make sure when completing a COT we call ss7_start_call with the proper locks held. Lastly, make sure if we fail to get a channel from zt_new that we don't assume it's there.
Use the correct function for free'ing objects, and maybe we won't crash.
(closes issue #12163)
Reported by: gservat
Patches:
20080411__bug12163.diff.txt uploaded by Corydon76 (license 14)
Tested by: gservat
Several places in the code called find_callno() (which releases the lock on the pvt structure) and then immediately locked the call and did things with it. Unfortunately, the call can disappear between the find_callno and the lock, causing Bad Stuff(tm) to happen.
Added find_callno_locked() function to return the callno withtout unlocking for instances that it is needed.
Terry Wilson [Fri, 11 Apr 2008 21:04:46 +0000 (21:04 +0000)]
Fix the fact that global_variables 1) weren't being updated on reload (thanks for the report, Doug), and 2) weren't actually being appended to the list of profile variables because build_profile was called before the list was populated. Also needed to free the contents returned by load_file().
A 'b' option has been added which causes chan_local to return the actual channel that is behind it when queried. This is useful for transfer scenarios as the actual channel will be transferred, not the Local channel. If you have been using Local channels as queue members and having issues when the agent did a blind transfer this option may solve the issue.
Create the directory where name recordings will go if it does not exist.
(closes issue #12311)
Reported by: rkeene
Patches:
12311-mkdir.diff uploaded by qwell (license 4)
Don't hardcode ru into the digits filename so that languageprefix can work.
(closes issue #12404)
Reported by: IgorG
Patches:
voicemail_ru_hardcoded-v1.patch uploaded by IgorG (license 20)
Don't add custom URI options if they don't exist OR they are empty.
(closes issue #12407)
Reported by: homesick
Patches:
uri_options-1.4.diff uploaded by homesick (license 91)
We need to set the persistant_route [sic] parameter for the sip_pvt
during the initial INVITE, no matter if we're building the route set from
an INVITE request or response.
If the [csv] section does not exist in cdr.conf, then an unload/load sequence
is needed to correct the problem. Track whether the load succeeded with a
variable, so we can fix this with a simple reload event, instead.
Mark Michelson [Wed, 9 Apr 2008 17:48:33 +0000 (17:48 +0000)]
There was a subtle logical difference between 1.4 and trunk with regards to how timeouts
were handled. In 1.4, if the absolute timeout were reached on a call, no matter what
the return value of ast_spawn_extension was, the pbx would attempt to go to the 'T'
extension or hangup otherwise. The rearrangement of this function in trunk made this check
only happen in the case that ast_spawn_extension returned 0. If ast_spawn_extension returned
1, then the fact that the timeout expired resulted in a no-op, and would cause an infinite
loop to occur in __ast_pbx_run. This change fixes this problem. Now timeouts will
behave as they did in 1.4
If we receive an AUTHREQ from the remote server and we are unable to reply (for example they have a secret configured, but we do not) then queue a hangup frame on the Asterisk channel. This will cause the channel to hangup and a HANGUP to be sent via IAX2 to the remote side which is the proper thing to do in this scenario.
(closes issue #12385)
Reported by: viraptor
Permit callee to continue in the dialplan, after caller has hung up.
(closes issue #11954)
Reported by: johan
Patches:
app_dial_rev104031.patch uploaded by johan (license 334)
Add commandline tool for doing CLI commands through AMI (instead of using asterisk -rx)
(closes issue #12389)
Reported by: davevg
Patches:
astcli uploaded by davevg (license 209)
Fix potential buffer overflow that could happen if more than 100 announce files
were specified when calling ParkAndAnnounce. This overflow is not exploitable remotely
and so there is no need for a security advisory.
Move check for still-bridged channels out a little further, to avoid possible
deadlocks. (Closes issue #12252)
Reported by: callguy
Patches:
20080319__bug12252.diff.txt uploaded by Corydon76 (license 14)
Tested by: callguy
If audio suddenly gets fed into one side of a channel after a lapse of frames flush the other factory so that old audio does not remain in the factory causing the sync code to not execute.
(closes issue #12296)
Reported by: jvandal
This one line change makes an if inside a for loop (in realtime_peer) check all the ast_variables the loop was intending to test rather than just the first one.
Mark Michelson [Mon, 7 Apr 2008 20:22:06 +0000 (20:22 +0000)]
This is a "fix" for something that's been bugging the crap out of me for a while.
The variable name "flag" to distinguish between whether a message is being forwarded or
is new is not a helpful name. The newly added doxygen documentation to app_voicemail is
tremendously helpful, but I still just...hate this variable name. I think is_new_message
is more indicative of what its purpose is.
This fix prevents a deadlock that was experienced in chan_local. There was
deadlock prevention in place in chan_local, but it would not work in a specific
case because the channel was recursively locked. By unlocking the channel prior
to calling the generator's generate callback in ast_read_generator_actions(), we
prevent the recursive locking, and therefore the deadlock.
This one line change makes an if inside a for loop (in realtime_peer) check all the ast_variables the loop was intending to test rather than just the first one.
AsyncAGI should not close the manager session on error.
(closes issue #12370)
Reported by: srt
Patches:
asterisk-12370.diff uploaded by srt (license 378)
Steve Murphy [Sat, 5 Apr 2008 01:33:13 +0000 (01:33 +0000)]
Found a little problem with the sip request handling that could lead to a quick crash of asterisk, and a road to a DOS attack if left unfixed.
Attaching to a running asterisk with "telnet hostname 5060", I would input "something", then hit return three times, and asterisk crashes.
I traced it to handle_request_do(), which zeroes out the data (an ast_str ptr) if the string is too short.
Instead of freeing the struct and nulling the pointer, it now just resets it, because this
ast_str is expected by the calling routine to still be there after handle_request_do() returns.
This appears to fix the crash. I assume that it was introduced with ast_str's being adopted. It's a subtle and easy-to-miss sort of problem.
I also found all the places where the req.data is freed, and made sure the ptr is Nulled out as well;
no good leaving bad ptrs laying around-- I didn't need to do this, but it seemed a good thing to do...
add a Zaptel timer check to verify the timer is responding when Zaptel support is compiled into Asterisk and Zaptel drivers are loaded. This will help people not waste their valuable time debugging side effects.
Use a 32k file buffer on recordings, which increases the efficiency of file recording.
(closes issue #11962)
Reported by: garlew
Patches:
recording.patch uploaded by garlew (license 376)
bug-11962.diff uploaded by snuffy (license 35)
Make MISDN generate channel rename events when the name changes.
(closes issue #11142)
Reported by: julianjm
Patches:
chan_misdn_tmpchan_trunk_v1.diff uploaded by julianjm (license 99)
Fix a race condition in the manager. It is possible that a new manager event
could be appended during a brief time when the manager is not waiting for input.
If an event comes during this period, we need to set an indicator that there is an
event pending so that the manager doesn't attempt to wait forever for an event that
already happened.
(closes issue #12354)
Reported by: bamby
Patches:
manager_race_condition.diff uploaded by bamby (license 430)
(comments added by me)
Since the SIP request structure gets reused multiple times with TCP handling we have to clear the debug state or else we will keep spitting out debug even after it has been turned off.
(closes issue #12169)
Reported by: pj
Patches:
12169-debugoff-2.diff uploaded by qwell (license 4)
Tested by: pj
Steve Murphy [Tue, 1 Apr 2008 22:45:10 +0000 (22:45 +0000)]
Bumped across another test set for the new exten pattern matcher, which revealed a problem with the CANMATCH/MATCHMORE modes. Direct matches were getting in the way. Fixed.
I have hopes that the changes made over the last few days will
finalize and solidify this code. While there are bound to be
small tweaks still needed, I feel that the job (at last) is
somewhat completed. Finally, I had a chance to comprehend how
the scoring of extension patterns was done in the previous
version, and I've come very close to using the exact same
criteria in the new pattern matching code. The left-right
sorting is now replicated in the trie structure itself, such
that the first match found will the 'best' match. Compared
the results against 1.4 for several extensions. Replicated
falves11's setup and it works. Used some devious patterns
provided by jsmith, supplemented with a few of my own.
Looks good.
Disable Packet2Packet bridging when we need to feed DTMF frames into the core. Some implementations do not like how we switch between things.
(closes issue #12212)
Reported by: bamby
Jeff Peeler [Tue, 1 Apr 2008 17:53:08 +0000 (17:53 +0000)]
This adds DNS SRV record support to DNS manager. If there is a SRV record for a given domain, the hostname and port listed in the SRV record will be used. If no SRV record exists or a SRV lookup is not attempted, the DNS lookup on the specified domain will be performed as normal. Chan_sip has been modified to take advantage of the new SRV support.