mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-08 08:51:50 +00:00
use the call_id of the original register in the unsolicited notify for MWI
This commit is contained in:
parent
54feb3e245
commit
53b0ecce60
@ -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);
|
sofia_destination_t *sofia_glue_get_destination(char *data);
|
||||||
void sofia_glue_free_destination(sofia_destination_t *dst);
|
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,
|
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);
|
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_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);
|
void sofia_info_send_sipfrag(switch_core_session_t *aleg, switch_core_session_t *bleg);
|
||||||
|
@ -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,
|
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;
|
char *id = NULL;
|
||||||
nua_handle_t *nh;
|
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(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(user_via, SIPTAG_VIA_STR(user_via)),
|
||||||
TAG_IF(event, SIPTAG_EVENT_STR(event)),
|
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());
|
TAG_IF(contenttype, SIPTAG_CONTENT_TYPE_STR(contenttype)), TAG_IF(body, SIPTAG_PAYLOAD_STR(body)), TAG_END());
|
||||||
|
|
||||||
switch_safe_free(contact);
|
switch_safe_free(contact);
|
||||||
|
@ -484,10 +484,10 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (for_everyone) {
|
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);
|
"from sip_registrations where mwi_user='%q' and mwi_host='%q'", stream.data, user, host);
|
||||||
} else if (call_id) {
|
} 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);
|
"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 *body = argv[5];
|
||||||
const char *o_contact = argv[2];
|
const char *o_contact = argv[2];
|
||||||
const char *network_ip = argv[4];
|
const char *network_ip = argv[4];
|
||||||
|
const char *call_id = argv[6];
|
||||||
|
|
||||||
char *profile_name = argv[3];
|
char *profile_name = argv[3];
|
||||||
struct mwi_helper *h = (struct mwi_helper *) pArg;
|
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) {
|
if (ext_profile) {
|
||||||
sofia_glue_release_profile(ext_profile);
|
sofia_glue_release_profile(ext_profile);
|
||||||
|
@ -519,7 +519,7 @@ void sofia_reg_send_reboot(sofia_profile_t *profile, const char *user, const cha
|
|||||||
event = "reboot";
|
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)
|
int sofia_sla_dialog_del_callback(void *pArg, int argc, char **argv, char **columnNames)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user