[asterisk-commits] oej: branch 1.6.1 r172235 - in /branches/1.6.1: ./ channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jan 29 05:24:30 CST 2009
Author: oej
Date: Thu Jan 29 05:24:30 2009
New Revision: 172235
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=172235
Log:
Merged revisions 172234 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r172234 | oej | 2009-01-29 12:19:29 +0100 (Tor, 29 Jan 2009) | 7 lines
Make sure register= line supports both port and expiry at the same time.
(closes issue #14185)
Reported by: Nick_Lewis
Patches:
chan_sip.c-expiryrequest6.patch uploaded by Nick (license 657)
Tested by: Nick_Lewis
........
Modified:
branches/1.6.1/ (props changed)
branches/1.6.1/channels/chan_sip.c
Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.1/channels/chan_sip.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.6.1/channels/chan_sip.c?view=diff&rev=172235&r1=172234&r2=172235
==============================================================================
--- branches/1.6.1/channels/chan_sip.c (original)
+++ branches/1.6.1/channels/chan_sip.c Thu Jan 29 05:24:30 2009
@@ -6476,7 +6476,6 @@
enum sip_transport transport = SIP_TRANSPORT_UDP;
char buf[256] = "";
char *username = NULL;
- char *port = NULL;
char *hostname=NULL, *secret=NULL, *authuser=NULL, *expire=NULL;
char *callback=NULL;
@@ -6484,6 +6483,16 @@
return -1;
ast_copy_string(buf, value, sizeof(buf));
+
+ /* split [/contact][~expiry] */
+ expire = strchr(buf, '~');
+ if (expire)
+ *expire++ = '\0';
+ callback = strchr(buf, '/');
+ if (callback)
+ *callback++ = '\0';
+ if (ast_strlen_zero(callback))
+ callback = "s";
sip_parse_host(buf, lineno, &username, &portnum, &transport);
@@ -6504,25 +6513,6 @@
*authuser++ = '\0';
}
- /* split host[:port][/contact] */
- expire = strchr(hostname, '~');
- if (expire)
- *expire++ = '\0';
- callback = strchr(hostname, '/');
- if (callback)
- *callback++ = '\0';
- if (ast_strlen_zero(callback))
- callback = "s";
- /* Separate host from port when checking for reserved characters
- */
- if ((port = strchr(hostname, ':'))) {
- *port = '\0';
- }
- /* And then re-merge the host and port so they are stored correctly
- */
- if (port) {
- *port = ':';
- }
if (!(reg = ast_calloc(1, sizeof(*reg)))) {
ast_log(LOG_ERROR, "Out of memory. Can't allocate SIP registry entry\n");
return -1;
More information about the asterisk-commits
mailing list