aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_iax2.c
AgeCommit message (Collapse)AuthorFilesLines
2007-12-18Oops, missed this one casetilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@93675 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-18Fixing AST-2007-027 (Closes issue #11119)tilghman1-7/+65
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@93667 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-24Don't create the Asterisk channel until we are starting the PBX on it.qwell1-16/+14
(ASA-2007-018) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@76802 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-19When processing full frames, take sequence number wraparound into account whenrussell1-1/+3
deciding whether or not we need to request retransmissions by sending a VNAK. This code could cause VNAKs to be sent erroneously in some cases, and to not be sent in other cases when it should have been. (closes issue #10237, reported and patched by mihai) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@75927 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-18When traversing the queue of frames for possible retransmission afterrussell1-1/+1
receiving a VNAK, handle sequence number wraparound so that all frames that should be retransmitted actually do get retransmitted. (issue #10227, reported and patched by mihai) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@75757 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-17Ensure that when encoding the contents of an ast_frame into an iax_frame, thatrussell1-2/+5
the size of the destination buffer is known in the iax_frame so that code won't write past the end of the allocated buffer when sending outgoing frames. (ASA-2007-014) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@75444 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-17After parsing information elements in IAX frames, set the data length to zero,russell1-0/+1
so that code later on does not think it has data to copy. (ASA-2007-015) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@75440 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-11The function make_trunk() can fail and return -1 instead of a valid new callrussell1-3/+8
number. Fix the uses of this function to handle this instead of treating it as the new call number. This would cause a deadlock and memory corruption. (possible cause of issue #9614 and others, patch by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@74766 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-29Backport changes that make chan_iax2 not start the PBX on an incoming channelrussell1-8/+34
until the three-way call setup is completed. These changes are already in 1.4 and trunk. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@72629 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-23if we are going to set variables on a newly created channel, it should be ↵kpfleming1-3/+5
done *before* we start the PBX on it git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@65676 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-10Fix an issue with trying to kill a thread before it gets created.qwell1-1/+2
Issue 9709, patch by nic_bellamy. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@63828 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-02Issue 9638 - if a text frame is sent with no terminating NULL through a bridgedtilghman1-0/+7
IAX connection, the remote end will receive garbage characters tacked onto the end. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@62691 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-26Revert previous fix for when the IAX2 channel goes funky (that's the ↵file1-2/+6
technical term). This is causing legit calls to be prematurely hung up. (issue #9600 reported by justdave) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@62037 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-25If the callerid= option is specified, but empty, clear any previous data.russell1-0/+8
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@61866 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-25Ensure that callerid settings are reset on a reload.russell1-6/+16
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@61862 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-29Backport the change to chan_iax2 to return NULL instead of a "null frame"russell1-3/+2
from its read callback. See revision 59341 to the 1.4 branch for more info. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@59355 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-27Fix the use of the "sourceaddress" option when "bindaddr" is set to 0.0.0.0russell1-3/+42
instead of having each interface explicitly listed. (issue #7874, patch by stevens) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@59258 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-07Fix a problem where the Asterisk channel name could be that of the wrong IAX2russell1-11/+19
user for a call. This is because the first step of choosing this name is to look for an IAX2 peer that happens to have the same IP/port number that this call is coming from and assuming that is it. However, this is not always correct. So, I have made it change this name after authentication happens since at that point, we have an exact match. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@58242 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-23Don't destroy mutexes before unregistering all of the entry points from the ↵russell1-4/+9
core. Also, fix a potential memory leak from not destroying the locks for all of the possible call numbers (about 32k of them). git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@56406 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-07Fix a few potential memory leaks with realtime users and peers. (issue #8999 ↵file1-11/+12
reported by bsmithurst) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@53357 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-31Fix a bunch of places where pthread_attr_init() was called, butrussell1-1/+5
pthread_attr_destroy() was not. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@53045 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-30Fix the extraction of the timestamp from video frames. It was using therussell1-2/+2
mapping for a mini-frame instead of a video-frame, which caused it to get invalid data. (issue #8795, mihai) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@52762 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-27Make the last context entry read in the dominant one. (issue #8918 reported ↵file1-4/+2
by pj) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@52360 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-08Ensure we use the default refresh value of 60 if the remote server does not ↵file1-1/+1
send one. (issue #8746 reported by maethor) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@49889 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-05ensure that threads which are supposed to be detached (because we aren't ↵kpfleming1-2/+12
going to wait on them) are created properly git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@49635 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-24Check for the proper return value on an error in a call to mmap().russell1-1/+1
This was reported by Andy Wang on the asterisk-dev list. Thanks! git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@48943 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-09Use locking when accessing the registrations list. This list is not actuallyrussell1-2/+11
used very often, so the likelihood of there being a problem is pretty small, but still possible. For example, if the CLI command to list the registrations was called at the same time that a reload was occurring and the registrations list was getting destroyed and rebuilt, a crash could occur. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@48361 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-30Only print out debug message if bridged channel is not NULL. (issue #8412 ↵file1-1/+1
reported by jubilex) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@48157 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-12Only do the check to determine whether the channel calling this function is anrussell1-4/+4
IAX2 channel when getting the IP address using the special argument, CURRENTCHANNEL. (issue #8341, jcovert) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@47496 f38db490-d61c-443f-a65b-d21fe96a405b
2006-10-13when sending a call to a peer, use the proper socket if we have multiple ↵kpfleming1-0/+3
bindings (reported on asterisk-dev) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@45048 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-24Check to see if the channel that is activating the IAXPEER function is actuallyrussell1-0/+5
an IAX2 channel before proceeding to process it to avoid crashing. (issue #8017, reported by admott, fixed by myself) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@43552 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-16When a realtime peer expires, reset the ipaddress in the realtime database ↵tilghman1-0/+2
back to 0 (Issue 6656) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@43019 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-06Make realtime regseconds work as people expected (0 on registration ↵file1-12/+18
expiration or release, and actual on normal state) (issue #7684 reported by kshumard) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@42086 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-30Restore original functionality of 1.2 in places where ANI was not set, but wasrussell1-2/+0
changed to be set. The original change was done to ensure that the behavior of the "callerid" option in each channel driver was consistent, but it caused an unexpected behavior change of CDR records for users, so this change is being reverted in 1.2. (issue #7695) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@41411 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-05Fix an issue that would cause a NewCallerID manager event to be generatedrussell1-9/+16
before the channel's NewChannel event. This was due to a somewhat recent change that included using ast_set_callerid() where it wasn't before. This function should not be used in the channel driver "new" functions. (issue #7654, fixed by me) Also, fix a couple minor bugs in usecount handling. chan_iax2 could have increased the usecount but then returned an error. The place where chan_sip increased the usecount did not call ast_update_usecount() git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@38904 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-27Fix crash when using the "regexten" option with MALLOC_DEBUG enabled. This wasrussell1-1/+10
not reported in the bug tracker but the same bug has been demonstrated in other places in the code. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@38328 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-19ensure that global 'maxauthreq' is reset to zero during 'reload'kpfleming1-0/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@37949 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-12Add support to have maxauthreq as a global optionfile1-0/+6
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@37439 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-12remove some more bad examples of using printfkpfleming1-12/+0
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@37419 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-11Add configuration option for IAX2 users that will limit the amount of ↵file1-6/+92
outstanding AUTHREQs we are waiting for replies on. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@37378 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-03use ast_set_callerid to be more consistent and to make sure that therussell1-6/+2
"callerid" option in the conf files is always handled the same way and sets ANI (issue #7285, gkloepfer) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@36725 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-18don't store multiple secrets delimited with semicolons for peers because thisrussell1-5/+1
is only valid for users. Instead, only keep the last specified secret for a peer entry. Also, document how multiple secrets are handled in the sample config. (Reported by PCadach on #asterisk-bugs) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@34627 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-16Zero out a declared structure so as to not crash if it contains invalid data ↵file1-0/+1
(reported by Qwell on #asterisk-dev) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@34400 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-14use existing dial string parser for strings supplied to iax2_devicestate, ↵kpfleming1-37/+25
because they can be complete dial strings, not just device names git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@34159 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-09Remove an unneeded double lock (issue #7310 reported by arkadia)file1-2/+0
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@33297 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-07fix some broken code with BRIDGE_OPTIMIZATION defined (issue #7292)russell1-4/+4
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@32818 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-06clean up yesterday's security fix to not cause breakage when video mini ↵kpfleming1-12/+19
frames are received git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@32566 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-05ensure that the received number of bytes is included in all IAX2 incoming ↵kpfleming1-26/+37
frame analysis checks (fixes a known vulnerability) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@32373 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-23fix the sourceaddress option (issue #7213, alphaque)russell1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@29849 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-20don't try to predict where the compiler will place things on the stack... ↵kpfleming1-428/+428
put them in the right place explicitly (issues #7029 and #7100, maybe others) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@28896 f38db490-d61c-443f-a65b-d21fe96a405b