aboutsummaryrefslogtreecommitdiffstats
path: root/channels
AgeCommit message (Collapse)AuthorFilesLines
2009-10-06Fix ao2_iterator API to hold references to containers being iterated.kpfleming1-0/+12
See Mantis issue for details of what prompted this change. Additional notes: This patch changes the ao2_iterator API in two ways: F_AO2I_DONTLOCK has become an enum instead of a macro, with a name that fits our naming policy; also, it is now necessary to call ao2_iterator_destroy() on any iterator that has been created. Currently this only releases the reference to the container being iterated, but in the future this could also release other resources used by the iterator, if the iterator implementation changes to use additional resources. (closes issue #15987) Reported by: kpfleming Review: https://reviewboard.asterisk.org/r/383/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@222152 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-02Removes unnecessary unlock, clarifies a memcpy.dvossel1-2/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@222026 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-01Occasionally losing use of B channels in chan_misdn.rmudgett2-41/+66
I have not been able to reproduce the problem of losing channels. However, I have seen in the code a reentrancy problem that might give these symptoms. The reentrancy patch does several things: 1) Guards B channel and B channel structure allocation. 2) Makes the B channel structure find routines more precise in locating records. 3) Never leave a B channel allocated if we received cause 44. The last item may cause temporary outgoing call problems, but they should clear when the line becomes idle. (closes issue #15490) Reported by: slutec18 Patches: issue15490_channel_alloc_reentrancy.patch uploaded by rmudgett (license 664) Tested by: rmudgett, slutec18 (closes issue #15458) Reported by: FabienToune Patches: issue15458_channel_alloc_reentrancy.patch uploaded by rmudgett (license 664) Tested by: FabienToune, rmudgett, slutec18 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@221769 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-01Use unsigned ints for portinuri flags.mnicholson1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@221588 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-30Make portinuri a bitfield.mnicholson1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@221489 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-30Fix SRV lookup and Request-URI generation in chan_sip.mnicholson1-4/+27
This patch adds a new field "portinuri" to the sip dialog struct and the sip peer struct. That field is used during RURI generation to determine if the port should be included in the RURI. It is also used in some places to determine if an SRV lookup should occur. (closes issue #14418) Reported by: klaus3000 Tested by: klaus3000, mnicholson Review: https://reviewboard.asterisk.org/r/369/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@221360 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-30Change the SSRC by default when our media stream changestwilson1-1/+23
Be default, change SSRC when doing an audio stream changes Asterisk doesn't honor marker bit when reinvited to already-bridged RTP streams,resulting in far-end stack discarding packets with "old" timestamps that areactually part of a new stream. This patch sends AST_CONTROL_SRCUPDATE whenever there is a reinvite, unless the 'constantssrc' is set to true in sip.conf. The original issue reported to Digium support detailed the following situation: ITSP <-> Asterisk 1.4.26.2 <-> SIP-based Application Server Call comes in fromITSP, Asterisk dials the app server which sends a re-invite back toAsterisk--not to negotiate to send media directly to the ITSP, but to indicatethat it's changing the stream it's sending to Asterisk. The app servergenerates a new SSRC, sequence numbers, timestamps, and sets the marker bit on the new stream. Asterisk passes through the teimstamp of the new stream, butdoes not reset the SSRC, sequence numbers, or set the marker bit. When the timestamp on the new stream is older than the timestamp on the originalstream, the ITSP (which doesn't know there has been any change) discards the newframes because it thinks they are too old. This patch addresses this by changing the SSRC on a stream update unless constantssrc=true is set in sip.conf. Review: https://reviewboard.asterisk.org/r/374/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@221086 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-29Reduce CPU usage related to building a peer merely for devicestates.tilghman1-182/+186
This fixes a 100% CPU problem in the SIP driver, found by profiling the driver while the problem was occurring. (closes issue #14309) Reported by: pkempgen Patches: 20090924__issue14309.diff.txt uploaded by tilghman (license 14) Tested by: pkempgen, vrban git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@220873 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-21Reverting merge 219520. This change was not necessary.dvossel1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@219720 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-19Make sure the iax_pvt exists before dereferencing it.russell1-1/+1
This fixes the latest crash posted on issue 15609. (issue #15609) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@219586 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-18iax2 frame double freedvossel1-1/+0
The iax frame's retrans sched id was written over right before iax2_frame_free was called. In iax2_frame_free that retrans id is used to delete the sched item. By writing over the retrans field before the sched item could be deleted, it was possible for a retransmit to occur on a freed frame. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@219519 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-18via-header branches not updated correctly on INVITEdvossel1-5/+6
INVITE requests must always contain a new unique branch id. When a new branch id is created for an INVITE, the dialog's invite_branch variable must be updated so CANCEL requests use the correct branch id. (closes issue #15262) Reported by: maniax Patches: asterisk-1.6.1.0-sip-branch.patch uploaded by tweety (license 608) invite_new_branch_trunk.diff uploaded by dvossel (license 671) Tested by: maniax, dvossel git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@219450 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-17Send a 100 Trying response when we detect a spiral.mmichelson1-0/+1
This was problematic during spiral tests at SIPit... along with some other things as well. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@219320 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-17INVITE w/Replaces deadlock fixdvossel1-43/+25
This patch cleans up the locking logic in chan_sip.c's handle_invite_replaces() function as well as making use of ast_do_masquerade() rather than forcing the masquerade on an ast_read(). The code had several redundant unlocks that would result in 'freed more times than we've locked!' errors. I cleaned these up as well as moving all the unlock logic to the end of the function. This patch should also resolve the issue people were having with the replacecall channel never being unlocked with one legged calls. (closes issue #15151) Reported by: irroot Patches: invite_w_replaces_1.4.diff uploaded by dvossel (license 671) Tested by: irroot, dvossel Review: https://reviewboard.asterisk.org/r/371/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@219303 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-15Fix small memory leak in handle_init_event by always destroying the pthreadjpeeler1-0/+3
attr before returning. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@218623 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-15Send request contact header field with response to registrer queries instead ↵mnicholson1-1/+5
of the address of record. (closes issue #14438) Reported by: ravindrad Patches: regquerypatch uploaded by ravindrad (license 684) Tested by: ravindrad git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@218578 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-15revert accidental commitkpfleming1-136/+107
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@218498 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-15Use proper hostname for downloading sound files.kpfleming1-107/+136
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@218497 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-14Fix handling of DAHDI_EVENT_REMOVED event to prevent crash in do_monitor.jpeeler1-16/+25
After talking to rmudgett about some of his recent iflist locking changes, it was determined that the only place that would destroy a channel without being explicitly to do so was in handle_init_event. The loop to walk the interface list has been modified to wait to destroy the channel until the dahdi_pvt of the channel to be destroyed is no longer needed. (closes issue #15378) Reported by: samy git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@218401 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-10Backport realtime fix to 1.4tilghman2-4/+9
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@217917 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-10IAX2 encryption regressiondvossel1-5/+27
The IAX2 Call Token security patch inadvertently broke the use of encryption due to the reorganization of code in the socket_process() function. When encryption is used, an incoming full frame must first be decrypted before the information elements can be parsed. The security release mistakenly moved IE parsing before decryption in order to process the new Call Token IE. To resolve this, decryption of full frames is once again done before looking into the frame. This involves searching for an existing callno, checking the pvt to see if encryption is turned on, and decrypting the packet before the internal fields of the full frame are accessed. associated with AST-2009-006 (closes issue #15834) Reported by: karesmakro Patches: iax2_encryption_fix_1.4.diff uploaded by dvossel (license 671) Tested by: dvossel, karesmakro Review: https://reviewboard.asterisk.org/r/355/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@217806 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-10Remove harmful code that causes endless loops. oej1-5/+0
Remove code that causes loops in registrations. We have agreed that the patch that this code was part of was bad. I am ripping out the code that causes the issue. putnopvut needs to check the rest of the patch, if it needs to be changed as well. This solves the issue reported in #15540, but needs more work before we close it (as described above). git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@217668 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-04make chan_sip compile under devmode againmvanbaak1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@216432 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-04Make apps send PROGRESS control frame for early media and fix too early ↵oej1-3/+10
media issue in SIP The issue at hand is that some legacy (dying) PBX systems send empty media frames on PRI links *before* any call progress. The SIP channel receives these frames and by default signals 183 Session progress and starts sending media. This will cause phones to play silence and ignore the later 180 ringing message. A bad user experience. The fix is twofold: - We discovered that asterisk apps that support early media ("noanswer") did not send any PROGRESS frame to indicate early media. Fixed. - We introduce a setting in chan_sip so that users can disable any relay of media frames before the outbound channel actually indicates any sort of call progress. In 1.4, 1.6.0 and 1.6.1, this will be disabled for backward compatibility. In later versions of Asterisk, this will be enabled. We don't assume that it will change your Asterisk phone experience - only for the better. We encourage third-party application developers to make sure that if they have applications that wants to send early media, add a PROGRESS control frame transmission to make sure that all channel drivers actually will start sending early media. This has not been the default in Asterisk previous to this patch, so if you got inspiration from our code, you need to update accordingly. Sorry for the trouble and thanks for your support. This code has been running for a few months in a large scale installation (over 250 servers with PRI and/or BRI links to old PBX systems). That's no proof that this is an excellent patch, but, well, it's tested :-) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@216430 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-03Merge code associated with AST-2009-006dvossel4-123/+1228
(closes issue #12912) Reported by: rathaus Tested by: tilghman, russell, dvossel, dbrooks git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@216000 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-02Re-send non-100 provisional responses to prevent cancellationtwilson1-7/+72
From section 13.3.1.1 of RFC 3261: If the UAS desires an extended period of time to answer the INVITE, it will need to ask for an "extension" in order to prevent proxies from canceling the transaction. A proxy has the option of canceling a transaction when there is a gap of 3 minutes between responses in a transaction. To prevent cancellation, the UAS MUST send a non-100 provisional response at every minute, to handle the possibility of lost provisional responses. (closes issue #11157) Reported by: rjain Tested by: twilson Review: https://reviewboard.asterisk.org/r/315/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@215682 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-31Also unlock the "other" channel, when returning, due to glare.tilghman1-0/+3
(closes issue #15787) Reported by: tim_ringenbach Patches: chan_local.diff uploaded by tim ringenbach (license 540) Tested by: tim_ringenbach git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@214940 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-21Ensure that T.38 INVITEs generated by Asterisk properly result in T.38 being ↵kpfleming1-5/+7
enabled. (closes issue #15373) Reported by: dcolombo Patches: chan_sip.patch uploaded by mbrancaleoni (license 342) Tested by: dcolombo, mbrancaleoni git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@213631 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-18Removed some deadwood and added some doxygen comments.rmudgett1-29/+30
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@212727 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-17Fix segfault when reloading chan_misdn.jpeeler1-0/+5
If more ports were specified than configured in misdn.conf a reload would crash asterisk. The problem was the unconfigured port was using data from the previously configured port. When the data for an unconfigured port was freed a crash would result from the double free. (closes issue #12113) Reported by: agupta Patches: bug12113.patch uploaded by jpeeler (license 325) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@212498 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-17Fix uninitialized variable.rmudgett1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@212430 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-12Backport fix so that outbound CANCEL requests have same branch as challenged ↵mmichelson1-1/+5
INVITEs. There already was code present to be sure that a CANCEL will contain the same branch-id as the INVITE it is cancelling. However, for INVITES which are challenged downstream, this mechanism did not work properly. Now this is taken care of. This is a backport of a fix already present in all 1.6.X branches and in trunk. It also fixes ABE-1907. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@211807 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-10AST-2009-005tilghman12-92/+92
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@211528 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-05Dialplan starts execution before the channel setup is complete.rmudgett1-45/+59
* Issue 15655: For the case where dialing is complete for an incoming call, dahdi_new() was asked to start the PBX and then the code set more channel variables. If the dialplan hungup before these channel variables got set, asterisk would likely crash. * Fixed potential for overlap incoming call to erroneously set channel variables as global dialplan variables if the ast_channel structure failed to get allocated. * Added missing set of CALLINGSUBADDR in the dialing is complete case. (closes issue #15655) Reported by: alecdavis git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@210575 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-03Fixes dialplan wildcard extension taking precedence over call pickup code.dbrooks1-29/+29
Prior to this patch, a wildcard extension in the dialplan (for example, _*.) would take precedence over picking up a call in the channel's pickup group. This patch simply moves the block of code handling pickup group matching to above the extension matching code. (closes issue #14735) Reported by: stevedavies Review: https://reviewboard.asterisk.org/r/319/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@210067 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-03Reverting index() fix, applying a different methodology, based upon ↵tilghman1-1/+1
developer discussions. (related to issue #15639) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@210066 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-01Minor changes inspired by testing with latest GCC.kpfleming2-6/+11
The latest GCC (what will become 4.5.x) has a few new warnings, that in these cases found some either downright buggy code, or at least seriously poorly designed code that could be improved. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@209759 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-27Fix logic errors from 208746jpeeler1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@208923 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-25Fix compiling under dev-mode with gcc 4.4.0.jpeeler2-4/+8
Mostly trivial changes, but I did not know of any other way to fix the "dereferencing type-punned pointer will break strict-aliasing rules" error without creating a tmp variable in chan_skinny. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@208746 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-24Only send a BYE when hanging up a channel that is up.mmichelson1-1/+3
For cases where Asterisk sends an INVITE and receives a non 2XX final response, Asterisk would follow the INVITE transaction by immediately sending a BYE, which was unnecessary. (closes issue #14575) Reported by: chris-mac git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@208587 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-23Fix a problem where a 491 response could be sent out of dialog.mmichelson1-10/+11
This generalizes the fix for issue 13849. The initial fix corrected the problem that Asterisk would reply with a 491 if a reinvite were received from an endpoint and we had not yet received an ACK from that endpoint for the initial INVITE it had sent us. This expansion also allows Asterisk to appropriately handle an INVITE with authorization credentials if Asterisk had not received an ACK from the previous transaction in which Asterisk had responded to an unauthorized INVITE with a 407. (closes issue #14239) Reported by: klaus3000 Patches: 14239.patch uploaded by mmichelson (license 60) Tested by: klaus3000 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@208386 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-23Only set the priindication setting when not performing a reloadjpeeler1-1/+1
(closes issue #14696) Reported by: fdecher git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@208380 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-23Remove inaccurate XXX comment.mmichelson1-4/+0
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@208312 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-23Properly handle 183 responses which do not contain an SDP.mmichelson1-1/+12
(closes issue #15442) Reported by: ffloimair Patches: 15442.patch uploaded by mmichelson (license 60) Tested by: tkarl, ffloimair git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@208262 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-21Wait for wink before dialing when using E&M wink signalingjpeeler1-3/+3
There was already code for other signaling types in dahdi_handle_event to handle dialing if a dial operation dial string was present. Simply add SIG_EMWINK to the list. (closes issue #14434) Reported by: araasch git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@207827 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-21Revert r207573, this approach could potentially block for an unacceptable jpeeler1-55/+1
amount of time. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@207786 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-21Ensure that user-provided CFLAGS and LDFLAGS are honored.kpfleming1-6/+6
This commit changes the build system so that user-provided flags (in ASTCFLAGS and ASTLDFLAGS) are supplied to the compiler/linker *after* all flags provided by the build system itself, so that the user can effectively override the build system's flags if desired. In addition, ASTCFLAGS and ASTLDFLAGS can now be provided *either* in the environment before running 'make', or as variable assignments on the 'make' command line. As a result, the use of COPTS and LDOPTS is no longer necessary, so they are no longer documented, but are still supported so as not to break existing build systems that supply them when building Asterisk. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@207647 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-20Wait for wink before dialing when using E&M wink signalingjpeeler1-1/+55
This patch adds a new dahdi_wait function to specifically wait for the wink event. If the wink is not eventually received the channel is hung up. (closes issue #14434) Reported by: araasch Patches: emwinkmod uploaded by araasch (license 693) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@207573 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-20Answer video SDP offers properly when videosupport is not enabled.mmichelson1-3/+43
Copied from Review board: In issue 12434, the reporter describes a situation in which audio and video is offered on the call, but because videosupport is disabled in sip.conf, Asterisk gives no response at all to the video offer. According to RFC 3264, all media offers should have a corresponding answer. For offers we do not intend to actually reply to with meaningful values, we should still reply with the port for the media stream set to 0. In this patch, we take note of what types of media have been offered and save the information on the sip_pvt. The SDP in the response will take into account whether media was offered. If we are not otherwise going to answer a media offer, we will insert an appropriate m= line with the port set to 0. It is important to note that this patch is pretty much a bandage being applied to a broken bone. The patch *only* helps for situations where video is offered but videosupport is disabled and when udptl_pt is disabled but T.38 is offered. Asterisk is not guaranteed to respond to every media offer. Notable cases are when multiple streams of the same type are offered. The 2 media stream limit is still present with this patch, too. In trunk and the 1.6.X branches, things will be a bit different since Asterisk also supports text in SDPs as well. (closes issue #12434) Reported by: mnnojd Review: https://reviewboard.asterisk.org/r/311 Review: https://reviewboard.asterisk.org/r/313 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@207423 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-17Fix format specifier to print out an unsigned long long.jpeeler1-1/+1
Yep, it's even ifdefed out code. But it made it to the RR list... (closes issue #14726) Reported by: lmadsen git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@207155 f38db490-d61c-443f-a65b-d21fe96a405b