Trying to wrap my head around variables.
Here is what I have tried so far: http://pastebin.freeswitch.org/20166 The idea is to replace %BRIDGE_DATA% with ${MyBridgeData}. When I do that the call goes straight to voicemail. The log line is supposed to show what MyBridgeData is but all it displays is the literal "${MyBridgeData}". Can someone point me in the right direction please. By the way, here is what this convoluted mess is supposed to do. I give each of my clients two numbers, a real DID and an internal number which is +1 999 99x-xxxx where "xxxxx" is the user's client code. When a call comes in for them I send the call to their main account. If they have registered the internal number then it will simultaneously ring that number after 5 seconds. If not and they have registered their cell number in their control panel then I use that for the secondary one instead. Cheers. -- D'Arcy J.M. Cain System Administrator, Vex.Net http://www.Vex.Net/ IM:darcy@Vex.Net
Have you read the wiki article on the xml dialplan or the chapter on ot in our book? The thing that tends to be the most difficult to grok is that when the module is parsing the xml, its not doing the things right as it sees them, rather it collects the matching stuff and distills it down to a linear set of instructions. So if you set variables in one action then expect it to exist, you will be disappointed because it has not actually executed the set command, it only adds it to the list of work. However, there is a way to get what you want by adding inline="true" to the action when you set variables so they actually are set immediately and won't count in the list of work. This only works for set and a small list of apps....... On Nov 3, 2012 4:50 PM, "D'Arcy J.M. Cain" <darcy@vex.net> wrote:
Here is what I have tried so far:
http://pastebin.freeswitch.org/20166
The idea is to replace %BRIDGE_DATA% with ${MyBridgeData}. When I do that the call goes straight to voicemail. The log line is supposed to show what MyBridgeData is but all it displays is the literal "${MyBridgeData}". Can someone point me in the right direction please.
By the way, here is what this convoluted mess is supposed to do. I give each of my clients two numbers, a real DID and an internal number which is +1 999 99x-xxxx where "xxxxx" is the user's client code. When a call comes in for them I send the call to their main account. If they have registered the internal number then it will simultaneously ring that number after 5 seconds. If not and they have registered their cell number in their control panel then I use that for the secondary one instead.
Cheers.
-- D'Arcy J.M. Cain System Administrator, Vex.Net http://www.Vex.Net/ IM:darcy@Vex.Net
_________________________________________________________________________ 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 Sat, 3 Nov 2012 16:05:51 -0600 Anthony Minessale <anthony.minessale@gmail.com> wrote:
Have you read the wiki article on the xml dialplan or the chapter on ot in our book?
I have pored over the wiki quite a bit. In fact, some of that code comes from the examples there. I suppose I could have misread it. Is there something in particular in my dialplan that I am doing wrong?
The thing that tends to be the most difficult to grok is that when the module is parsing the xml, its not doing the things right as it sees them, rather it collects the matching stuff and distills it down to a linear set of instructions. So if you set variables in one action then expect it to exist, you will be disappointed because it has not actually executed the set command, it only adds it to the list of
That's exactly what I hope, that it executes the set actions at run time. Specifically, the sofia_contact(99999%UID%@${domain_name}) has to happen during the call setup since the state of registration can change all the time.
work. However, there is a way to get what you want by adding inline="true" to the action when you set variables so they actually are set immediately and won't count in the list of work. This only works for set and a small list of apps.
Definitely not what I want in this case. -- D'Arcy J.M. Cain System Administrator, Vex.Net http://www.Vex.Net/ IM:darcy@Vex.Net
On Sat, 3 Nov 2012 22:58:43 -0400 "D'Arcy J.M. Cain" <darcy@Vex.Net> wrote:
work. However, there is a way to get what you want by adding inline="true" to the action when you set variables so they actually are set immediately and won't count in the list of work. This only works for set and a small list of apps.
Definitely not what I want in this case.
I think I misunderstood. I read "immediately" as being at reloadxml time. I see that it means during the hunting phase. I modified my dialplan but it still isn't quite right. See the updated pastebin: http://pastebin.freeswitch.org/20168 See the log extract at the end. It shows cellPhone being set to something but when it tests it it is blank. -- D'Arcy J.M. Cain System Administrator, Vex.Net http://www.Vex.Net/ IM:darcy@Vex.Net
What's happening is that you're trying to use cellPhone as a built-in variable when instead it is a channel variable that you've set (read the whole Variables section of this Wiki page: http://wiki.freeswitch.org/wiki/Dialplan_XML#Variables). Try "<condition field="${cellPhone}" expression......." ~Brian On Sat, Nov 3, 2012 at 11:20 PM, D'Arcy J.M. Cain <darcy@vex.net> wrote:
On Sat, 3 Nov 2012 22:58:43 -0400 "D'Arcy J.M. Cain" <darcy@Vex.Net> wrote:
work. However, there is a way to get what you want by adding inline="true" to the action when you set variables so they actually are set immediately and won't count in the list of work. This only works for set and a small list of apps.
Definitely not what I want in this case.
I think I misunderstood. I read "immediately" as being at reloadxml time. I see that it means during the hunting phase. I modified my dialplan but it still isn't quite right. See the updated pastebin:
http://pastebin.freeswitch.org/20168
See the log extract at the end. It shows cellPhone being set to something but when it tests it it is blank.
-- D'Arcy J.M. Cain System Administrator, Vex.Net http://www.Vex.Net/ IM:darcy@Vex.Net
_________________________________________________________________________ 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 Sun, 4 Nov 2012 09:33:26 -0600 Brian Wiese <brian.wiese.freeswitch@gmail.com> wrote:
What's happening is that you're trying to use cellPhone as a built-in variable when instead it is a channel variable that you've set (read the whole Variables section of this Wiki page: http://wiki.freeswitch.org/wiki/Dialplan_XML#Variables).
Try "<condition field="${cellPhone}" expression......."
The light goes on. Thanks. I have added a specific example of this in the wiki just to make it a little clearer. -- D'Arcy J.M. Cain System Administrator, Vex.Net http://www.Vex.Net/ IM:darcy@Vex.Net
On Sun, 4 Nov 2012 09:33:26 -0600 Brian Wiese <brian.wiese.freeswitch@gmail.com> wrote:
What's happening is that you're trying to use cellPhone as a built-in
By the way, I have managed to do what I want using a Python module. It's much cleaner and more flexible anyway. -- D'Arcy J.M. Cain System Administrator, Vex.Net http://www.Vex.Net/ IM:darcy@Vex.Net
Make one extension to set vars then call transfer to another one that does things based on the vars. On Sun, Nov 4, 2012 at 9:33 AM, Brian Wiese < brian.wiese.freeswitch@gmail.com> wrote:
What's happening is that you're trying to use cellPhone as a built-in variable when instead it is a channel variable that you've set (read the whole Variables section of this Wiki page: http://wiki.freeswitch.org/wiki/Dialplan_XML#Variables).
Try "<condition field="${cellPhone}" expression......."
~Brian
On Sat, Nov 3, 2012 at 11:20 PM, D'Arcy J.M. Cain <darcy@vex.net> wrote:
On Sat, 3 Nov 2012 22:58:43 -0400 "D'Arcy J.M. Cain" <darcy@Vex.Net> wrote:
work. However, there is a way to get what you want by adding inline="true" to the action when you set variables so they actually are set immediately and won't count in the list of work. This only works for set and a small list of apps.
Definitely not what I want in this case.
I think I misunderstood. I read "immediately" as being at reloadxml time. I see that it means during the hunting phase. I modified my dialplan but it still isn't quite right. See the updated pastebin:
http://pastebin.freeswitch.org/20168
See the log extract at the end. It shows cellPhone being set to something but when it tests it it is blank.
-- D'Arcy J.M. Cain System Administrator, Vex.Net http://www.Vex.Net/ IM:darcy@Vex.Net
_________________________________________________________________________ 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
_________________________________________________________________________ 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
participants (3)
-
Anthony Minessale
-
Brian Wiese
-
D'Arcy J.M. Cain