提交 c15663cb authored 作者: Brian West's avatar Brian West

FS-6670 #resolve #comment This should resolve this fun stuff.

上级 5ea17295
...@@ -1617,6 +1617,8 @@ static void our_sofia_event_callback(nua_event_t event, ...@@ -1617,6 +1617,8 @@ static void our_sofia_event_callback(nua_event_t event,
const char *call_id, *full_from, *full_to, *full_via, *from_user = NULL, *from_host = NULL, *to_user, *to_host, *full_agent; const char *call_id, *full_from, *full_to, *full_via, *from_user = NULL, *from_host = NULL, *to_user, *to_host, *full_agent;
char to_tag[13] = ""; char to_tag[13] = "";
char *event_str = "refer"; char *event_str = "refer";
sip_accept_t *ap = sip->sip_accept;
char accept_header[256] = "";
np.fs_path = 1; np.fs_path = 1;
contact_str = sofia_glue_gen_contact_str(profile, sip, nh, de, &np); contact_str = sofia_glue_gen_contact_str(profile, sip, nh, de, &np);
...@@ -1646,6 +1648,12 @@ static void our_sofia_event_callback(nua_event_t event, ...@@ -1646,6 +1648,12 @@ static void our_sofia_event_callback(nua_event_t event,
to_host = "n/a"; to_host = "n/a";
} }
while (ap) {
switch_snprintf(accept_header + strlen(accept_header), sizeof(accept_header) - strlen(accept_header),
"%s%s ", ap->ac_type, ap->ac_next ? "," : "");
ap = ap->ac_next;
}
sql = switch_mprintf("insert into sip_subscriptions " sql = switch_mprintf("insert into sip_subscriptions "
"(proto,sip_user,sip_host,sub_to_user,sub_to_host,presence_hosts,event,contact,call_id,full_from," "(proto,sip_user,sip_host,sub_to_user,sub_to_host,presence_hosts,event,contact,call_id,full_from,"
"full_via,expires,user_agent,accept,profile_name,hostname,network_port,network_ip,version,orig_proto, full_to) " "full_via,expires,user_agent,accept,profile_name,hostname,network_port,network_ip,version,orig_proto, full_to) "
......
...@@ -3904,12 +3904,13 @@ void sofia_presence_handle_sip_i_subscribe(int status, ...@@ -3904,12 +3904,13 @@ void sofia_presence_handle_sip_i_subscribe(int status,
} else { } else {
sip_accept_t *ap = sip->sip_accept; sip_accept_t *ap = sip->sip_accept;
char accept[256] = ""; char accept_header[256] = "";
sub_state = nua_substate_active; sub_state = nua_substate_active;
while (ap) { while (ap) {
switch_snprintf(accept + strlen(accept), sizeof(accept) - strlen(accept), "%s%s ", ap->ac_type, ap->ac_next ? "," : ""); switch_snprintf(accept_header + strlen(accept_header), sizeof(accept_header) - strlen(accept_header),
"%s%s ", ap->ac_type, ap->ac_next ? "," : "");
ap = ap->ac_next; ap = ap->ac_next;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论