Commit graph

1540 commits

Author SHA1 Message Date
Olle Johansson
b136baaff4 Fix rport handling.
...where did the 1.2 properties come from, really? they're back.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 10:29:24 +00:00
Olle Johansson
97be2ac76f - If peer that register fails ACL, fail him
- Remove the 1.2 props I've set by mistake earlier 


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46609 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 09:24:55 +00:00
Olle Johansson
ab414260c4 Update sip list to eventlist format.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-30 21:22:41 +00:00
Olle Johansson
f98f457727 Change name of "contact" setting to "callback" which better reflects what it
is to the person that configures asterisk. That we use it internally in the
contact header is a totally different story.

Still not convinced this is a good option.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-30 19:56:14 +00:00
Olle Johansson
753a03161d Globals need the "global_" prefix in chan_sip, and need to be reset to default value at reload.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46476 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-30 18:34:51 +00:00
Olle Johansson
aadccc10b8 Small conversion to ast_channel_unlock
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46461 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-30 18:02:37 +00:00
Olle Johansson
8a2e564df5 Issue 8246 Doxygen updates (kshumard)
THANK YOU!



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46434 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-30 16:33:02 +00:00
Olle Johansson
53ef33ccc3 Issue #7869 - Stop retransmission of 302 redirects.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-29 19:35:04 +00:00
Olle Johansson
ef7d20f9c9 Issue #7608 - Notifications sent with wrong content-type (imported from 1.2, 1.4)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-29 19:16:36 +00:00
Olle Johansson
1086f1dfb5 Issues related to issue #7828 - segfault with MWI subscriptions and realtime.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-29 17:07:47 +00:00
Olle Johansson
430ca5b59c - Fix the OUTGOING stuff (merge from 1.4)
- Make sure we UNREF authpeer when not needed


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46399 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-29 16:58:07 +00:00
Olle Johansson
ee31dc4d52 Documentation update again
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46395 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-29 08:27:31 +00:00
Olle Johansson
34f5c15427 Documentation update (I guess)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46394 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-29 08:26:05 +00:00
Olle Johansson
4ec9329d8b Documentation correction
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46393 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-29 08:22:22 +00:00
Olle Johansson
a4366cc194 maxtime is not needed any more now that we actually set the T1 timer
based on the qualify result.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-29 08:15:26 +00:00
Olle Johansson
baf9547d50 Only accept message once
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46390 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-28 20:27:21 +00:00
Olle Johansson
ca433620a7 Adding documentation inspired by a virtual drink with an anonymous man in New Jersey
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46387 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-28 20:05:19 +00:00
Olle Johansson
336a4602ba Don't duplicate function if not needed...
- removing transmit_reinvite_with_t38_sdp in favour of adding an argument to 
  transmit_reinvite_with_sdp


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-28 19:30:31 +00:00
Olle Johansson
29e489e000 Merge from 1.4 : Don't send 183 reliably...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-28 19:16:23 +00:00
Olle Johansson
0f9a1b19f1 - Don't lock the dialoglist during the whole destruction of a single SIP dialog. Only
lock when needed - when we remove the dialog from the dialog list
  If this doesn't lead to severe problems, it might help with some locking issues
  in 1.4/1.2.
- Remove the term "interface" as a synonym for a SIP dialog. Sorry, Mark, but no
  one understands it... ;-)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46379 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-28 17:25:23 +00:00
Olle Johansson
12a966cb0e Put this patch on hold pending further testing...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-27 17:45:43 +00:00
Olle Johansson
7ca6b79569 Show if the channel is ready for video or T.38 udptl
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-26 20:22:14 +00:00
Olle Johansson
1b3411f2ff Old todo: Don't add Contact headers on BYE and CANCEL.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46277 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 20:21:05 +00:00
Olle Johansson
d448620715 First stab at transaction direction fix, this for trunk for testing
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 20:12:06 +00:00
Olle Johansson
cef98c1e87 Ugly code to try to remove issue discovered by Luigi as well as attack bug #7608
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 19:30:04 +00:00
Olle Johansson
26a00dfaf0 Merge from 1.4
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46224 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 16:01:22 +00:00
Kevin P. Fleming
5f5faa310a Merged revisions 46082-46083,46152-46153 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r46082 | kpfleming | 2006-10-23 22:45:42 -0500 (Mon, 23 Oct 2006) | 2 lines

