]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6670 #resolve #comment This should resolve this fun stuff.
authorBrian West <brian@freeswitch.org>
Mon, 21 Jul 2014 20:58:32 +0000 (15:58 -0500)
committerBrian West <brian@freeswitch.org>
Mon, 21 Jul 2014 20:58:32 +0000 (15:58 -0500)
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_presence.c

index acb10c4f9d6e540dc98641fad98e247e6f25426f..158ca28e59e4817f8e82628a09c3df1ce57f8c7d 100644 (file)
@@ -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;
                                char to_tag[13] = "";
                                char *event_str = "refer";
+                               sip_accept_t *ap = sip->sip_accept;
+                               char accept_header[256] = "";
 
                                np.fs_path = 1;
                                contact_str = sofia_glue_gen_contact_str(profile, sip, nh, de, &np);
@@ -1645,6 +1647,12 @@ static void our_sofia_event_callback(nua_event_t event,
                                        to_user = "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 "
                                                                         "(proto,sip_user,sip_host,sub_to_user,sub_to_host,presence_hosts,event,contact,call_id,full_from,"
index 41b4055a0991a0a9a47a79b91754b6d3e9cd6401..3dd216624b41cd9bb0293ce267bfdd0cc817066f 100644 (file)
@@ -3904,12 +3904,13 @@ void sofia_presence_handle_sip_i_subscribe(int status,
 
                } else {
                        sip_accept_t *ap = sip->sip_accept;
-                       char accept[256] = "";
+                       char accept_header[256] = "";
 
                        sub_state = nua_substate_active;
 
                        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;
                        }