[asterisk-bugs] [JIRA] (ASTERISK-21815) SipRemoveHeader does not remove previously added Alert-Info Header

Rusty Newton (JIRA) noreply at issues.asterisk.org
Fri May 24 13:52:03 CDT 2013


    [ https://issues.asterisk.org/jira/browse/ASTERISK-21815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=206805#comment-206805 ] 

Rusty Newton edited comment on ASTERISK-21815 at 5/24/13 1:50 PM:
------------------------------------------------------------------

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: ...)
{noformat}
[May 24 13:32:56] VERBOSE[14760] res_agi.c:     -- AGI Script Executing Application: (SipAddHeader) Options: ("Alert-Info: <http://130.10.14.249:8080/provisioning/ringtone/default?user=2205&id=0>")
[May 24 13:32:56] DEBUG[14760] chan_sip.c: SIP Header added ""Alert-Info: <http://130.10.14.249:8080/provisioning/ringtone/default?user=2205&id=0>"" as __SIPADDHEADER02
{noformat}

When you are attempting to remove the header you don't include any quotes:
{noformat}
[May 24 13:32:56] VERBOSE[14760] pbx.c:     -- Executing [2205 at macro-dial-localext:55] SIPRemoveHeader("SIP/2202-0000010a", "Alert-Info:") in new stack
{noformat}

The SipRemoveHeader application, when supplied with a parameter matches from the beginning of the string. From the help text:

{noformat}
If a parameter is supplied, only the matching headers will
be removed.
For example you have added these 2 headers:
SIPAddHeader(P-Asserted-Identity: sip:foo at bar);
SIPAddHeader(P-Preferred-Identity: sip:bar at foo);
// remove all headers
SIPRemoveHeader();
// remove all P- headers
SIPRemoveHeader(P-);
// remove only the PAI header (note the : at the end)
SIPRemoveHeader(P-Asserted-Identity:);
Always returns '0'.
{noformat}

Remove the quotes and you should be good. 
                
      was (Author: rnewton):
    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: ...)
{noformat}
[May 24 13:32:56] VERBOSE[14760] res_agi.c:     -- AGI Script Executing Application: (SipAddHeader) Options: ("Alert-Info: <http://130.10.14.249:8080/provisioning/ringtone/default?user=2205&id=0>")
[May 24 13:32:56] DEBUG[14760] chan_sip.c: SIP Header added ""Alert-Info: <http://130.10.14.249:8080/provisioning/ringtone/default?user=2205&id=0>"" as __SIPADDHEADER02
{noformat}

When you are removing the header you don't include any quotes:
{noformat}
[May 24 13:32:56] VERBOSE[14760] pbx.c:     -- Executing [2205 at macro-dial-localext:55] SIPRemoveHeader("SIP/2202-0000010a", "Alert-Info:") in new stack
{noformat}

The SipRemoveHeader application, when supplied with a parameter matches from the beginning of the string. From the help text:

{noformat}
If a parameter is supplied, only the matching headers will
be removed.
For example you have added these 2 headers:
SIPAddHeader(P-Asserted-Identity: sip:foo at bar);
SIPAddHeader(P-Preferred-Identity: sip:bar at foo);
// remove all headers
SIPRemoveHeader();
// remove all P- headers
SIPRemoveHeader(P-);
// remove only the PAI header (note the : at the end)
SIPRemoveHeader(P-Asserted-Identity:);
Always returns '0'.
{noformat}

Remove the quotes and you should be good.
                  
> SipRemoveHeader does not remove previously added Alert-Info Header
> ------------------------------------------------------------------
>
>                 Key: ASTERISK-21815
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-21815
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: PBX/General
>    Affects Versions: 1.8.22.0, 10.12.2
>         Environment: ubunue 10.04
>            Reporter: Peter Katzmann
>            Assignee: Rusty Newton
>         Attachments: full
>
>
> Hello,
> 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 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list