add an API call to allow channel drivers to determine which media formats are compatible (passthrough or transcode) with the format an existing channel is already using

........
r46083 | kpfleming | 2006-10-23 22:53:32 -0500 (Mon, 23 Oct 2006) | 2 lines

ensure that the translation matrix is properly lock-protected every place it is used

........
r46152 | kpfleming | 2006-10-24 18:45:19 -0500 (Tue, 24 Oct 2006) | 2 lines

if multiple translators are registered for the same source/dest combination, ensure that the lowest-cost one is always inserted earlier in the list

........
r46153 | kpfleming | 2006-10-24 19:10:54 -0500 (Tue, 24 Oct 2006) | 2 lines

code zone experiment: don't offer formats in the outbound INVITE that aren't either passthrough or translatable

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 14:55:11 +00:00
Kevin P. Fleming
749029de38 Merged revisions 46200 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r46200 | kpfleming | 2006-10-25 09:32:08 -0500 (Wed, 25 Oct 2006) | 2 lines

apparently developers are still not aware that they should be use ast_copy_string instead of strncpy... fix up many more users, and fix some bugs in the process

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 14:44:50 +00:00
Olle Johansson
0fed2f78b9 Adding comments in the source is more persistent than just adding them
to the commit message :-)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 11:41:49 +00:00
Olle Johansson
2560ff9c33 Always add doxygen comments to new functions, more lines than one are
appreciated really. (Read the coding guidelines).

I've worked hard to make chan_sip a better place to code in, let's
keep it that way and don't add more stuff without comments.

Thank you.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 11:39:40 +00:00
Luigi Rizzo
0d59b76dd2 correct fix for the bug i previously introduced - the strings
are meant to be always initialized, independently from their content.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-24 06:52:15 +00:00
Russell Bryant
6e65bea242 Fix a seg fault on a registration. Line 7706, in parse_register_contact,
explicitly passes NULL as the "pass" argument to this function.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46055 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-24 00:52:06 +00:00
Luigi Rizzo
a989f7cd47 Unlike ast_strdup(), ast_strdupa() does not take a NULL pointer as argument,
so fix the places where this might happen.

This is also a fix that ought to go into 1.4

[The difference between the two functions is a bit confusing,
and in asterisk i believe all string handling functions
should be able to handl a NULL string as argument,
but changing the API in trunk and not in 1.4 would make
backporting harder.]



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46045 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-23 21:46:15 +00:00
Luigi Rizzo
6345c91eb3 remove a useless check for ocseq = 0.
As discussed on the mailing lists, 0 is a legal value
for Cseq, so there is no point to treat it specially.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46035 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-23 20:01:14 +00:00
Luigi Rizzo
a31aa6f320 get_header() always returns a non-NULL value, so checking
for NULL is certainly wrong and usually disables the
checks that we want to make instead.

This commit fixes a number of the above bugs where the result
of get_header() is immediately checked for NULL.

This is certainly a candidate for merging into 1.4




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46026 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-23 19:52:43 +00:00
Luigi Rizzo
f1c2342c96 put another duplicated block of code in a function.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46025 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-23 19:28:23 +00:00
Luigi Rizzo
eb44903b08 reformat a statement and comment a potentially wrong
assignement (altering state on an unvalidated message).



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-23 18:38:42 +00:00
Luigi Rizzo
85fe7cac03 Remove unnecessary casts from const char * to char *,
if necessary by slightly rearranging the code.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46004 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-23 17:49:09 +00:00
Luigi Rizzo
8a7ba881e2 another use for parse_uri().
On passing, remove a wrong comment (that probably I wrote
myself!) and introduce a temporary variable to avoid a     
misleading cast.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-23 17:41:03 +00:00
Luigi Rizzo
0cb5e93383 + make sure parse_uri never returns NULL pointers - this
simplifies its usage.

