]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
use the call_id of the original register in the unsolicited notify for MWI
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 5 Aug 2011 16:09:45 +0000 (11:09 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 5 Aug 2011 16:09:45 +0000 (11:09 -0500)
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_presence.c
src/mod/endpoints/mod_sofia/sofia_reg.c

index 07c917cbcafef044e9c229eb9b3613180a04b9e0..a7bd1e6843ecfcd6118634ffacc17ef262e3feb1 100644 (file)
@@ -1096,7 +1096,7 @@ void sofia_glue_get_addr(msg_t *msg, char *buf, size_t buflen, int *port);
 sofia_destination_t *sofia_glue_get_destination(char *data);
 void sofia_glue_free_destination(sofia_destination_t *dst);
 switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *user, const char *host, const char *event, const char *contenttype,
-                                                                          const char *body, const char *o_contact, const char *network_ip);
+                                                                          const char *body, const char *o_contact, const char *network_ip, const char *call_id);
 char *sofia_glue_get_extra_headers(switch_channel_t *channel, const char *prefix);
 void sofia_glue_set_extra_headers(switch_channel_t *channel, sip_t const *sip, const char *prefix);
 void sofia_info_send_sipfrag(switch_core_session_t *aleg, switch_core_session_t *bleg);
index 54c946ad58cdb01aaab52aeb414fa812e6e77be1..006f0023349d81b114bec6f9fce5f913ba478528 100644 (file)
@@ -6319,7 +6319,7 @@ void sofia_glue_free_destination(sofia_destination_t *dst)
 }
 
 switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *user, const char *host, const char *event, const char *contenttype,
-                                                                          const char *body, const char *o_contact, const char *network_ip)
+                                                                          const char *body, const char *o_contact, const char *network_ip, const char *call_id)
 {
        char *id = NULL;
        nua_handle_t *nh;
@@ -6376,6 +6376,7 @@ switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *use
                           TAG_IF(dst->route_uri, NUTAG_PROXY(route_uri)), TAG_IF(dst->route, SIPTAG_ROUTE_STR(dst->route)),
                           TAG_IF(user_via, SIPTAG_VIA_STR(user_via)),
                           TAG_IF(event, SIPTAG_EVENT_STR(event)),
+                          TAG_IF(call_id, SIPTAG_CALL_ID_STR(call_id)),
                           TAG_IF(contenttype, SIPTAG_CONTENT_TYPE_STR(contenttype)), TAG_IF(body, SIPTAG_PAYLOAD_STR(body)), TAG_END());
 
        switch_safe_free(contact);
index a85138b8f63f6fa2aecbf47066341aaa5e82c048..f7b7a0aa84f6969e46d9390cac1bd14e4575b5fc 100644 (file)
@@ -484,10 +484,10 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event)
        }
 
        if (for_everyone) {
-               sql = switch_mprintf("select sip_user,sip_host,contact,profile_name,network_ip,'%q' "
+               sql = switch_mprintf("select sip_user,sip_host,contact,profile_name,network_ip,'%q',call_id "
                                                         "from sip_registrations where mwi_user='%q' and mwi_host='%q'", stream.data, user, host);
        } else if (call_id) {
-               sql = switch_mprintf("select sip_user,sip_host,contact,profile_name,network_ip,'%q' "
+               sql = switch_mprintf("select sip_user,sip_host,contact,profile_name,network_ip,'%q',call_id "
                                                         "from sip_registrations where mwi_user='%q' and mwi_host='%q' and call_id='%q'", stream.data, user, host, call_id);
        }
 
@@ -1860,6 +1860,7 @@ static int sofia_presence_mwi_callback2(void *pArg, int argc, char **argv, char
        const char *body = argv[5];
        const char *o_contact = argv[2];
        const char *network_ip = argv[4];
+       const char *call_id = argv[6];
 
        char *profile_name = argv[3];
        struct mwi_helper *h = (struct mwi_helper *) pArg;
@@ -1871,7 +1872,7 @@ static int sofia_presence_mwi_callback2(void *pArg, int argc, char **argv, char
                }
        }
 
-       sofia_glue_send_notify(profile, user, host, event, contenttype, body, o_contact, network_ip);
+       sofia_glue_send_notify(profile, user, host, event, contenttype, body, o_contact, network_ip, call_id);
 
        if (ext_profile) {
                sofia_glue_release_profile(ext_profile);
index 4b5422fab66fd9c0d3bfdf70faac90933e1b1df0..1d014aff80b88e19e76ed953f856fbda89847fbb 100644 (file)
@@ -519,7 +519,7 @@ void sofia_reg_send_reboot(sofia_profile_t *profile, const char *user, const cha
                event = "reboot";
        }
 
-       sofia_glue_send_notify(profile, user, host, event, contenttype, body, contact, network_ip);
+       sofia_glue_send_notify(profile, user, host, event, contenttype, body, contact, network_ip, NULL);
 }
 
 int sofia_sla_dialog_del_callback(void *pArg, int argc, char **argv, char **columnNames)