Actually, I think this answers my question:

http://comments.gmane.org/gmane.comp.voip.sems.user/1848

-- Alex

On 01/13/2014 03:30 PM, Alex Balashov wrote:

Hi,

I'm trying to strip the leading '1' from an 11 digit number in the From
URI.  That is, if I have a From header like this:

    From: <sip:17065551212@domain>

I wish for it to become:

    From: <sip:7065551212@domain>

I tried to do this via a regex_map - in sbc.conf:

    regex_maps=normalise_from

In normalise_from.conf:

    ^1([0-9]{10})=>\1

And in the SBC profile (yes, I want to replace the From domain, too):

    From=<sip:$M($fU=>normalise_from)@$Ri>

But this just results in the following From URI user part: \1

I figured perhaps the regex engine is not so thoroughly PCRE-compatible,
so I also tried the following pattern:

   ^1(.+)=>\1

None of that appears to yield a result.

Is this because the regex maps facility only supports basic replacement
with static target values?  Is it not possible to extract a token and
refer to it?  If so, how is it done?  I was not able to find any
examples in the package or formal docs.

Thanks!

-- Alex



--
Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
United States
Tel: +1-678-954-0670
Web: http://www.evaristesys.com/, http://www.alexbalashov.com/
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems

Reply via email to