mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-06 01:45:11 +00:00
Merged revisions 201570 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r201570 | dvossel | 2009-06-18 10:16:05 -0500 (Thu, 18 Jun 2009) | 11 lines parsing extension correctly from sip register lines If a transport type was specified, but no extension, parsing of the extension would return whatever was after the transport rather than defaulting to 's'. (closes issue #15111) Reported by: ffs Patches: chan_sip.c_register-parser.patch uploaded by ffs (license 730) Tested by: ffs, dvossel ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@201601 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -6623,19 +6623,20 @@ static int sip_register(const char *value, int lineno)
|
||||
enum sip_transport transport = SIP_TRANSPORT_UDP;
|
||||
char buf[256] = "";
|
||||
char *username = NULL;
|
||||
char *hostname=NULL, *secret=NULL, *authuser=NULL, *expire=NULL;
|
||||
char *hostname=NULL, *secret=NULL, *authuser=NULL, *expire=NULL, *buf2=NULL;
|
||||
char *callback=NULL;
|
||||
|
||||
if (!value)
|
||||
return -1;
|
||||
|
||||
ast_copy_string(buf, value, sizeof(buf));
|
||||
buf2 = strrchr(buf, '@');
|
||||
|
||||
/* split [/contact][~expiry] */
|
||||
expire = strchr(buf, '~');
|
||||
/* split [/extension][~expiry] */
|
||||
expire = strchr(buf2, '~');
|
||||
if (expire)
|
||||
*expire++ = '\0';
|
||||
callback = strrchr(buf, '/');
|
||||
callback = strrchr(buf2, '/');
|
||||
if (callback)
|
||||
*callback++ = '\0';
|
||||
if (ast_strlen_zero(callback))
|
||||
|
||||
Reference in New Issue
Block a user