[Freeswitch-users] Wrapping $1,$2,etc.

Dušan Dragić dragic.dusan at gmail.com
Thu Sep 26 03:37:37 MSD 2013


On Wed, Sep 25, 2013 at 9:31 PM, Mimiko <vbvbrj at gmail.com> wrote:
> Hello.
>
> I've searched the wiki for some mention, but to nothing.
>
> I have a phrase to say. For this I capture digits with condition: <input
> pattern="^([2-9])([1-9])$"> . So $1 is for first part to say and $2 is
> second. I have files for first part named like 10.wav, 20.wav, 30.wav
> and so on. For second part I have files named like: 1-2.wav, 2-2.wav,
> 3-3.wav...
>
> I can use for second part:
>   <action function="play-file" data="digits/$2-2.wav"/>
>
> But I have problem for first part:
>   <action function="play-file" data="digits/$10.wav"/>
>
> This plays nothing. How to delimit that the variable is $1 and not $10 ?
>

Use curly braces around the backreference, i.e. digits/${1}0.wav



Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list