]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3847 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Sat, 28 Jan 2012 19:09:12 +0000 (13:09 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Sat, 28 Jan 2012 19:09:12 +0000 (13:09 -0600)
src/mod/endpoints/mod_sofia/sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_presence.c

index bc323d4a4b36e52cf03a5763599a4f0ef4db6824..4ac823fe1f1cb3e647bb3ad9109b4f7746ae341a 100644 (file)
@@ -5139,15 +5139,22 @@ char *sofia_glue_get_url_from_contact(char *buf, uint8_t to_dup)
 {
        char *url = NULL, *e;
 
-       while((e = strchr(buf, '"'))) {
-               buf = e+1;
+       while(*buf == ' ') {
+               buf++;
+       }
+
+       if (*buf == '"') {
+               buf++;
+               while((e = strchr(buf, '"'))) {
+                       buf = e+1;
+               }
        }
 
        while(*buf == ' ') {
                buf++;
        }
 
-       if ((url = strchr(buf, '<')) && (e = strchr(url, '>'))) {
+       if ((url = strchr(buf, '<')) && (e = switch_find_end_paren(url, '<', '>'))) {
                url++;
                if (to_dup) {
                        url = strdup(url);
index d3eed1fc656fa58cff044ec596b24972f6125e9a..c8a16672397781f6f7f4b767cae6be3cc9750c2e 100644 (file)
@@ -1811,7 +1811,11 @@ static void _send_presence_notify(sofia_profile_t *profile,
        dst = sofia_glue_get_destination((char *) o_contact);
        switch_assert(dst);
 
-       contact = sofia_glue_get_url_from_contact(dst->contact, 1);
+       if (!zstr(dst->contact)) {
+               contact = sofia_glue_get_url_from_contact(dst->contact, 1);
+       } else {
+               contact = strdup(o_contact);
+       }
                
        if (dst->route_uri) {
                route_uri = sofia_glue_strip_uri(dst->route_uri);
@@ -1864,7 +1868,7 @@ static void _send_presence_notify(sofia_profile_t *profile,
                                                  );
        }
 
-
+       
        switch_mutex_lock(profile->ireg_mutex);
        if (!profile->cseq_base) {
                profile->cseq_base = (now - 1312693200) * 10;