]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
pop ::<profile_name> off the domain name in mwi events to hint at the profile
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 9 Jun 2011 00:32:18 +0000 (19:32 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 9 Jun 2011 00:32:18 +0000 (19:32 -0500)
src/mod/endpoints/mod_sofia/sofia_presence.c

index 1d65a1508199df221b1e9109902b97d14a283973..404c50c80d88d2807be8056453fe137174b1c402 100644 (file)
@@ -364,6 +364,7 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event)
        const char *call_id;
        const char *sub_call_id;
        int for_everyone = 0;
+       char *tmp_pname;
 
        switch_assert(event != NULL);
 
@@ -389,8 +390,15 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event)
        switch_assert(dup_account != NULL);
        switch_split_user_domain(dup_account, &user, &host);
 
+       if (host && (tmp_pname = strstr(host, "::"))) {
+               *tmp_pname = '\0';
+               tmp_pname += 2;
+               pname = tmp_pname;
+               profile = sofia_glue_find_profile(pname);
+       }
+
 
-       if ((pname = switch_event_get_header(event, "sofia-profile"))) {
+       if (!profile && (pname = switch_event_get_header(event, "sofia-profile"))) {
                profile = sofia_glue_find_profile(pname);
        }