Microsot Teams Dialplan insert value between two regex variables/referenes

Brass Contributor



I stumble to a problem where I want to insert a value between two regex variables/referenes. The case is, a user who wants to dial offnet, need to prefix it with a code unique to him/herself. for example, to dial 23456789, user needs to dial 99990002345789 (yea I know this ridiculous, but it already runs for years with their previous pbxes and they're good with it). 


Problem is, at one point that I cant explain here, we need to insert a value between 9999000 (which is 7 digits) and 23456789 (can be more digits).

I tried to filter it in dialplan with ^(\d{7})(\d+)$ and translated to $1021$2. But it resulted to $102123456789 (we expected 999900002123456789). 


Tried it with ${1}021$2 and tested it in dialplan, the number would be correct and resulted as 999900002123456789 but in Teams client, it became ${1}02123456789 instead.


Lastly tried with named variables:

regex: ^(?<pre>\d{7})(?<suf>\d+)$

translated to ${pre}021${suf}

translated as ${pre}021${suf} instead as shown :



Any suggestion how I might to do this? If this is not possible, I can do it in SBC instead. But right now it is really imperative for us to try doing it in Teams first. 


Thank you in advance.



0 Replies