pjsua_process_msg_data() same header type add

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Benny,
I found a strange behaviour of function pjsua_process_msg_data(). For 
example if you try to add a custom Expires: 30 header in

pjsua_call_xfer(some_id, some_dest, msg_with_my_expires_header);

the request would look like this:

Expires: 300  /* standard value */
...
Expires: 30   /* my additional header */

The same header should not be added twice imho and also some clients or 
proxies reject it, e.g. X-Lite.

Is this exactly what You want or the additional header should replace 
the original one? Patch goes here:

// Replace loop in pjsua_core.c lines 1892-1900 with:
hdr = msg_data->hdr_list.next;
while (hdr && hdr != &msg_data->hdr_list) {
pjsip_hdr *new_hdr;

new_hdr = pjsip_msg_find_hdr_by_names(tdata->msg, &hdr->name, 
&hdr->sname, NULL);
if (new_hdr) pj_list_erase(new_hdr);
new_hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, hdr);
pjsip_msg_add_hdr(tdata->msg, new_hdr);

hdr = hdr->next;
}


I discovered this when trying to cancel call transfer. See mail ``Cancel 
call transfer''.

Cheers
	Vali




[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux