-
Notifications
You must be signed in to change notification settings - Fork 428
Description
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.