|Summary:||ASTERISK-21815: SipRemoveHeader does not remove previously added Alert-Info Header|
|Reporter:||Peter Katzmann (pk16208)||Labels:|
|Date Opened:||2013-05-24 06:38:31||Date Closed:||2013-05-24 13:51:10|
|Versions:||188.8.131.52 10.12.2||Frequency of|
|Environment:||ubunue 10.04||Attachments:||( 0) full|
we tried to remove a previously added alert-info header element to avoid wrong ringtones during call forwarding.
I tried several incarnations of SipRemoveHeader(Alert-Info:), Alert-Info, Alert-
But the info element is still in the header
|Comments:||By: Peter Katzmann (pk16208) 2013-05-24 06:39:13.838-0500|
Logfile with dialplan and sip flow
By: Rusty Newton (rnewton) 2013-05-24 13:50:12.365-0500
This took me a bit to notice after attempting to reproduce.
You add the header, improperly including the quotes: (notice the double quotes, ""Alert-Info: ...)
[May 24 13:32:56] VERBOSE res_agi.c: -- AGI Script Executing Application: (SipAddHeader) Options: ("Alert-Info: <http://184.108.40.206:8080/provisioning/ringtone/default?user=2205&id=0>")
[May 24 13:32:56] DEBUG chan_sip.c: SIP Header added ""Alert-Info: <http://220.127.116.11:8080/provisioning/ringtone/default?user=2205&id=0>"" as __SIPADDHEADER02
When you are attempting to remove the header you don't include any quotes:
[May 24 13:32:56] VERBOSE pbx.c: -- Executing [2205@macro-dial-localext:55] SIPRemoveHeader("SIP/2202-0000010a", "Alert-Info:") in new stack
The SipRemoveHeader application, when supplied with a parameter matches from the beginning of the string. From the help text:
If a parameter is supplied, only the matching headers will
For example you have added these 2 headers:
// remove all headers
// remove all P- headers
// remove only the PAI header (note the : at the end)
Always returns '0'.
Remove the quotes and you should be good.
By: Peter Katzmann (pk16208) 2013-05-27 05:23:54.307-0500
You are right, the agi had double quotes.
But as a side thought, why does asterisk silently remove the quotes in the SIP Header ?
By: Rusty Newton (rnewton) 2013-06-05 14:54:01.044-0500
bq. But as a side thought, why does asterisk silently remove the quotes in the SIP Header ?
I don't understand the question. Asterisk doesn't remove any quotes. It was keeping the quotes that were sent to it.
The quotes you see in debug exist to denote that string. As in the quotes you see below:
If you mean that Asterisk is removing the unintentional quotes before it sends out the SIP message.. I don't know. You could ask in #asterisk-dev or on the dev list