sorry for bad format ill post the code again pjsua_msg_data msg_data; pjsip_generic_string_hdr subject; pj_str_t hvalue, hname; for( /* all keys and value */){ pjsua_msg_data_init(&msg_data); hname = // key char * headerValue = //value hvalue = pj_str(headerValue); pjsip_generic_string_hdr_init2 (&subject, &hname, &hvalue); pj_list_push_back(&msg_data.hdr_list, &subject); } when i log i get all keys and values but in case of headers i only get the last one On Wed, Sep 4, 2013 at 8:27 PM, Rohit Singh <soulgamebits at gmail.com> wrote: > Hi guys, > i am developing an ios app using pjsip as sip stack > i am trying to send multiple custom headers in my invite, but the code > adds only the last one > > i am looping this code > like > > > pjsua_msg_data msg_data; > pjsip_generic_string_hdr subject; > > pj_str_t hvalue, hname; > > for(NSString *key in [headers allKeys]){ > > > > NSLog(@"Call.m key value in call %@,%@",key,[headers > objectForKey:key] ); > > pjsua_msg_data_init(&msg_data); > > > > hname = pj_str((char *)[key UTF8String]); > > > > char * headerValue=(char *)[(NSString *)[headers objectForKey:key] > UTF8String]; > > > > hvalue = pj_str(headerValue); > > > > // pjsip_generic_string_hdr_create(pool1, &hname, &hvalue); > > pjsip_generic_string_hdr_init2 (&subject, &hname, &hvalue); > > > > pj_list_push_back(&msg_data.hdr_list, &subject); > > > } > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20130904/4f7673ac/attachment-0001.html>