+ add another client for parse_uri, in handling Contact: strings
  (on passing, document the content of the "fullcontact" field);

+ in register_verify(), mark with XXX what i believe is another
  misinterpretation on the URI format when '@' is missing.
  No code changed here, so no fixes applied.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45977 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-23 15:45:36 +00:00
Luigi Rizzo
7dd92fd181 After reading better the SIP RFC on sip URI (19.1.1)
fix parse_uri() to interpret a missing userinfo
section as a domain-only URI, and comment a wrong
interpretation of the above in check_user_full().

The function has been patched to preserve the existing
behaviour (in what admittedly is a corner case, but
could be received under attacks).
Hopefully the From: based matching will go away soon!



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-23 15:08:40 +00:00
Luigi Rizzo
ee60094592 in function get_also_info(), move argument stripping
before splitting around the @, otherwise the refer_to_domain
might contain arguments as well, causing failures.
 
I think this is a true bug that ought to be fixed in 1.4 as well.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45966 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-23 14:35:37 +00:00
Luigi Rizzo
00b88f30b4 start putting the URI parsing code in one place,
introducing the function parse_uri() that splits
a URI in its components.

Right now use it only in one place, because the custom
parsing that is done here and there sometimes has
bugs that i want to figure out first.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45965 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-23 14:30:33 +00:00
Luigi Rizzo
32f82c2ca1 put common code in function terminate_uri() so we need to
fix it only in one place.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-23 13:19:13 +00:00
Luigi Rizzo
c761bea8e2 More cleanup of check_user_full with no functional change
apart from a small (but disabled by default) new option.
In detail:

+ introduce a new value for enum check_auth_result, AUTH_DONT_KNOW,
  used (read below) when a function does not have a conclusive response.
  Possibly this is the same as AUTH_NOT_FOUND, but need to check further.

+ move the large blocks (checking in the users list and in the peers
  list, respectively) from check_user_full() to separate functions.
  They return AUTH_DONT_KNOW in case they don't find a match, so
  the caller know that it has to try the next method.
     There is still some duplication of code here, but i
  have not tried yet to remove it.

+ [new option] a new option in sip.conf, match_auth_username,
  has been introduced, and disabled by default.
  If set, and the incoming request carries authentication info,
  the username to match in the users list is taken from there
  rather than from the From: field.
        This change is easy to identify, being made of
  - one line to declare the variable match_auth_username
  - a block of 15 lines in check_user_full()
  - one line in sip list settings
  - two lines for parsing the config file.

check_user_full() is now a lot cleaner - basically a sequence of
checks that are applied to the request. This will help future
work with new matching schemes.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-23 11:08:47 +00:00
Luigi Rizzo
dc83868813 more streamlining of check_user_full
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-22 21:08:07 +00:00
Luigi Rizzo
e7c0a0524a simplify the flow of function check_user_full()
A large block needs reindentation now, but we don't do that because
it can be moved to a separate function.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-22 20:59:38 +00:00
Luigi Rizzo
36d7b8f488 put duplicated code in functions.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-22 20:51:05 +00:00
Luigi Rizzo
70ee76d64b introduce sip_pvt_lock() and sip_pvt_unlock() wrappers to
lock these data structures.

This improve readability, and also hides the underlying
locking mechanism so it is a lot easier to add diagnostic
code, or move the object locks somewhere else, etc.

On passing, rename the lock field in sip_pvt to pvt_lock,
also for ease of readability.




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45786 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-20 20:59:06 +00:00
Russell Bryant
02ec7acf6a put the constants for whether methods can create a dialog or not in an enum
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-20 15:54:14 +00:00