summaryrefslogtreecommitdiff
path: root/channels/chan_iax2.c
AgeCommit message (Collapse)Author
2008-06-25More expansion of the deadlock avoidance macro, including a macro to do lockingTilghman Lesher
of the channel lock git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@125020 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19Older versions of GNU gcc do not allow 'NULL' as sentinel.Michiel van Baak
They want (char *)NULL as sentinel. An example is OpenBSD (confirmed on 4.3) that ships with gcc 3.3.4 This commit introduces a contstant SENTINEL which is declared as: #define SENTINEL ((char *)NULL) All places I could test compile on my openbsd system are converted. Update CODING-GUIDELINES to tell about this constant. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@124127 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-17Merged revisions 123391 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r123391 | tilghman | 2008-06-17 13:56:53 -0500 (Tue, 17 Jun 2008) | 3 lines Fix 3 more places where failure to lock the structure could cause the wrong lock to be unlocked. (Closes issue #12795) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-16Merged revisions 123113 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r123113 | tilghman | 2008-06-16 14:50:12 -0500 (Mon, 16 Jun 2008) | 2 lines Port "hasvoicemail" change from SIP to other channel drivers ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123114 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-15Add some more IAX2-specific information about the channel to the CHANNEL()Tilghman Lesher
function and begin the transition from SIPCHANINFO() to just using CHANNEL(). (closes issue #12856) Reported by: mostyn Patches: iax_and_sip_channel_info.patch uploaded by mostyn (license 398) (with some additional cleanup by me) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-13Merge changes from timing branchRussell Bryant
- Convert chan_iax2 to use the timing API - Convert usage of timing in the core to use the timing API instead of using DAHDI directly - Make a change to the timing API to add the set_rate() function - change the timing core to use a rwlock - merge a timing implementation, res_timing_dahdi Basic testing was successful using res_timing_dahdi git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12Merged revisions 122259 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r122259 | russell | 2008-06-12 13:22:44 -0500 (Thu, 12 Jun 2008) | 3 lines Fix some race conditions that cause ast_assert() to report that chan_iax2 tried to remove an entry that wasn't in the scheduler ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12Goodbye Zaptel, hello DAHDI. Removes Zaptel driver support with DAHDI. ↵Jeff Peeler
Configuration file and dialplan backwards compatability has been put in place where appropiate. Release announcement to follow. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-10Bump up the debug level of a couple of messagesRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@121407 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-09Expand RQ_INTEGER type out to multiple types, one for each precisionTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@121367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-05Merge the adaptive realtime branch, which will make adding new required fieldsTilghman Lesher
to realtime less painful in the future. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03Merged revisions 120168 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r120168 | russell | 2008-06-03 16:34:55 -0500 (Tue, 03 Jun 2008) | 4 lines Fix another place where peer->callno could change at a very bad time, and also fix a place where a peer was used after the reference was released. (inspired by rev 120001) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03Merged revisions 120001 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r120001 | tilghman | 2008-06-03 11:10:53 -0500 (Tue, 03 Jun 2008) | 9 lines Save the callno when we're poking, because our peer structure could change during destruction (and thus we unlock the wrong callno, causing a cascade failure). (closes issue #12717) Reported by: gewfie Patches: 20080525__bug12717.diff.txt uploaded by Corydon76 (license 14) Tested by: gewfie ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-02Merged revisions 119838 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r119838 | russell | 2008-06-02 15:08:04 -0500 (Mon, 02 Jun 2008) | 7 lines Revert a change made for issue #12479. This change caused a regression such that a dial string such as (IAX2/foo) did not automatically fall back to dialing the 's' extension anymore. (closes issue #12770) Reported by: dagmoller ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119839 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-02Merged revisions 119687 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r119687 | russell | 2008-06-02 07:30:17 -0500 (Mon, 02 Jun 2008) | 3 lines Even of the first PING or LAGRQ doesn't get sent because it comes up too soon, make sure to reschedule so it gets sent later. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-02Merged revisions 119533 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r119533 | russell | 2008-06-01 20:06:09 -0500 (Sun, 01 Jun 2008) | 2 lines Change a debug message to an actual debug message ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119534 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-30Merged revisions 119238 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r119238 | russell | 2008-05-30 07:55:36 -0500 (Fri, 30 May 2008) | 15 lines Merged revisions 119237 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r119237 | russell | 2008-05-30 07:49:39 -0500 (Fri, 30 May 2008) | 7 lines - Instead of only enforcing destination call number checking on an ACK, check all full frames except for PING and LAGRQ, which may be sent by older versions too quickly to contain the destination call number. (As suggested by Tim Panton on the asterisk-dev list) - Merge changes from team/russell/iax2-frame-race, which prevents PING and LAGRQ from being sent before the destination call number is known. ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119239 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-29Merged revisions 119009 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r119009 | russell | 2008-05-29 13:49:12 -0500 (Thu, 29 May 2008) | 16 lines Merged revisions 119008 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r119008 | russell | 2008-05-29 13:45:21 -0500 (Thu, 29 May 2008) | 7 lines Merge changes from team/russell/iax2-another-fix-to-the-fix As described in the following post to the asterisk-dev mailing list, only enforce destination call numbers when processing an ACK. http://lists.digium.com/pipermail/asterisk-dev/2008-May/033217.html (closes issue #12631) ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-29Merged revisions 118953 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r118953 | tilghman | 2008-05-29 12:20:16 -0500 (Thu, 29 May 2008) | 3 lines Add some debugging code that ensures that when we do deadlock avoidance, we don't lose the information about how a lock was originally acquired. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-28Fixes a bug in chan_iax that uses send_command to poke a peer while a ↵Brett Bryant
channel is unlocked in some cases, and because it can cause seemingly random failures could be related to some bugs in the tracker... git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118702 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-27Remove loop from the detection of a sequence number that acknowledges Brett Bryant
the receiving of a packet that we've kept in memory just incase the packet needs to be retransmitted. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118562 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-22- revert change to ast_queue_hangup and create ast_queue_hangup_with_causeMichiel van Baak
- make data member of the ast_frame struct a named union instead of a void Recently the ast_queue_hangup function got a new parameter, the hangupcause Feedback came in that this is no good and that instead a new function should be created. This I did. The hangupcause was stored in the seqno member of the ast_frame struct. This is not very elegant, and since there's already a data member that one should be used. Problem is, this member was a void *. Now it's a named union so it can hold a pointer, an uint32 and there's a padding in case someone wants to store another type in there in the future. This commit is so massive, because all ast_frame.data uses have to be altered to ast_frame.data.data Thanks russellb and kpfleming for the feedback. (closes issue #12674) Reported by: mvanbaak git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-19Merged revisions 116978 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r116978 | russell | 2008-05-18 22:44:04 -0500 (Sun, 18 May 2008) | 4 lines Avoid access of uninitialized memory. This caused a bunch of crashes for me while doing load testing of development branch where I'm working on some performance improvements. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@116979 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-17Improve native transfers when a chain of IAX2 connections are in use.Joshua Colp
(closes issue #7567) Reported by: tjd Patches: bug_7567_update_v2.diff uploaded by snuffy (license 35) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@116884 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-12A small change to fix iax2 native bridging.Brett Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115669 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-09Adding support for "urgent" voicemail messages. Messages which areMark Michelson
marked "urgent" are considered to be higher priority than other messages and so they will be played before any other messages in a user's mailbox. There are two ways to leave an urgent message. 1. send the 'U' option to VoiceMail(). 2. Set review=yes in voicemail.conf. This will give instructions for a caller to mark a message as urgent after the message has been recorded. I have tested that this works correctly with file and ODBC storage, and James Rothenberger (who wrote initial support for this feature) has tested its use with IMAP storage. (closes issue #11817) Reported by: jaroth Based on branch http://svn.digium.com/svn/asterisk/team/jrothenberger/asterisk-urgent Tested by: putnopvut, jaroth git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-08Merged revisions 115568 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r115568 | russell | 2008-05-08 14:19:50 -0500 (Thu, 08 May 2008) | 2 lines Remove debug output. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-08Merged revisions 115565 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r115565 | russell | 2008-05-08 14:15:25 -0500 (Thu, 08 May 2008) | 33 lines Merged revisions 115564 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r115564 | russell | 2008-05-08 14:14:04 -0500 (Thu, 08 May 2008) | 25 lines Fix a race condition that bbryant just found while doing some IAX2 testing. He was running Asterisk trunk running IAX2 calls through a few Asterisk boxes, however, the audio was extremely choppy. We looked at a packet trace and saw a storm of INVAL and VNAK frames being sent from one box to another. It turned out that what had happened was that one box tried to send a CONTROL frame before the 3 way handshake had completed. So, that frame did not include the destination call number, because it didn't have it yet. Part of our recent work for security issues included an additional check to ensure that frames that are supposed to include the destination call number have the correct one. This caused the frame to be rejected with an INVAL. The frame would get retransmitted for forever, rejected every time ... This race condition exists in all versions that got the security changes, in theory. However, it is really only likely that this would cause a problem in Asterisk trunk. There was a control frame being sent (SRCUPDATE) at the _very_ beginning of the call, which does not exist in 1.2 or 1.4. However, I am fixing all versions that could potentially be affected by the introduced race condition. These changes are what bbryant and I came up with to fix the issue. Instead of simply dropping control frames that get sent before the handshake is complete, the code attempts to wait a little while, since in most cases, the handshake will complete very quickly. If it doesn't complete after yielding for a little while, then the frame gets dropped. ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115566 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-07Merged revisions 115512 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r115512 | russell | 2008-05-07 11:24:09 -0500 (Wed, 07 May 2008) | 11 lines Merged revisions 115511 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r115511 | russell | 2008-05-07 11:22:49 -0500 (Wed, 07 May 2008) | 3 lines Remove remnants of dlinkedlists. I didn't actually use them in the final version of my IAX2 improvements. ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115513 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05Remove my rant, since I have now replaced the rant with code.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115315 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-30Merged revisions 114891 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r114891 | russell | 2008-04-30 11:30:01 -0500 (Wed, 30 Apr 2008) | 28 lines Merge changes from team/russell/iax2_find_callno and iax2_find_callno_1.4 These changes address a critical performance issue introduced in the latest release. The fix for the latest security issue included a change that made Asterisk randomly choose call numbers to make them more difficult to guess by attackers. However, due to some inefficient (this is by far, an understatement) code, when Asterisk chose high call numbers, chan_iax2 became unusable after just a small number of calls. On a small embedded platform, it would not be able to handle a single call. On my Intel Core 2 Duo @ 2.33 GHz, I couldn't run more than about 16 IAX2 channels. Ouch. These changes address some performance issues of the find_callno() function that have bothered me for a very long time. On every incoming media frame, it iterated through every possible call number trying to find a matching active call. This involved a mutex lock and unlock for each call number checked. So, if the random call number chosen was 20000, then every media frame would cause 20000 locks and unlocks. Previously, this problem was not as obvious since Asterisk always chose the lowest call number it could. A second container for IAX2 pvt structs has been added. It is an astobj2 hash table. When we know the remote side's call number, the pvt goes into the hash table with a hash value of the remote side's call number. Then, lookups for incoming media frames are a very fast hash lookup instead of an absolutely insane array traversal. In a quick test, I was able to get more than 3600% more IAX2 channels on my machine with these changes. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114892 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-30Merged revisions 114880 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r114880 | kpfleming | 2008-04-30 09:46:57 -0500 (Wed, 30 Apr 2008) | 2 lines use the ARRAY_LEN macro for indexing through the iaxs/iaxsl arrays so that the size of the arrays can be adjusted in one place, and change the size of the arrays from 32768 calls to 2048 calls when LOW_MEMORY is defined ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114884 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-25Merged revisions 114673 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r114673 | russell | 2008-04-25 16:54:40 -0500 (Fri, 25 Apr 2008) | 3 lines Use consistent logic for checking to see if a call number has been chosen yet. Also, remove some redundant logic I recently added in a fix. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114674 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24Pass the hangup cause all the way to the calling app/channel.Michiel van Baak
(closes issue #11328) Reported by: rain Patches: 20071207__pass_cause_in_hangup_control_frame.diff.txt uploaded by Corydon76 (license 14) brought up-to-date to trunk by me git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24Merged revisions 114608 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r114608 | russell | 2008-04-24 10:55:21 -0500 (Thu, 24 Apr 2008) | 4 lines Fix a silly mistake in a change I made yesterday that caused chan_iax2 to blow up very quickly. (issue #12515) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114609 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23Merged revisions 114587 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r114587 | russell | 2008-04-23 12:16:32 -0500 (Wed, 23 Apr 2008) | 2 lines Fix find_callno_locked() to actually return the callno locked in some more cases. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22Merged revisions 114558 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r114558 | russell | 2008-04-22 17:15:36 -0500 (Tue, 22 Apr 2008) | 5 lines When we receive a full frame that is supposed to contain our call number, ensure that it has the correct one. (closes issue #10078) (AST-2008-006) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22Merged revisions 114537 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r114537 | russell | 2008-04-22 13:03:33 -0500 (Tue, 22 Apr 2008) | 9 lines If the dial string passed to the call channel callback does not indicate an extension, then consider the extension on the channel before falling back to the default. (closes issue #12479) Reported by: darren1713 Patches: exten_dial_fix_chan_iax2.c.patch uploaded by darren1713 (license 116) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-21(closes issue #6113)Jeff Peeler
Reported by: oej Tested by: jpeeler This patch implements multiple parking lots for parked calls. The default parkinglot is used by default, however setting the channel variable PARKINGLOT in the dialplan will allow use of any other configured parkinglot. See configs/features.conf.sample for more details on setting up another non-default parkinglot. Also, one can (currently) set the default parkinglot to use in the driver configuration file via the parkinglot option. Patch initially written by oej, brought up to date and finalized by mvanbaak, and then stabilized and converted to astobj2 by me. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114487 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-11Merged revisions 114083 via svnmerge from Terry Wilson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r114083 | twilson | 2008-04-11 17:32:51 -0500 (Fri, 11 Apr 2008) | 7 lines 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. (issue #12400) Reported by: ztel ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114084 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-09Merged revisions 113784 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r113784 | file | 2008-04-09 13:50:45 -0300 (Wed, 09 Apr 2008) | 4 lines 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 ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@113785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-09Merged revisions 113596 via svnmerge from Terry Wilson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r113596 | twilson | 2008-04-08 20:34:25 -0500 (Tue, 08 Apr 2008) | 2 lines Initialize fr->cacheable to make valgrind happy ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@113597 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-01Fix a typo that prevented configuration of non-dynamic peers.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@112351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-01Existing DNS manager lookups extended to check for SRV records.Jeff Peeler
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@112321 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-01This adds DNS SRV record support to DNS manager. If there is a SRV record ↵Jeff Peeler
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. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@112207 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-26Merged revisions 110628 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r110628 | file | 2008-03-25 11:37:35 -0300 (Tue, 25 Mar 2008) | 4 lines Add an option (transmit_silence) which transmits silence during both Record() and DTMF generation. The reason this is an option is that in order to transmit silence we have to setup a translation path. This may not be needed/wanted in all cases. (closes issue #10058) Reported by: tracinet ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111017 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-24Merged revisions 110614 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r110614 | russell | 2008-03-24 12:34:56 -0500 (Mon, 24 Mar 2008) | 2 lines Turn a NOTICE into a DEBUG message. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@110615 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-20Merged revisions 110336 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r110336 | russell | 2008-03-20 16:54:58 -0500 (Thu, 20 Mar 2008) | 14 lines Merged revisions 110335 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r110335 | russell | 2008-03-20 16:53:27 -0500 (Thu, 20 Mar 2008) | 6 lines Fix some very broken code that was introduced in 1.2.26 as a part of the security fix. The dnsmgr is not appropriate here. The dnsmgr takes a pointer to an address structure that a background thread continuously updates. However, in these cases, a stack variable was passed. That means that the dnsmgr thread would be continuously writing to bogus memory. ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@110337 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-18Go through and fix a bunch of places where character strings were being ↵Terry Wilson
interpreted as format strings. Most of these changes are solely to make compiling with -Wsecurity and -Wformat=2 happy, and were not actual problems, per se. I also added format attributes to any printf wrapper functions I found that didn't have them. -Wsecurity and -Wmissing-format-attribute added to --enable-dev-mode. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109447 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-07(closes issue #6002)Steve Murphy
Reported by: rizzo Tested by: murf Proposal of the changes to be made, and then an announcement of how they were accomplished: http://lists.digium.com/pipermail/asterisk-dev/2008-February/032065.html and: http://lists.digium.com/pipermail/asterisk-dev/2008-March/032124.html Here is a recap, file by file, of what I have done: pbx/pbx_config.c pbx/pbx_ael.c All funcs that were passed a ptr to the context list, now will ALSO be passed a hashtab ptr to the same set. Why? because (for the time being), the dialplan is stored in both, to facilitate a quick, low-cost move to hash-tables to speed up dialplan processing. If it was deemed necessary to pass the context LIST, well, it is just as necessary to have the TABLE available. This is because the list/table in question might not be the global one, but temporary ones we would use to stage the dialplan on, and then swap into the global position when things are ready. We now have one external function for apps to use, "ast_context_find_or_create()" instead of the pre-existing "find" and "create", as all existing usages used both in tandem anyway. pbx_config, and pbx_ael, will stage the reloaded dialplan into local lists and tables, and then call merge_contexts_and_delete, which will merge (now) existing contexts and priorities from other registrars into this local set by copying them. Then, merge_contexts_and_delete will lock down the contexts, swap the lists and tables, and unlock (real quick), and then destroy the old dialplan. chan_sip.c chan_iax.c chan_skinny.c All the channel drivers that would add regcontexts now use the ast_context_find_or_create now. chan_sip also includes a small fix to get rid of warnings about removing priorities that never got entered. apps/app_meetme.c apps/app_dial.c apps/app_queue.c All the apps that added a context/exten/priority were also modified to use ast_context_find_or_create instead. include/asterisk/pbx.h ast_context_create() is removed. Find_or_create_ is the new method. ast_context_find_or_create() interface gets the hashtab added. ast_merge_contexts_and_delete() gets the local hashtab arg added. ast_wrlock_contexts_version() is added so you can detect if someone else got a writelock between your readlocking and writelocking. ast_hashtab_compare_contexts was made public for use in pbx_config/pbx_ael ast_hashtab_hash_contexts was in like fashion make public. include/asterisk/pval.h ast_compile_ael2() interface changed to include the local hashtab table ptr. main/features.c For the sake of the parking context, we use ast_context_find_or_create(). main/pbx.c I changed all the "tree" names to "table" instead. That's because the original implementation was based on binary trees. (had a free library). Then I moved to hashtabs. Now, the names move forward too. refcount field added to contexts, so you can keep track of how many modules wanted this context to exist. Some log messages that are warnings were inflated from LOG_NOTICE to LOG_WARNING. Added some calls to ast_verb(3,...) for debug messages Lots of little mods to ast_context_remove_extension2, which is now excersized in ways it was not previously; one definite bug fixed. find_or_create was upgraded to handle both local lists/tables as well as the globals. context_merge() was added to do the per-context merging of the old/present contexts/extens/prios into the new/proposed local list/tables ast_merge_contexts_and_delete() was heavily modified. ast_add_extension2() was also upgraded to handle changes. the context_destroy() code was re-engineered to handle the new way of doing things, by exten/prio instead of by context. res/ael/pval.c res/ael/ael.tab.c res/ael/ael.tab.h res/ael/ael.y res/ael/ael_lex.c res/ael/ael.flex utils/ael_main.c utils/extconf.c utils/conf2ael.c utils/Makefile Had to change the interface to ast_compile_ael2(), to include the hashtab ptr. This ended up involving several external apps. The main gotcha was I had to include lock.h and hashtab.h in several places. As a side note, I tested this stuff pretty thoroughly, I replicated the problems originally reported by Luigi, and made triply sure that reloads worked, and everything worked thru "stop gracefully". I found a and fixed a few bugs as I was merging into trunk, that did not appear in my tests of bug6002. How's this for verbose commit messages? git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106757 65c4cc65-6c06-0410-ace0-fbb531ad65f3