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 ? -- Mimiko desu.
On Wed, Sep 25, 2013 at 9:31 PM, Mimiko <vbvbrj@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
Mimiko, Glad to see you were able to fix this. If possible, could you look for the relevant docs in the wiki and update them to reflect this? It will help other users in the future who experience the same problem. Getting access to do this is easy, just go to [1], wait a day or two for someone to auth your account, then once auth'd you can add/edit pages. It will probably take up about 30 minutes, but we really encourage users to get involved as every little bit helps! Thanks man Cal [1] https://wiki.freeswitch.org/wiki/Special:RequestAccount On Thu, Sep 26, 2013 at 1:01 PM, Mimiko <vbvbrj@gmail.com> wrote:
On 26.09.2013 02:37, Dušan Dragić wrote:
<action function="play-file" data="digits/$10.wav"/>
So I had to overcome with this for now:
<action function="play-file" data="digits/${strftime($1)}0.wav"/>
-- Mimiko desu.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
On 26.09.2013 17:33, Cal Leeming [Simplicity Media Ltd] wrote:
If possible, could you look for the relevant docs in the wiki and update them to reflect this? It will help other users in the future who experience the same problem.
Hi, Cal. Yes, I could update on wiki this information, but in my opinion using a function to isolate $1 variable from following digit in a string is not very professional. There might be some more evident way. If its ok for this solution, I will fill the wiki. -- Mimiko desu.
This works in the dialplan to use ${1} and the same code is used in the macro stuff so it should be investigated. You should provide a proper example (complete drop-in macro example etc not just instructions how to build it) in a jira against HEAD. On Thu, Sep 26, 2013 at 11:13 AM, Mimiko <vbvbrj@gmail.com> wrote:
On 26.09.2013 17:33, Cal Leeming [Simplicity Media Ltd] wrote:
If possible, could you look for the relevant docs in the wiki and update them to reflect this? It will help other users in the future who experience the same problem.
Hi, Cal.
Yes, I could update on wiki this information, but in my opinion using a function to isolate $1 variable from following digit in a string is not very professional. There might be some more evident way. If its ok for this solution, I will fill the wiki.
-- Mimiko desu.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
On 26.09.2013 19:33, Anthony Minessale wrote:
This works in the dialplan to use ${1} and the same code is used in the macro stuff so it should be investigated. You should provide a proper example (complete drop-in macro example etc not just instructions how to build it) in a jira against HEAD.
Compiled and tested against head 1.5.6b 6b9382290d and ${1} is working. For FS v 1.3.13b cad607d72e it does not work. By the way, I didn't see on wiki any use of ${1} and I thought that it is not valid. -- Mimiko desu.
participants (4)
-
Anthony Minessale
-
Cal Leeming [Simplicity Media Ltd]
-
Dušan Dragić
-
Mimiko