Hello all,
I am working with Asterisk 1.8 and need to get extension numbers out of SIP headers. For this, I use the following regex construct in my dialplan:
same => n,Set(regx="([0-9]+)")
same => n,Set(ZIEL=$["${VAR}" : ${regx}])
I have to examples for the variable VAR:
1.: sip:3112;phone-context=hallo@172.11.133.18;user=phone
2.: tel:3311;reason=no-answer;counter=1;screen=no;privacy=off
The first one is the SIP header “To”, for this, the dialplan works fine.
The second one is the SIP diversion header (Asterisk is not able to parse this because 1.8 does not know about tel: URIs). It does not work, which means, VAR is empty.
I ask myself: why? There are no additional characters in the second one.
Apart from that: is there any further documentation about how and using what syntax, regex “grepping” in Asterisk is supported?