Problem with conditions depending on values generated by dialplan
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I want a dialplan setting a channel variable with a certain value. After that I want to do some action depending of that variable/value. But it looks like that FS parses the regular expressions of dialplan conditions only at the beginning of dialplan_hunt, so that conditions based on channel variables are only possible with the variable values at the time of starting dialplan_hunt. Is that true or is there a way to do what I like to do ? regards helmut -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkkZf78ACgkQ4tZeNddg3dzW7gCffmFMZrR9h1eDPZrXXAxrkJ5/ z/cAnjxmYAvHqdxAGJ8iIlrV+h5fv+1Q =F9QJ -----END PGP SIGNATURE-----
Hi Helmut, As far as I know, the <condition> at the top of the dialplan is indeed THE condition. We've used two mechanism for 'dynamic' dialplan: - xml_curl: freeswitch posts parameters to a URL and the URL returns a dynamic dialplan. This works well with a webserver connected to a database - javascript (spidermonkey) Hope the above helps, Birgit On 11/11/08 12:51, Helmut Kuper wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
I want a dialplan setting a channel variable with a certain value. After that I want to do some action depending of that variable/value. But it looks like that FS parses the regular expressions of dialplan conditions only at the beginning of dialplan_hunt, so that conditions based on channel variables are only possible with the variable values at the time of starting dialplan_hunt.
Is that true or is there a way to do what I like to do ?
regards helmut
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkkZf78ACgkQ4tZeNddg3dzW7gCffmFMZrR9h1eDPZrXXAxrkJ5/ z/cAnjxmYAvHqdxAGJ8iIlrV+h5fv+1Q =F9QJ -----END PGP SIGNATURE-----
_______________________________________________ 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
-- -- Birgit Arkesteijn, birgit@westhawk.co.uk, -- Westhawk Ltd, Albion Wharf, 19 Albion Street, Manchester M1 5LN, UK -- Company no: 1769350 -- Registered Office: -- 15 London Road, Stockton Heath, Warrington WA4 6SJ. UK. -- tel.: +44 (0)161 237 0660 -- <URL: http://www.westhawk.co.uk>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Birgit, well of course the condition is THE condition, but I espected the whole dialplan is executed sequentially, so that this fictive dialplan works: <condition field="xyz" expression".*" break="never"> <action application="set" data="MYVAR=abc"/> </condition> <condition field="MYVAR" expression="abc"> <action application="bridge" data="....."/> <anti-action application .... /> </condition> but unfortunately all conditions are parsed befor executing the actions, so MYVAR is nearly worthless in dialplan (except within applications). regards Helmut Birgit Arkesteijn schrieb:
Hi Helmut,
As far as I know, the <condition> at the top of the dialplan is indeed THE condition.
We've used two mechanism for 'dynamic' dialplan: - xml_curl: freeswitch posts parameters to a URL and the URL returns a dynamic dialplan. This works well with a webserver connected to a database - javascript (spidermonkey)
Hope the above helps, Birgit
On 11/11/08 12:51, Helmut Kuper wrote: Hi,
I want a dialplan setting a channel variable with a certain value. After that I want to do some action depending of that variable/value. But it looks like that FS parses the regular expressions of dialplan conditions only at the beginning of dialplan_hunt, so that conditions based on channel variables are only possible with the variable values at the time of starting dialplan_hunt.
Is that true or is there a way to do what I like to do ?
regards helmut
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 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkkZh6MACgkQ4tZeNddg3dxGVwCgllX9/Xz/Dv9Tlisy5OKXXt8N AYQAnirOm1w2veyLqaVRYQmcD1IogYa9 =/pjY -----END PGP SIGNATURE-----
Yes, you seem to understand it perfectly. (one man's problem description is another man's documentation) The dialplan is a state of the call (ROUTING) that comes before EXECUTE. The reason you are having problems is you are confusing the dialplan with asterisk that treats its dialplan as a scripting language. The FS dialplan is like a pre-processor for the call that scans the entire thing and compiles it into a single list of instructions before changing to EXECUTE and actually executing the instructions. The best way to fix the problem is to shift the paradigm in your head to match the one in reality. The best way to do what you want is to set the variable as you do now then transfer the call to another extension. Since that action will put the call back into ROUTING the next extension will see the variable. Also you can use the execute_extension application in a similar manner to transfer without actually transferring. On Tue, Nov 11, 2008 at 7:25 AM, Helmut Kuper <helmut.kuper@ewetel.de>wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi Birgit,
well of course the condition is THE condition, but I espected the whole dialplan is executed sequentially, so that this fictive dialplan works:
<condition field="xyz" expression".*" break="never"> <action application="set" data="MYVAR=abc"/> </condition> <condition field="MYVAR" expression="abc"> <action application="bridge" data="....."/> <anti-action application .... /> </condition>
but unfortunately all conditions are parsed befor executing the actions, so MYVAR is nearly worthless in dialplan (except within applications).
regards Helmut
Birgit Arkesteijn schrieb:
Hi Helmut,
As far as I know, the <condition> at the top of the dialplan is indeed THE condition.
We've used two mechanism for 'dynamic' dialplan: - xml_curl: freeswitch posts parameters to a URL and the URL returns a dynamic dialplan. This works well with a webserver connected to a database - javascript (spidermonkey)
Hope the above helps, Birgit
On 11/11/08 12:51, Helmut Kuper wrote: Hi,
I want a dialplan setting a channel variable with a certain value. After that I want to do some action depending of that variable/value. But it looks like that FS parses the regular expressions of dialplan conditions only at the beginning of dialplan_hunt, so that conditions based on channel variables are only possible with the variable values at the time of starting dialplan_hunt.
Is that true or is there a way to do what I like to do ?
regards helmut
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
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkkZh6MACgkQ4tZeNddg3dxGVwCgllX9/Xz/Dv9Tlisy5OKXXt8N AYQAnirOm1w2veyLqaVRYQmcD1IogYa9 =/pjY -----END PGP SIGNATURE-----
_______________________________________________ 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/ AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
participants (3)
-
Anthony Minessale
-
Birgit Arkesteijn
-
Helmut Kuper