[asterisk-users] How to encode plus sign in REGEX function in dialplan?

Recursive
Mon, 09 Nov 2015 13:40:19 -0000

On 06.11.2015 14:06, Rusty Newton wrote:
> On Thu, Nov 5, 2015 at 12:49 AM, Recursive <lists at binarus.de>
wrote:
>>
>>   same => n(A1), GotoIf($[${REGEX("^\+49.*"
${EXTEN})}]?:A2)
>> [..]
>> Actually, the REGEX function is not able to handle normal regular
expressions. To make things worse, there doesn't seem to be any
documentation. Could anybody please point me to documentation or tell me how
write that very simple pattern?
>>
>
> The documentation for that function is available at the CLI "core show
> function REGEX" and is available on the wiki at
> https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Function_REGEX

At first, thank you very much for your reply.

Of course, I had found and read that part of the documentation before posting
here. But in this documentation (and any other I came across), I couldn't
find any hint about if and how to encode special characters, about what sort of
regular expressions are allowed (Perl, extended, Sed etc.), or about what RE
engine is used internally. This is what I meant by claiming "no
documentation".

> It should be able to handle typical regular expression. I don't see
> anything wrong with what you are doing. Please file a bug at
> issues.asterisk.org/jira.  Do include a debug log on the issue
> captured when Asterisk attempts to execute these extensions.
>
> https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information

I really was hoping to do something wrong. I'll try to file a bug and enable
others to reproduce by giving a simple example with standard configuration so
that I don't need to upload mine.

Regards,

Recursive