summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
AgeCommit message (Collapse)Author
2006-09-11More formattingOlle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42767 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-11More formatting/doxygen updates to keep me occupiedOlle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42766 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-11Ignore this. Only whitespace fixes while being bored.Olle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42753 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-11Change from "r" as a variable name to "dialog". "r" is commonly used for ↵Olle Johansson
registrations, not dialogs, in other places of the code... git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42752 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-11Use Timer T1 for dialog timeouts/destruction Olle Johansson
(If you have qualify=yes, we will use the actual roundtrip time) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-10If the leading underscore is not stripped before comparison,Tilghman Lesher
pbx_builtin_getvar_helper() will never find the associated variable. (Bug 7892) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-09Don't destruct sessions prematurely. Especially not when we want reliable ↵Olle Johansson
retransmissions... If this works properly, we might have to check 1.2 to implement a backport. The theory is that if you get a final reply in a session, it is ok to destroy the session. If you send a final reply, you need to keep the session open for potential retransmits from the other side. If you send a HANGUP/CANCEL, wait to the other side confirms or until you have a timeout. If you send HANGUP/CANCEL/ACK reliably, don't destroy the session so that you cancel the needed retransmits. I will have to change the timer to 64*T1, but that will be a separate patch. That will mean that if we know the roundtrip time, we can destroy sessions quicker. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42537 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-09importing rev 42535 from 1.2 (which by mistake was actually imported from ↵Olle Johansson
svn trunk) - Maybe the first circular commit? git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-09Don't destroy pvt prematurely. Wait for answer or timeout.Olle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42531 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-09Clear proper flagOlle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-07Convert some warnings into debug messages since they can exist under ↵Joshua Colp
perfectly normal circumstances that the user shouldn't care about (issue #7894 reported by stephen_dredge) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-04Make sure we handle CANCEL/ACK properly (imported with mods from 1.2)Olle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-01Merged revisions 41768 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r41768 | file | 2006-09-01 18:49:07 -0400 (Fri, 01 Sep 2006) | 2 lines Only wipe the redirected audio & video IP/port if it's specified, and trigger a reinvite. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41769 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-01If we are doing video and we can't reinvite, then resort to generic bridging ↵Joshua Colp
instead of Packet2Packet since video isn't supported there yet. (reported by PCadach in #asterisk-bugs) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41718 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-01If no number is specified in the SIP_HEADER dialplan function, then just use ↵Joshua Colp
the first one. (issue #7854 reported by sxpert and issue #7863 reported by hristo) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-31everything that loads a config that needs a config file to runMatt O'Gorman
now reports AST_MODULE_LOAD_DECLINE when loading if config file is not there, also fixed an error in res_config_pgsql where it had a non static function when it should. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41633 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-31Merge in VLDTMF support with Zaptel/Core done by the ever great Darumkilla ↵Joshua Colp
Russell Bryant and the RTP portion done by myself, Muffinlicious Joshua Colp. This has gone through so many discussions/revisions it's not funny but we finally have it! git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-30Why check bridgepeer twice?Olle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41457 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-30Don't add headers to an uninitialized eq (from issue 7694 garyhai, but notOlle Johansson
a resolution to that bug report) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41437 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-30Note to myself: Remember Russell's note: Always compile first...Olle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-30Mark ALERT_INFO as deprecated. This can now be done with the sipaddheader() ↵Olle Johansson
application and does not need special code in chan_sip any more. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-30Issue #7572 (Boesl) - hangup channel that get buggy 487 response (imported ↵Olle Johansson
from 1.2) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-30Issue #7822 - don't issue SRV lookups if it's disabled. (barthek)Olle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-30Use an API call (ast_rtp_get_bridged) to return the RTP stream we are ↵Joshua Colp
bridged to, and also use it in chan_sip so we know to ignore the no RTP activity checking git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-28Merge in RTP-level packet bridging. Packet comes in, packet goes out - ↵Joshua Colp
that's what RTP-level packet bridging is all about! git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41235 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21Allow an offset for SIP_HEADER so you can get more then 1 header of the same ↵Joshua Colp
name if they exist. Why someone would want to grab something like Via headers from dialplan I don't exactly know, but okay. (issue #7563 reported by Corydon76) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40781 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21merge new_loader_completion branch, including (at least):Kevin P. Fleming
- restructured build tree and makefiles to eliminate recursion problems - support for embedded modules - support for static builds - simpler cross-compilation support - simpler module/loader interface (no exported symbols) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-17fix the use of an uninitialized variable (issue #7746, pointed out by garyhai)Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-16Move things around a bit more for onhold support, and add a check to only ↵Joshua Colp
decrement the onhold variable if it's greater then 0. (issue #7740 reported by AuPix) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-16move the calls to ast_jb_configure() to before the PBX thread is started on theRussell Bryant
channel to remove the theoretical race condition that the channel could get bridged before the channel's jitterbuffer gets configured. This was pointed out by PCadach on IRC. Thanks! git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39964 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-15print a more user friendly error message with the text representation of codecsRussell Bryant
(issue #7233, Mithraen) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39933 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-15reduce duplicated code by using print_codec_to_cli in sip_show_user as it isRussell Bryant
already used in sip_show_peer (issue #7739, DEA) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-10Add support to see if a peer has someone on hold, and fix a small bug with ↵Joshua Colp
getting the state name. This one goes out to you mog! git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-08Merge team/russell/ast_verbose_threadstorageRussell Bryant
- instead of defining a free() wrapper in a bunch of files, define it as ast_free() in utils.h and remove the copies from all the files. - centralize and abstract the code used for doing thread storage. The code lives in threadstorage.h, with one function being implemented in utils.c. This new API includes generic thread storage as well as special functions for handling thread local dynamic length string buffers. - update ast_inet_ntoa() to use the new threadstorage API - update ast_state2str() to use the new threadstorage API - update ast_cli() to use the new threadstorage API - Modify manager_event() to use thread storage. Instead of using a buffer of 4096 characters as the workspace for building the manager event, use a thread local dynamic string. Now there is no length limitation on the length of the body of a manager event. - Significantly simplify the handling of ast_verbose() ... - Instead of using a static char buffer and a lock to make sure only one thread can be using ast_verbose() at a time, use a thread local dynamic string as the workspace for preparing the verbose message. Instead of locking around the entire function, the only locking done now is when the message has been built and is being deliviered to the list of registered verbose message handlers. - This function was doing a strdup() on every message passed to it and keeping a queue of the last 200 messages in memory. This has been completely removed. The only place this was used was that if there were any messages in the verbose queue when a verbose handler was registered, all of the messages in the queue would be fed to it. So, I just made sure that the console verbose handler and the network verbose handler (for remote asterisk consoles) were registered before any verbose messages. pbx_gtkconsole and pbx_kdeconsole will now lose a few verbose messages at startup, but I didn't feel the performance hit of this message queue was worth saving the initial verbose output for these very rarely used modules. - I have removed the last three arguments to the verbose handlers, leaving only the string itself because they aren't needed anymore. For example, ast_verbose had some logic for telling the verbose handler to add a newline if the buffer was completely full. Now that the buffer can grow as needed, this doesn't matter anymore. - remove unused function, ast_verbose_dmesg() which was to dispatch the message queue - Convert the list of verbose handlers to use the linked list macros. - add missing newline characters to a few ast_verbose() calls - convert the list of log channels to use the linked list macros in logger.c - fix close_logger() to close all of the files it opened for logging - update ast_log() to use a thread local dynamic string for its workspace for preparing log messages instead of a buffer of size BUFSIZ (8kB on my system) allocated on the stack. The dynamic string in this case is limited to only growing to a maximum size of BUFSIZ. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-07Fix accidental removal of if() in commit 38905Olle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-07Issue #7651 - always send subscription-state (AuPix)Olle Johansson
Small change to the fix in the report. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-05Merged revisions 38950 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r38950 | russell | 2006-08-05 03:21:12 -0400 (Sat, 05 Aug 2006) | 3 lines don't advertise that this function can set a SIP header when it can only do reads ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38951 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-05Merged revisions 38903-38904 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r38903 | russell | 2006-08-05 01:07:39 -0400 (Sat, 05 Aug 2006) | 2 lines suppress a compiler warning about the usage of a potentially uninitialized variable ........ r38904 | russell | 2006-08-05 01:08:50 -0400 (Sat, 05 Aug 2006) | 10 lines Fix an issue that would cause a NewCallerID manager event to be generated 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: https://origsvn.digium.com/svn/asterisk/trunk@38905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-04Don't assume that a referred by URI will always exist (issue #7641 reported ↵Joshua Colp
and fixed by AuPix) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38853 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-02Merged revisions 38731 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r38731 | kpfleming | 2006-08-02 14:29:56 -0500 (Wed, 02 Aug 2006) | 3 lines fix brain-damage I introduced when trying to fix the CANCEL/BYE sending mechanism for pending INVITES accept unknown 1xx responses as 183 responses (as RFC3261 mandates we should do) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-31Merged revisions 38611 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r38611 | kpfleming | 2006-07-31 16:14:11 -0500 (Mon, 31 Jul 2006) | 4 lines don't reissue hangup requests for SIP channels that have expired their RTP timeouts (one time is enough) don't rescan the SIP private structure list too fast, it can cause channels to not be able to hang up (issue #7495, and probably others) use ast_softhangup_nolock() since we already hold the channel's lock ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38612 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-28add macros for the pure and const attributes to compiler.h, in case they everRussell Bryant
need to be handled differently for a specific compiler git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38454 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-28Add the function attribute "pure" or "const" to various functions that performRussell Bryant
int to string or string to int operations. "pure" essentially says that this function has no side effects aside from its result, and the result depends on nothing else other than its arguments and global variables. "const" is a more strict form of "pure", where the function also doesn't access any global variables. From the gcc manual: "Such a function can be subject to common subexpression elimination and loop optimization just as an arithmetic operator would be." This also tells the compiler that it is safe to call the function fewer times than the code says to, given the same arguments, since the result will always be the same. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-28Merged revisions 38420 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r38420 | file | 2006-07-28 14:49:00 -0400 (Fri, 28 Jul 2006) | 2 lines Make a copy of the request URI in check_user_full instead of modifying the one on the structure, and also strip params properly from the user portion of the SIP URI so as to preserve the domain (issue #7552 reported by dan42) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38421 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-27Merged revisions 38288 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r38288 | russell | 2006-07-26 21:58:41 -0400 (Wed, 26 Jul 2006) | 3 lines fix a crash when MALLOC_DEBUG is enabled and the regexten is enabled. The crash would occur when the extension got removed. (fixes issue #7484) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38291 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-26Merged revisions 38234 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r38234 | file | 2006-07-26 11:26:06 -0400 (Wed, 26 Jul 2006) | 2 lines Put default callerid into contact when the one specified is either NULL or has a zero string length. (issue #7590 reported by key2) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38235 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-24Start out with cleared RTP payload structures instead of defaults. This ↵Joshua Colp
should prevent issues where if a stream (audio/stream) is not present and it's RTP payload structure is combined with the overall capability then the capability would be every codec that Asterisk supports. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-24move middle-of-the-block declaration at the top.Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38149 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-24Only deal with getting the supported payloads on audio if an audio RTP ↵Joshua Colp
stream exists git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38139 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-22use ast_atomic_fetchadd_int in chan_zap, sip, and iax2 for usecount handlingRussell Bryant
and fix a couple little things in passing - usecnt was not initialized in chan_iax2 - ast_update_use_count() was not called after incrementing the count in chan_sip git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38077 65c4cc65-6c06-0410-ace0-fbb531ad65f3