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.
Joshua Colp [Thu, 3 May 2007 16:42:19 +0000 (16:42 +0000)]
When a peer is seeded or built tell the devicestate core to update it's status. This is easier then having chan_sip load before pbx_config. (issue #9658 reported by dlynes)
when we're in state WAITING4DIGS, we use the asterisk tone-generator which prods us, so we can't just return -1 in misdn_write in this case. Added a MISDN_KEYPAD channel variable, and fixed the sending of keypad. this enables us to modify the call forward parameters in the switch.
fixed the problem that misdn_write did not return -1 when called with 0 samples in a frame this resultet in a deadlock in some circumstances, when the call ended because of a busy extension. added encoding of keypad.
increase reliability and efficiency of static Realtime config loading via ODBC:
don't request fields we aren't going to use
don't request sorting on fields that are pointless to sort on
explicitly request the fields we want, because we can't expect the database to always return them in the order they were created
(reported by blitzrage in person (!), patch by me)
Tilghman Lesher [Wed, 2 May 2007 17:38:16 +0000 (17:38 +0000)]
Issue 9638 - if a text frame is sent with no terminating NULL through a bridged
IAX connection, the remote end will receive garbage characters tacked onto the
end.
Russell Bryant [Tue, 1 May 2007 21:55:19 +0000 (21:55 +0000)]
Remove an unnecessary check that makes it so if you hang up after doing an
attended transfer before the target extension answers the channel, the transfer
is not successful. (issue #9338, patch by svanlund)
Russell Bryant [Mon, 30 Apr 2007 15:57:26 +0000 (15:57 +0000)]
This patch fixes an issue where depending on the cause code, when the network
sends a PRI disconnect, the call may not be properly hung up.
(issue #9588, reported and patched by softins)
Olle Johansson [Fri, 27 Apr 2007 13:57:45 +0000 (13:57 +0000)]
Issue #7351 - SIP Cancel fails due to the wrong contact uri. Reported by PPYY, failed to fix by OEJ
final fix by wojtekka - THANKS!!!! THis was a hard one to catch.
Revert previous fix for when the IAX2 channel goes funky (that's the technical term). This is causing legit calls to be prematurely hung up. (issue #9600 reported by justdave)
Merge rewritten group counting support. No more storing data on the variable list of the channels. That was bad, mmmk? (issue #7497 reported by sabbathbh)
Russell Bryant [Tue, 24 Apr 2007 21:33:59 +0000 (21:33 +0000)]
Don't crash if a manager connection provides a username that exists in
manager.conf but does not have a password, and also requests MD5
authentication. (ASA-2007-012)
added lock for sending messages to avoid double sending. shuffled some empty_chans after the cb_event calls, this avoids that a release_complete from a quite different call releases a fresh created setup by accident.
Jason Parker [Fri, 20 Apr 2007 19:49:54 +0000 (19:49 +0000)]
If the '* to hangup' option is not enabled, we don't need to disable * as a valid exit key.
If it was enabled, this statement would've never been checked in the first place.
Bug 9557 - Specifying the GetVar AMI action without a Channel parameter can
cause Asterisk to crash. The reason this needs to be fixed in the functions
instead of in AMI is because Channel can legitimately be NULL, such as when
retrieving global variables.
Add OUTBOUND_GROUP_ONCE variable to app_dial. This behaves the same as OUTBOUND_GROUP except it will get unset after use so it won't get accidentally inherited. (issue #BE-140)
Russell Bryant [Wed, 11 Apr 2007 16:01:25 +0000 (16:01 +0000)]
If someone sets the "useragent" option in sip.conf to be empty, then don't add
the User-Agent header at all. It is an optional header, anyway. Also, the bug
report says that some of Japan's SIP providers don't allow it for some weird
reason. (issue #9488, reported by makoto, fixed by me)
Russell Bryant [Wed, 11 Apr 2007 15:05:36 +0000 (15:05 +0000)]
Fix a bug with switching between host=dynamic and using specific hosts for
peers. The code would only reset the peer's address when it is dynamic if
it was a new peer structure. Now, it will also reset the address if it was
already in the peer list, but before the reload, it was not dynamic.
(issue #9515, reported by caio1982, fixed by me)
Russell Bryant [Wed, 11 Apr 2007 14:02:54 +0000 (14:02 +0000)]
Remove the attempt at reporting configuration errors in sip.conf. This can
cause a bunch of improper messages when using realtime. I give up. As oej
tried to convince me when I put this in, there is just no easy way to do it.
(inspired by a message on the -dev list)
Don't check for error when lowering priority (according to the manpage, it should never happen anyway). It might could happen, though, if another thread messed with the priority, so safeguard against that (reported via -dev list).
When calling a device that then forwards us elsewhere... we have to make our channels compatible if it is the only channel being dialed. (issue #9445 reported by marcelbarbulescu)
Russell Bryant [Wed, 4 Apr 2007 17:38:47 +0000 (17:38 +0000)]
It is valid to redirect channels via the manager interface that are not in the
UP state. Instead of checking for that to prevent to ensure a dead channel
doesn't get redirected, just use the ast_check_hangup() API call.
(issue #9457, reported by Callmewind, patch by me)
(related to issue #8977)
Russell Bryant [Wed, 4 Apr 2007 16:37:04 +0000 (16:37 +0000)]
Fix the return value of handle_common_options() so that it always properly
indicates whether it handled the option or not.
(issue #9455, reported by Netview, fixed by me)
Russell Bryant [Tue, 3 Apr 2007 19:15:04 +0000 (19:15 +0000)]
Don't attempt to report configuration errors in build_user(). oej pointed out
that for a "friend" entry, this won't work, because all user options are valid
for peers, but not the other way around.
Russell Bryant [Tue, 3 Apr 2007 17:58:19 +0000 (17:58 +0000)]
When doing a built-in blind or attended transfer, restore the ability to use '#'
to terminate the number and immediately do the transfer instead of having to
dial the number and just wait for the feature digit timeout.
(issue #8366, xueliangliang)
added option which allows us to accept incoming SETUP Messages without automatically sending Proceeding or Setup Acknowledge, this is useful with some broken switches and if you want to Release incoming calls without previously having acknowledged them. The new option is noautorespond_on_setup=yes|no default is no, so we don't break the existing behaviour
Russell Bryant [Sun, 1 Apr 2007 22:35:25 +0000 (22:35 +0000)]
Add the SO_REUSEADDR flag to sockets handled by netsock. This is needed by
the patch that went in for issue 7874. chan_iax2 needs to be able to create
socket that is lisetning on INADDR_ANY, but also be able to bind sockets to
specific addresses. (Thanks to Stevenson on the asterisk-dev mailing list
for explaining why this flag was needed.)
Joshua Colp [Thu, 29 Mar 2007 17:33:58 +0000 (17:33 +0000)]
Keep a global array of variables indicating whether certain conference rooms are in use. This ensures that two people going into a new dynamic conference when the 'e' option is set don't go into the same conference room. (issue #8835 reported by eliel)
Russell Bryant [Thu, 29 Mar 2007 17:14:33 +0000 (17:14 +0000)]
If an error occurs when reading from an RTP socket, and the error code does not
indicate that we should try again, then return NULL instead of a "null frame".
This will prevent Asterisk from trying over and over again, and eventually
causing the system to crash. (issue #8285, john)
Tilghman Lesher [Thu, 29 Mar 2007 16:04:46 +0000 (16:04 +0000)]
Issue 9415 - No point to getting a diagnostic field if we aren't doing anything with the information.
(Plus, it tends to crash the Postgres ODBC driver.)