Skip to content

ereg-Action uses the header-parameter in an unintuitive manner #805

@ChristianBergerSipgate

Description

@ChristianBergerSipgate

Hi,

we have found a potential issue sip how the ereg action handles the "header"-parameter. It seems to only search for the string provided there in the message with no regards to the actual message structure.

So if you have a message with the following headers

X-Forward-To: wurst
To: sip:wurst@wurst.de

an action like
<ereg regexp="someregex" search_in="hdr" header="To" check_it="true" assign_to="2" />⏎
will try to match the regex against : wurst

Changing it to header="To:" will match it against wurst (note the space in front).
Changing it to header="To: " (with a space) will match it against wurst (no space in front).

Only when we use header="\r\nTo: " it'll match against the To:-Header.

Maybe it makes sense to check the header parameter and adjust it if it doesn't start with \r\n and and in a space. Alternatively one could document this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions