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.
Russell Bryant [Tue, 6 Nov 2007 18:20:07 +0000 (18:20 +0000)]
If someone were to delete the files used by an existing MOH class, and then
issue a reload, further use of that class could result in a crash due to
dividing by zero. This set of changes fixes up some places to prevent this
from happening.
(closes issue #10948)
Reported by: jcomellas
Patches:
res_musiconhold_division_by_zero.patch uploaded by jcomellas (license 282)
Additional changes added by me.
Steve Murphy [Tue, 6 Nov 2007 17:52:50 +0000 (17:52 +0000)]
closes issue #8786 - where the [catname](!) and [catname](othercat1,othercat2,...) notation gets dropped across a ConfigUpdate (or any other thing that would cause a config file to be written). While I was at it, I also cleaned up some of the destroy routines to free up comments, which was not being done. Made sure the new struct I introduced is also cleaned up properly at destruction time. My code handles multiple template inclusions. Many thanks to ssokol for his patch, which, while not literally used in the final merge, served as a foundation for the fix.
Joshua Colp [Tue, 6 Nov 2007 17:08:05 +0000 (17:08 +0000)]
Make it so that if a peer is determined to be unreachable using qualify their devicestate will report back unavailable.
(closes issue #11006)
Reported by: pj
Russell Bryant [Tue, 6 Nov 2007 13:50:15 +0000 (13:50 +0000)]
Remove some checks to see if locks are initialized from the non-DEBUG_THREADS
versions of the lock routines. These are incorrect for a number of reasons:
- It breaks the build on mac.
- If there is a problem with locks not getting initialized, then the proper
fix is to find that place and fix the code so that it does get initialized.
- If additional debug code is needed to help find the problem areas, then this
type of things should _only_ be put in the DEBUG_THREADS wrappers.
Russell Bryant [Mon, 5 Nov 2007 22:07:54 +0000 (22:07 +0000)]
After seeing crashes related to channel variables, I went looking around at the
ways that channel variables are handled. In general, they were not handled in
a thread-safe way. The channel _must_ be locked when reading or writing from/to
the channel variable list.
What I have done to improve this situation is to make pbx_builtin_setvar_helper()
and friends lock the channel when doing their thing. Asterisk API calls almost
all lock the channel for you as necessary, but this family of functions did not.
(closes issue #10923, reported by atis)
(closes issue #11159, reported by 850t)
Russell Bryant [Mon, 5 Nov 2007 21:33:56 +0000 (21:33 +0000)]
When traversing the list of channel variables here in transmit_invite(), the
asterisk channel must be locked, as this data may change at any time.
(I have seen numerous reports of crashes related to the handling of channel
variables. There are a couple of issues on the bug tracker related to it,
but it has also been noted on IRC and mailing lists. So, I am finding and
fixing some places where channel variables are handled improperly.)
Russell Bryant [Mon, 5 Nov 2007 20:40:01 +0000 (20:40 +0000)]
Merge changes from asterisk/team/kpfleming/SRV-priority-handling
Previously, the SRV record support in Asterisk was broken. There was no
guarantee on what record Asterisk would choose to actually use. This set of
changes improves the situation by ensuring that Asterisk will choose the
highest priority record.
Russell Bryant [Mon, 5 Nov 2007 20:11:04 +0000 (20:11 +0000)]
Merge the last bit of changes from asterisk/team/russell/readq-1.4
The issue here is that the channel frame readq handling got broken when the
code was converted to use the linked list macros. It caused corruption of the
list head and tail pointers. So, I fixed up the usage of the linked list
macros and in passing, simplified the code. I also documented what the code
is doing, as it was a bit difficult to figure out at first.
This bug showed itself with crashes showing messed up head/tail pointers for
the readq. However, there are a couple of crashes that aren't quite as obvious,
but I think may be related. So, if your bug gets closed by this commit, but
you still have a problem, please reopen or create a new bug report.
Joshua Colp [Mon, 5 Nov 2007 18:47:13 +0000 (18:47 +0000)]
If a SIP channel is put on hold multiple times do not keep incrementing the onHold value.
(closes issue #11085)
Reported by: francesco_r
Tested by: blitzrage
(closes issue #10474)
Reported by: acennami
Russell Bryant [Mon, 5 Nov 2007 17:46:02 +0000 (17:46 +0000)]
Fix up datastore handling in ast_do_masquerade(). The code is intended to move
any channel datastores from the old channel to the new one. However, it did
not use the linked list macros properly to accomplish the task. The existing
code would only work if there was only a single datastore on the old channel.
Tilghman Lesher [Mon, 5 Nov 2007 16:20:13 +0000 (16:20 +0000)]
Don't check used pooled connections for connection status, as it will cause issues for prepared queries.
Reported by: Nick Gorham (via -dev list)
Patch by: tilghman
Luigi Rizzo [Sun, 4 Nov 2007 22:38:13 +0000 (22:38 +0000)]
Rename ast_string_field_free_pool to ast_string_field_free_memory,
and ast_string_field_free_all to ast_string_field_reset_all
to avoid misuse (due to too similar names and an error in
documentation). Fix two related memory leaks in app_meetme.
No need to merge to trunk, different fix already applied there.
Not applicable to 1.2
Joshua Colp [Fri, 2 Nov 2007 20:49:45 +0000 (20:49 +0000)]
Make subscribecontext behave as advertised. It will now look for the presence of a hint in the given context (be it subscribecontext or context).
(closes issue #10702)
Reported by: slavon
Joshua Colp [Fri, 2 Nov 2007 20:20:21 +0000 (20:20 +0000)]
If an INFO request within a dialog is received with a content length of 0 simply send back a 200 OK. It is valid to do this and the remote side is probably using it to make sure the signalling is still alive.
(closes issue #5747)
Reported by: chandi
Patches:
infofix-81430-1.patch uploaded by IgorG (license 20)
Joshua Colp [Thu, 1 Nov 2007 01:53:55 +0000 (01:53 +0000)]
If a Zap channel contains a spy or a spy is added take it out of the conference in kernel space and make it go through Asterisk so the spy gets audio from both sides.
(closes issue #10060)
Reported by: mparker
Steve Murphy [Wed, 31 Oct 2007 17:49:39 +0000 (17:49 +0000)]
closes issue #11108 -- where the 'dialplan save' cli command saves a file where the semicolon is not escaped. Fixed this; User also wanted comments to be preserved across dialplan save, but this is impossible at this point in time, because comments are not stored in the dialplan. They are 'compiled' out of extensions.conf. The only way to preserve those comments is to use the config file reader/writer that the GUI uses to allow online user edits. extensions.conf is first and foremost, a config file, and is read in by the normal config-file reading routines. Then, it is processed into a dialplan (context/exten structs).
Steve Murphy [Wed, 31 Oct 2007 03:51:52 +0000 (03:51 +0000)]
Included some verbage in the check_includes func, to inform the user that included contexts that have no match in the AEL, might be OK, as AEL cannot check in the extensions.conf or the in-memory contexts, as they may not be there at the time of the check.
Russell Bryant [Tue, 30 Oct 2007 21:19:09 +0000 (21:19 +0000)]
Merge the changes from team/russell/iax2_poke_fix and iax2-poke-fix-trunk
There was a race condition related to the handling of POKEing peers. Essentially,
a reference to a peer is held by the scheduler when there are pending callbacks,
but the reference count didn't reflect it. So, it was possible for a peer to hit
a reference count of zero and have its destructor begin to be called at the same
time that the scheduler thread ran a POKE related callback. If that happened,
a crash would likely occur.
Joshua Colp [Tue, 30 Oct 2007 16:13:39 +0000 (16:13 +0000)]
Add two more checks before printing out a warning message about bridging. If either channel has hungup of course the bridge will have failed.
(closes issue #10009)
Reported by: dimas
Kevin P. Fleming [Mon, 29 Oct 2007 22:04:29 +0000 (22:04 +0000)]
don't put '-pipe' into ASTCFLAGS if '-save-temps' is already there (used when debugging preprocessor issues) because the compiler will whine about each compile command
Russell Bryant [Mon, 29 Oct 2007 20:22:07 +0000 (20:22 +0000)]
Add some more details to the output of "core show locks". When a thread
is waiting for a lock, this will now show the details about who currently
has it locked.
(inspired by issue #11100)
Russell Bryant [Mon, 29 Oct 2007 19:21:06 +0000 (19:21 +0000)]
Remove a lock that doesn't make any sense. The regions lock needs to be held
when traversing the list of allocated chunks so that they can be printed out
to the CLI.
(Thanks to eliel on #asterisk-dev for pointing this out!)
Joshua Colp [Mon, 29 Oct 2007 17:20:28 +0000 (17:20 +0000)]
Fix issue where if both sides of the dialog cancelled the dialog at the same time chan_sip could kepe retransmitting a response for no reason.
(closes issue #9566)
Reported by: atca_pres
Patches:
bug9566.patch uploaded by oej
Tilghman Lesher [Sun, 28 Oct 2007 13:46:55 +0000 (13:46 +0000)]
Add autoservice to several more functions which might delay in their responses.
Also, make sure that func_odbc functions have a channel on which to set
variables.
Reported by russell
Fixed by tilghman
Closes issue #11099
Steve Murphy [Fri, 26 Oct 2007 16:34:02 +0000 (16:34 +0000)]
closes issue #11086 where a user complains that references to following contexts report a problem; The problem was REALLy that he was referring to empty contexts, which were being ignored. Reporter stated that empty contexts should be OK. I checked it out against extensions.conf, and sure enough, empty contexts ARE ok. So, I removed the restriction from AEL. This, though, highlighted a problem with multiple contexts of the same name. This should be OK, also. So, I added the extend keyword to AEL, and it can preceed the 'context' keyword (mixed with 'abstract', if nec.). This will turn off the warnings in AEL if the same context name is used 2 or more times. Also, I now call ast_context_find_or_create for contexts now, instead of just ast_context_create; I did this because pbx_config does this. The 'extend' keyword thus becomes a statement of intent. AEL can now duplicate the behavior of pbx_config,
Tilghman Lesher [Fri, 26 Oct 2007 13:54:30 +0000 (13:54 +0000)]
The addition of autoservice to func_curl additionally made func_curl dependent
on the existence of a channel, with no real reason. This should make func_curl
once again work without a channel.
Reported by jmls.
Fixed by tilghman.
Closes issue #11090
Russell Bryant [Mon, 22 Oct 2007 21:36:12 +0000 (21:36 +0000)]
If lock tracking is not enabled, then we can not attempt to log any mutex
failures. If so, we could end up in infinite recursion. The only lock that
is affected by this is a mutex in astmm.c used when MALLOC_DEBUG is enabled.
Russell Bryant [Mon, 22 Oct 2007 15:43:30 +0000 (15:43 +0000)]
Update the static mutex initializer to include the initialization of
the internal mutex used to protect the lock debugging data.
(closes issue #11044, patch suggested by Ivan)
Joshua Colp [Mon, 22 Oct 2007 14:27:03 +0000 (14:27 +0000)]
Move log message to before the frame it references is freed.
(closes issue #11050)
Reported by: slavon
Patches:
channel.c.86662.diff uploaded by casper (license 55)
Joshua Colp [Fri, 19 Oct 2007 16:38:29 +0000 (16:38 +0000)]
When returning a DTMF digit from ast_control_streamfile cast it as a char so that 0 does not overlap with the success return code.
(closes issue #11023)
Reported by: cfc
Joshua Colp [Fri, 19 Oct 2007 15:33:49 +0000 (15:33 +0000)]
Fix two issues with domains and transfers. If a port was given in the hostname it was treated as part of the hostname. If domains were configured but external domains were not enabled all transfers would be considered remote.
(closes issue #11027)
Reported by: ramonpeek
Patches:
11027-1.diff uploaded by ramonpeek (license 266)
Russell Bryant [Thu, 18 Oct 2007 18:03:10 +0000 (18:03 +0000)]
The channel needs to stay locked while running timer callbacks, as they access
and modify channel data that may change elsewhere. I went through every timer
callback in the source tree to make sure that none of them did any additional
locking that could introduce deadlocks, and all is well.
(closes issue #10765)
Reported by: Ivan
Patches:
ast_1_4_11_svn_patch_channel_rc.diff uploaded by Ivan (license 229)
Mark Michelson [Thu, 18 Oct 2007 17:38:26 +0000 (17:38 +0000)]
If a non-existent file is specified to be played either as a periodic announcement
or as a hold/position announcement, the caller would be kicked out of the queue.
No longer does this happen.
Russell Bryant [Thu, 18 Oct 2007 04:40:52 +0000 (04:40 +0000)]
Revert a change that I made for issue #10979 which, as has been pointed out to
me in issue #11018, doesn't really make sense. There is no reason to have
the base64 decode function force a '\0' terminated buffer, when the result is
almost always binary, anyway. In fact, this caused some breakage, as some code
in res_crypto passed in a buffer exactly the right size to get its binary
result, which got stomped on by this patch.
Mark Michelson [Wed, 17 Oct 2007 21:39:05 +0000 (21:39 +0000)]
Changing the strategy field of the call_queue struct to be signed instead of unsigned,
since the code attempts to set the strategy to -1 if you specify a bogus strategy.
While this isn't a huge issue in 1.4, it could be a problem for someone who, say, tries
to use the roundrobin strategy in trunk (despite all the deprecation warnings in 1.4).