summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
AgeCommit message (Collapse)Author
2007-08-13Merged revisions 79174 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r79174 | file | 2007-08-13 11:18:04 -0300 (Mon, 13 Aug 2007) | 4 lines (closes issue #10437) Reported by: haklin Don't set the callerid name and number a second time on a newly created channel. ast_channel_alloc itself already sets it and setting it twice would cause a memory leak. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09When looking up a mailbox, use the default context if not specified as ↵Russell Bryant
something else git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78824 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09Restore the ability to have multiple mailboxes listed for the mailbox optionRussell Bryant
in sip.conf. chan_sip now maintains separate internal MWI subscriptions for each one. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09Fix a problem that I had introduced into MWI handling. I had ignoredRussell Bryant
the mailbox context. Now, all related MWI event dealings pay attention to the context as well. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-08Add support for using epoll instead of poll. This should increase ↵Joshua Colp
scalability and is done in such a way that we should be able to add support for other poll() replacements. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06Fixing a compiler warning which warns that a variable may be used ↵Mark Michelson
unitialized. Thanks to mvanbaak for pointing this out. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78192 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06Merged revisions 78103 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r78103 | mmichelson | 2007-08-03 15:25:22 -0500 (Fri, 03 Aug 2007) | 7 lines Changed the behavior of sip's realtime_peer function to match the corresponding way of matching for non-realtime peers. Now matches are made on both the IP address and port number, or if the insecure setting is set to "port" then just match on the IP address. In order to accomplish this, I also added a new API call, ast_category_root, which returns the first variable of an ast_category struct ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06Merged revisions 78182 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r78182 | file | 2007-08-06 13:32:44 -0300 (Mon, 06 Aug 2007) | 2 lines It is possible for a transfer to occur before the remote device has our tag in which case they send none in the transfer. In this case we need to not fail the transfer dialog lookup. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-05Merged revisions 78139 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r78139 | tilghman | 2007-08-04 22:29:01 -0500 (Sat, 04 Aug 2007) | 2 lines If peer is not found, the error message is misleading (should be peer not found, not ACL failure) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78140 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31thanks to Russel, for pointing out that the dialoglist_lock/unlock routines ↵Steve Murphy
also need to be macros if DETECT_DEADLOCKS is set git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31Merged revisions 77824 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r77824 | mmichelson | 2007-07-31 10:21:22 -0500 (Tue, 31 Jul 2007) | 6 lines This patch makes Asterisk send 100 Trying provisional responses upon receipt of re-invites. This makes it so that if there are two or more Asterisk servers between endpoints, the Asterisk servers will not keep retransmitting the re-invites. (closes issue #10274, reported by cstadlmann, patched by me with approval from file) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31there is no use in having functions that have no code in them, and hide the ↵Kevin P. Fleming
locking info when DEBUG_THREADS is enabled... i could have fixed this to be dependent on DEBUG_THREADS, but it would be just as easy for someone to add their test/debugging code to the macros as it would have been to the functions git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77821 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31use a different method for overriding the send_digit_begin pointer, as the ↵Kevin P. Fleming
old one fails to compile on my 64-bit system with gcc-4.1 and --enable-dev-mode turned on git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31Discovered in experiments on core files: if you wrap the lock and unlock ↵Steve Murphy
calls with sip_pvt_lock and sip_pvt_unlock, you lose the tracing info you would normally get via DETECT_DEADLOCKS; so I turn these two functions into macros when DETECT_DEADLOCKS is called. This way, you get meaningful stuff in the file and func slots in the lock_info struct. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77810 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30minor code rearrangements:Luigi Rizzo
+ place the link field at the beginning of struct sip_pvt, and not somewhere in the middle; + in __sip_reliable_xmit, remove a duplicate assignment, and put the statements in a more logical order (i.e. first copy the payload and associated info, then copy arguments from the caller, then finish initializing the headers...) nothing to backport. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77766 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30rename handle_request() to handle_incoming(), as the formerLuigi Rizzo
was misleading - the function deals with all incoming packets, be them requests or responses. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77753 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-29move some dialog-only flags to proper variables, namelyLuigi Rizzo
SIP_NOVIDEO, SIP_DIALOG_ANSWEREDELSEWHERE, SIP_PAGE2_NOTEXT, SIP_PAGE2_OUTGOING_CALL These are seldom used so the diff is relatively small. Note that 'OUTGOING_CALL' is dangerously similar to another dialog flag, 'SIP_OUTGOING', so the description will need to clarify the different meaning of the two. Also note that the description of NOTEXT is a bit unclear - does it mean we don't support it, or 'not requested or not supported' ? On passing fix a comment referring to video instead of text. Finally, mark with XXX a possibly misleading debugging message. (maybe the latter is worth backporting). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77739 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-29use a function, cli_yesno(), to produce the output Yes or No forLuigi Rizzo
CLI lines. This helps maintaining consistency on output, slightly improves readability, and maybe one day will make it easier to translate the output in other languages (though i have a hard time believing that a CLI user who needs 'yes' and 'no' to be translated can actually figure out what he/she is doing!) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77726 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-29move the two remaining peer flags to proper variables.Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77725 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-29move RT_FROMCONTACT to a proper sip_peer field.Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-29Move some global 'flags' to individual variables.Luigi Rizzo
Start putting these variables in a single struct (called 'sip_cfg' for the time being, but it could as well be 'global' or some other name) so it is easy, when reading the code, to figure out what they are for. The downside of using struct fields instead of individual global variables is that the compiler cannot tell if there are unused fields. But the advantage of not cluttering the namespace and manilpulating all these variables at once certainly overcome the disadvantagess. Nothing to backport, again. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-29minor simplification of a conditional statementLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77697 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-29build the version of sip_tech with no send_digit_beginLuigi Rizzo
at load time instead of duplicating the initializer. This should remove the risk of forgetting fields in the initializer. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-29remove bit position from description of SIP_* flags. Luigi Rizzo
use AST_FORMAT_AUDIO_MASK instead of playing with AST_FORMAT_MAX_AUDIO to determine audio formats. There is a dubious use of AST_FORMAT_MAX_AUDIO in sip_request_call() which surely needs fixing, namely: /* mask request with some set of allowed formats. * XXX this needs to be fixed. * The original code uses AST_FORMAT_AUDIO_MASK, but it is * unclear what to use here. We have global_capabilities, which is * configured from sip.conf, and sip_tech.capabilities, which is * hardwired to all audio formats. */ The latter is possibly something to backport when fixed. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-29back on cleaning up the usage of flags.Luigi Rizzo
Move together flags used in the same way (e.g. dialog only, dialog-peer, ...) so it will become easier to deal with them in a more systematic way. This is being done in stages so it will be easier to detect breakage, if any should occur. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77669 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-29more documentation on internal representation of incoming SIP messages.Luigi Rizzo
Remove definitions for now-unused flags, and add references to print routines for other flags. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77668 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-29make register_unref() return NULL so it is easy to cleanupLuigi Rizzo
the original pointer while calling the function. on passing add some comments on one of the places where it is used, and explain why it is safe there. again, a no-op for practical purposes. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77654 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-28add some documentation to auto_congest(), and someLuigi Rizzo
dialog_ref/unref (they are a no-op at the moment). Also clean a pointer after freeing memory to avoid dangling references, and write a for() loop in canonical form. In practice, everything in this commit is a no-op. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77653 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-28more dialog_ref()/dialog_unref() callsLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77650 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-28more dialog_ref()/dialog_unref() callsLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77648 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-28start introducing hooks for reference counts on dialog descriptors.Luigi Rizzo
This commit is, for all practical purposes, a no-op, as it only introduces the dialog_ref() and dialog_unref() methods, and uses them in a few places (not all the places where they would be needed). The goal is to start annotating the code with these calls, so the transition to a proper container will be easier. Nothing to backport. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77647 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-28remove an unused stringLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-28simplify a conditional expression using S_ORLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77630 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-28make use of received= and rport= fields in sip replies.Luigi Rizzo
In a nutshell, these fields are used to tell a sip entity the address and port its request came from, and are extremely useful in the presence of NATs, especially with symmetric NATs where STUN is totally ineffective. This patch stores the address and port in the 'ourip' field of the dialog descriptor, so they can be reused in subsequent transactions. As it is, it works well for things like REGISTER requiring authentication, because the second REGISTER request (with auth credentials) will carry the correct address. Maybe it can also be useful, in case of an address change, to do one or both of the following: + propagate the new address to the parent user/peer descriptor so that new dialogs will use the correct address from the beginning. This is trivial to implement, I am just waiting for feedback on this. + re-issue a request in case of an address change. This a lot less trivial, maybe unnecessary, and probably covered by the previous item. I would seriously consider this patch for addition to 1.4 and 1.2. The code is very little intrusive, and it would solve in a correct way the nat traversal problems for which externip/externaddr/stunaddr are only a partial and expensive workaround. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-27Turn 4 lines of code into 1 line that does the same thing.Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-27Merged revisions 77536 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r77536 | file | 2007-07-27 13:27:16 -0300 (Fri, 27 Jul 2007) | 6 lines (closes issue #10323) Reported by: julianjm Patches: chan_sip_device_state_hold_fix.v1.diff.txt uploaded by julianjm (license 99) Clear ONHOLD flag when decrementing the onHold peer count. If we did not do this the count may keep decreasing. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77537 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-27Merged revisions 77490 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r77490 | mmichelson | 2007-07-27 09:30:43 -0500 (Fri, 27 Jul 2007) | 3 lines "re-invite" was misspelled ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77491 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26Do a massive conversion for using the ast_verb() macroRussell Bryant
(closes issue #10277, patches by mvanbaak) Basically, this changes ... if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3, "Something\n"); to ... ast_verb(3, "Something\n"); git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26Revert some changes to call abs() on the result of ast_random().Russell Bryant
* random() is defined to return a positive result, and now ast_random() will always do so as well git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26Things expecting a positive result from ast_random() should not be surprised ↵Tilghman Lesher
(closes #10308) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77267 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-24two small fixes when using stun (reported by Marta Carbone):Luigi Rizzo
+ externexpire was not initialized properly; + stunaddr was not handled properly on a sip reload git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23add two missing entries in the replica of the sip_tech thatLuigi Rizzo
does not use DTMF BEGIN frames. 1.4 seems correct (it does not have the two fields). However, as this bug shows, the current way of creating the sip_tech replica is too error-prone, one can easily forget to update one of the two entries. Perhaps it would be better to create sip_tech_info expliclty at module load, by doing sip_tech_info = sip_tech; sip_tech_info.send_digit_begin = NULL (in this case, this is something applicable to 1.4 as well). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76564 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23Merged revisions 76561 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r76561 | file | 2007-07-23 11:34:21 -0300 (Mon, 23 Jul 2007) | 14 lines Merged revisions 76560 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r76560 | file | 2007-07-23 11:32:07 -0300 (Mon, 23 Jul 2007) | 6 lines (closes issue #10236) Reported by: homesick Patches: rpid_1.4_75840.patch uploaded by homesick (license 91) Accept Remote Party ID on guest calls. ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76563 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23Mark str2dtmfmode() as currently unused to resolve a compiler warning andRussell Bryant
allow building under dev mode git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76562 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23(closes issue #10271)Russell Bryant
Reported by: snuffy Patches: doxygen-updates.diff uploaded by snuffy (license 35) Another big batch of doxygen documentation updates git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23introduce two functions, map_x_s() and map_s_x(), to mapLuigi Rizzo
between integers and strings using a single translation table, and use them in a few places instead of ad-hoc routines that duplicate the table. On passing, note that REFER_CONFIRMED is never used, and add a few comments. Nothing to backport here. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76547 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23Remove an unused function to resolve a compiler warningRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76524 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23move "sip prunte realtime ..." and "sip set debug ... " to NEW_CLI style.Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23Add some documentation on the sipregistry states and theLuigi Rizzo
handling of the sip_register structures. This commit only changes comments and whitespace. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76467 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23add a bit of comments on internal functions.Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76458 65c4cc65-6c06-0410-ace0-fbb531ad65f3