aboutsummaryrefslogtreecommitdiffstats
path: root/channels
AgeCommit message (Collapse)AuthorFilesLines
2008-06-03Save the callno when we're poking, because our peer structure could changetilghman1-4/+7
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: http://svn.digium.com/svn/asterisk/branches/1.4@120001 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-03Treat ECONNREFUSED as an error that will stop further retransmissions. ↵file1-5/+6
(issue #AST-58, patch from Switchvox) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@119926 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-02Revert a change made for issue #12479. This change caused a regression such ↵russell1-4/+1
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: http://svn.digium.com/svn/asterisk/branches/1.4@119838 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-02Do not link the guest account with any configured XMPP client (inphsultan1-10/+26
jabber.conf). The actual connection is made when a call comes in Asterisk. Fix the ast_aji_get_client function that was not able to retrieve an XMPP client from its JID. (closes issue #12085) Reported by: junky Tested by: phsultan git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@119740 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-02Even of the first PING or LAGRQ doesn't get sent because it comes up too soon,russell1-6/+4
make sure to reschedule so it gets sent later. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@119687 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-02fixed compile issue when dev-mode is enabledcrichter1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@119636 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-02Added counter for unhandled_bmsg Print, this prevents the logs to be flooded ↵crichter2-4/+44
to fast and save CPU in this error scenario. Added 'last_used' element to bc structure, when a bchannel changes from used to free this exact time will be marked in last_used. When a new channel is requested the find_free_chan function will check if the new empty channel was used within the last second, if yes it will search for the next channel, if no it will return this channel. This simple mechanism has prooven to prevent race conditions where the NT and TE tried to allocate the exact same channel at the same time (RELEASE cause: 44). git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@119585 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-02Change a debug message to an actual debug messagerussell1-1/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@119533 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-30Merged revisions 119237 via svnmerge from russell1-7/+37
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: http://svn.digium.com/svn/asterisk/branches/1.4@119238 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-29Call waiting tone occurs too often, because it's getting serviced by bothtilghman1-3/+5
subchannels. (closes issue #11354) Reported by: cahen Patches: 20080512__bug11354.diff.txt uploaded by Corydon76 (license 14) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@119071 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-29Merged revisions 119008 via svnmerge from russell1-8/+10
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: http://svn.digium.com/svn/asterisk/branches/1.4@119009 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-29Add some debugging code that ensures that when we do deadlock avoidance, wetilghman6-79/+26
don't lose the information about how a lock was originally acquired. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@118953 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-28merge revision 118702 from trunk to 1.4 -- Fixes a bug in chan_iax that uses ↵bbryant1-1/+5
send_command to poke a peer while a 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: http://svn.digium.com/svn/asterisk/branches/1.4@118716 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-28Add an option to use the source IP address of RTP as the destination IP ↵file1-1/+15
address of UDPTL when a specific option is enabled. If the remote side is properly configured (ports forwarded) then UDPTL will flow. (closes issue #10417) Reported by: cstadlmann git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@118646 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-27Fix an issue where codec preferences were not set on dialogs that were not ↵file1-16/+13
authenticated via a user or peer and allow framing to work without rtpmap in the SDP. (closes issue #12501) Reported by: slimey git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@118558 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-25Realtime flag affects construction in multiple ways, so consulting whethertilghman1-6/+16
rtcachefriends was set was done too soon (needed to be done inside build_peer, not just as a flag to build_peer). Also, fullcontact needed to be reconstructed, because realtime separates the embedded ';' into multiple fields. (closes issue #12722) Reported by: barthpbx Patches: 20080525__bug12722.diff.txt uploaded by Corydon76 (license 14) Tested by: barthpbx (Much of the discussion happened on #asterisk-dev for diagnosing this issue) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@118251 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-23Fix a few things I missed to ensure zt_chan_conf structure is not modified ↵jpeeler1-3/+3
in mkintf git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@118163 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-21Ensure that passed in zt_chan_conf structure is not modified in mkintf.jpeeler1-18/+30
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@117582 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-21Apply the autoframing setting to dialogs that do not get matched against a ↵file1-0/+1
user or peer. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@117574 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-21Pass a pointer for the conf parameter to the function mkintf rather than the ↵jpeeler1-126/+126
whole zt_chan_conf structure. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@117462 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-19Make chan_h323 work with pwlib 1.12.0file1-0/+12
(closes issue #12682) Reported by: bamby Patches: pwlib_nopipe.diff uploaded by bamby (license 430) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@117081 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-19Avoid access of uninitialized memory. This caused a bunch of crashes for merussell1-1/+1
while doing load testing of development branch where I'm working on some performance improvements. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@116978 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-16Check to make sure an RTP structure exists before calling ast_rtp_new_source ↵file1-1/+3
on it. (closes issue #12669) Reported by: sbisker git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@116799 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-14Add ast_assert(), which can be used to handle fatal errors. It is only compiledrussell1-1/+1
in if dev-mode is enabled, and only aborts if DO_CRASH is defined. (inspired by issue #12650) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@116463 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-14Accept text messages even withoej1-1/+1
Content-Type: text/plain;charset=Södermanländska git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@116230 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-13Fix a deadlock involving channel autoservice and chan_local that was debuggedrussell1-11/+14
and fixed by mmichelson and me. We observed a system that had a bunch of threads stuck in ast_autoservice_stop(). The reason these threads were waiting around is because this function waits to ensure that the channel list in the autoservice thread gets rebuilt before the stop() function returns. However, the autoservice thread was also locked, so the autoservice channel list was never getting rebuilt. The autoservice thread was stuck waiting for the channel lock on a local channel. However, the local channel was locked by a thread that was stuck in the autoservice stop function. It turned out that the issue came down to the local_queue_frame() function in chan_local. This function assumed that one of the channels passed in as an argument was locked when called. However, that was not always the case. There were multiple cases in which this channel was not locked when the function was called. We fixed up chan_local to indicate to this function whether this channel was locked or not. The previous assumption had caused local_queue_frame() to improperly return with the channel locked, where it would then never get unlocked. (closes issue #12584) (related to issue #12603) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@116038 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-13Use the right flag to open the audio in non-blocking.file1-2/+1
(closes issue #12616) Reported by: nicklewisdigiumuser git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@115944 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-08Remove debug output.russell1-4/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@115568 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-08Merged revisions 115564 via svnmerge from russell1-0/+18
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: http://svn.digium.com/svn/asterisk/branches/1.4@115565 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-08Don't give up on attempting an outbound registration if we receive a 408 ↵russell1-2/+0
Timeout. (closes issue #12323) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@115561 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-07Track peer references when stored in the sip_pvt struct as the peer related torussell1-6/+11
a qualify ping or a subscription. This fixes some realtime related crashes. (closes issue #12588) (closes issue #12555) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@115517 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-07Merged revisions 115511 via svnmerge from russell1-3/+0
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: http://svn.digium.com/svn/asterisk/branches/1.4@115512 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-05Avoid putting opaque="" in Digest authentication. This patch came from ↵russell1-2/+9
switchvox. It fixes authentication with Primus in Canada, and has been in use for a very long time without causing problems with any other providers. (closes issue AST-36) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@115304 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-02Add new "pri show version" command to show the libpri version for support ↵bbryant1-0/+12
reasons. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@115257 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-30Merge changes from team/russell/iax2_find_callno and iax2_find_callno_1.4russell1-123/+248
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: http://svn.digium.com/svn/asterisk/branches/1.4@114891 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-30Don't crash on bad SIP replys.oej1-4/+6
Fix created in Huntsville together with Mark M (putnopvut) (closes issue #12363) Reported by: jvandal Tested by: putnopvut, oej git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114890 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-30use the ARRAY_LEN macro for indexing through the iaxs/iaxsl arrays so that ↵kpfleming2-18/+32
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: http://svn.digium.com/svn/asterisk/branches/1.4@114880 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-28When modules are embedded, they take on a different name, without the ".so"tilghman1-2/+7
extension. Specifically check for this name, when we're checking if a module is loaded. (Closes issue #12534) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114708 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-25Use consistent logic for checking to see if a call number has been chosen yet.russell1-5/+5
Also, remove some redundant logic I recently added in a fix. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114673 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-24Re-invite RTP during a masquerade so that, for instance, an AMImmichelson1-0/+7
redirect of two channels which are natively bridged will preserve audio on both channels. This prevents a problem with Asterisk not re-inviting due to one of the channels having being a zombie. (closes issue #12513) Reported by: mneuhauser Patches: asterisk-1.4-114602_restore-RTP-on-fixup.patch uploaded by mneuhauser (license 425) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114632 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-24Resolve a deadlock in chan_local by releasing the channel lockmmichelson1-0/+6
temporarily. (closes issue #11712) Reported by: callguy Patches: 11712.patch uploaded by putnopvut (license 60) Tested by: acunningham git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114624 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-24Ensure that when we set the accountcode, it actually shows up in the CDR.tilghman1-0/+1
(Fix for AMI Originate) (Closes issue #12007) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114621 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-24Fix a silly mistake in a change I made yesterday that caused chan_iax2 to blowrussell1-2/+2
up very quickly. (issue #12515) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114608 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-24Only have one max-forwards header in outbound REFERs.oej1-1/+0
Discovered in the Asterisk SIP Masterclass in Orlando. Thanks Joe! git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114603 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-23Fix find_callno_locked() to actually return the callno locked in some more ↵russell1-2/+4
cases. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114587 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-23Add 502 support for both directions, not only one... (see r114571)oej1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114584 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-22Treat a 502 just like a 503, when it comes to processing a response codetilghman1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114571 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-22When we receive a full frame that is supposed to contain our call number,russell1-22/+38
ensure that it has the correct one. (closes issue #10078) (AST-2008-006) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114558 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-22If the dial string passed to the call channel callback does not indicate anrussell1-2/+6
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: http://svn.digium.com/svn/asterisk/branches/1.4@114537 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-22Merge changes from team/russell/issue_9520russell1-36/+109
These changes make sure that the reference count for sip_peer objects properly reflects the fact that the peer is sitting in the scheduler for a scheduled callback for qualifying peers or for expiring registrations. Without this, it was possible for these callbacks to happen at the same time that the peer was being destroyed. This was especially likely to happen with realtime peers, and for people making use of the realtime prune CLI command. (closes issue #9520) Reported by: kryptolus Committed patch by me git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114522 f38db490-d61c-443f-a65b-d21fe96a405b