diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-18 15:24:40 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-18 15:24:40 +0000 |
commit | eaf975ae7143ffb070f83dcd8565f02065e7bca3 (patch) | |
tree | dd994ee4777c4773d83ed90f2a30a3bde6f61848 /channels | |
parent | a0e0cec3f8f143e2e1e159aede719b24ebd43ab3 (diff) |
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: http://svn.digium.com/svn/asterisk/branches/1.6.1@201601 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 2bdd63ffa..e24f39186 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -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)) |