[asterisk-users] Matching "+" at the beginning of the line

Tim Panton tim at mexuar.com
Fri May 25 10:10:12 MST 2007


On 25 May 2007, at 16:44, Eugen Rogoza wrote:

> On Fri, 2007-05-25 at 08:14 -0700, Steve Langstaff wrote:
>> I came across an issue where the user interface I was using  
>> (FreePBX?) to enter expressions was silently swallowing backslash  
>> characters (this wasn't regexp, but my dialplan had to add a SIP  
>> header with a semicolon in - that was falling foul of the comment  
>> character matching for the user interface, so I had to escape it,  
>> but that was being stripped elsewere!)
>>
>> So I wanted the following in the dial plan:
>>
>> Blah;blah
>>
>> But I had to enter:
>>
>> Blah\\;blah
>>
>> And when this was displayed on the user interface it was shown as:
>>
>> Blah\;blah
>>
>> Just a thought.
>>
>
> You are right, it looks like the backslashes are being silently
> swallowed, but adding extra ones doesn't help either :-)
>
> It cannot even match the backslash itself (\\). By the way, using your
> suggestions, one should type "\\\" to match a backslash :-)

I had to do something messy to get this to work in the dialplan:

exten => 1,n,Set(PLUS=\\+)
exten => 1,n,set(INNAT=${REGEX("^${PLUS}" ${ATELNO})})
exten => 1,n,gotoif($[${INNAT}] ?visint)

Now admittedly I had a whole lot of other things going on that
probably made it harder than it had to be.



Tim Panton

www.mexuar.net
www.westhawk.co.uk/





More information about the asterisk-users mailing list