VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
jbr at consiglia.dk Guest
|
Posted: Thu Sep 25, 2008 11:51 am Post subject: [Freeswitch-users] Possible problem in adding channel variab |
|
|
Anthony, I think I understand this part of it, but I’ll try to stay humble.
This is what I want: I want to have several destinations in my dialstring, and I want to pass different variables on to the script which runs after answer.
I also wanted to control the A-number caller ID, and that works as it should, by placing [originate_caller_id_number=XXXX] in front of the destination. So let’s forget about that.
I have tried:
<action application="bridge" data="[NEWVARIABLE=AAABBBCCC]user/${custid}${dialed_ext}@${caller_domain}"/>
In order to pass the variable NEWVARIABLE on to the ONANSWER script.
I have let the ONANSWER XML script make an “execute_extension call” to another XML script. For the sake of clarity, lets call it the INFO script. In the INFO script I check if variable in the dial string has been given a value. The ONANSWER script is fired off two times: when the a-leg answers and when the b-leg answers. Apparently that’s the way “execute_on_answer” works, when its set using the export facility.
When it is the a-leg which fires off the ONANSWER script, the NEWVARIABLE exists in the following INFO script fired off by the b-leg-answer event. But if the b-leg which fires off the ONANSWER script first, the variable has no value in INFO script. In some tests, I get a populated variable in 3 out of 10 calls.
Hope this clarified the issue, if not, I may call you on the phone. /Jon |
|
Back to top |
|
|
anthony.minessale at g... Guest
|
Posted: Thu Sep 25, 2008 12:02 pm Post subject: [Freeswitch-users] Possible problem in adding channel variab |
|
|
can i see the entire extension?
The reference to XML as scripts is what is hard to understand?
What exactly are you setting in execute_on_answer?
On Thu, Sep 25, 2008 at 11:48 AM, Jon Bruel <jbr@consiglia.dk (jbr@consiglia.dk)> wrote:
Quote: |
Anthony, I think I understand this part of it, but I'll try to stay humble.
This is what I want: I want to have several destinations in my dialstring, and I want to pass different variables on to the script which runs after answer.
I also wanted to control the A-number caller ID, and that works as it should, by placing [originate_caller_id_number=XXXX] in front of the destination. So let's forget about that.
I have tried:
<action application="bridge" data="[NEWVARIABLE=AAABBBCCC]user/${custid}${dialed_ext}@${caller_domain}"/>
In order to pass the variable NEWVARIABLE on to the ONANSWER script.
I have let the ONANSWER XML script make an "execute_extension call" to another XML script. For the sake of clarity, lets call it the INFO script. In the INFO script I check if variable in the dial string has been given a value. The ONANSWER script is fired off two times: when the a-leg answers and when the b-leg answers. Apparently that's the way "execute_on_answer" works, when its set using the export facility.
When it is the a-leg which fires off the ONANSWER script, the NEWVARIABLE exists in the following INFO script fired off by the b-leg-answer event. But if the b-leg which fires off the ONANSWER script first, the variable has no value in INFO script. In some tests, I get a populated variable in 3 out of 10 calls.
Hope this clarified the issue, if not, I may call you on the phone. /Jon
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (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 ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400 |
|
Back to top |
|
|
jbr at consiglia.dk Guest
|
Posted: Thu Sep 25, 2008 2:02 pm Post subject: [Freeswitch-users] Possible problem in adding channel variab |
|
|
Anthony, this is a simplified version dialplan, just for an illustration of the previous posts:
file default.xml:
<?xml version="1.0" encoding="utf-8"?>
<include>
<context name="default">
<extension name="Local_Extension">
<condition field="destination_number" expression="^(10[01][0-9])$">
<action application="set" data="leg=a"/>
<action application="set" data="destination=user/$1@10.3.1.11"/>
<action application="export" data="execute_on_answer=execute_extension ONANSWER XML default"/>
<action application="bridge" data=" ="[NEWVARIABLE=AAABBBCCC]${destination}"/>
</condition>
</extension>
<extension name="Call_Answered">
<condition field="destination_number" expression="^ONANSWER$">
<action application="execute_extension" data="INFO XML info"/>
</condition>
</extension>
</context>
</include>
file info.xml:
<xml version="1.0" encoding="utf-8"?>
<include>
<context name="info">
<extension name="Call_Info">
<condition field="destination_number" expression="^INFO$" />
</condition>
<condition field="${leg}" expression="^a$">
<!-- We are in the b-leg-->
<anti-action application="set" data="On_Answer_Is_It_Then_Passed=${NEWVARIABLE}"/>
<anti-action application="info"/>
</condition>
</extension>
</context>
</include>
Sorry about my inconsistent use of the terms, the XML about should explain. /Jon |
|
Back to top |
|
|
anthony.minessale at g... Guest
|
Posted: Thu Sep 25, 2008 2:21 pm Post subject: [Freeswitch-users] Possible problem in adding channel variab |
|
|
which leg do you want to see the variable and which leg do you need to execute the extension
normally execute_on_answer is not used to do any prolonged activities since it will indeed block the progress of the call until the application you specified is done so it's normally just used to set a variable or schedule a call hangup etc.
if you only want the execute_on_answer to happen on the b-leg you can do the following in your existing code.
<action application="export" data="nolocal:execute_on_answer=execute_extension ONANSWER XML default"/>
the nolocal: tells the system to only set the variables on the b-legs spawned from the current channel and never the A leg itself otherwise export will set the variable on both legs.
This is the same as using {execute_on_answer='execute_extension ONANSWER XML default'}
at the beginning of your dial string.
The variables you put in the [foo=bar] will only be set on the B-legs spawned off from that originate.
if you do it like i mentioned here you can eliminate all of the checks for a or b leg because you will be certain that the event is only triggered on the B legs
On Thu, Sep 25, 2008 at 1:57 PM, Jon Bruel <jbr@consiglia.dk (jbr@consiglia.dk)> wrote:
Quote: |
Anthony, this is a simplified version dialplan, just for an illustration of the previous posts:
file default.xml:
<?xml version="1.0" encoding="utf-8"?>
<include>
<context name="default">
<extension name="Local_Extension">
<condition field="destination_number" expression="^(10[01][0-9])$">
<action application="set" data="leg=a"/>
<action application="set" data="destination=user/$1@10.3.1.11 (1@10.3.1.11)"/>
<action application="export" data="execute_on_answer=execute_extension ONANSWER XML default"/>
<action application="bridge" data=" ="[NEWVARIABLE=AAABBBCCC]${destination}"/>
</condition>
</extension>
<extension name="Call_Answered">
<condition field="destination_number" expression="^ONANSWER$">
<action application="execute_extension" data="INFO XML info"/>
</condition>
</extension>
</context>
</include>
file info.xml:
<xml version="1.0" encoding="utf-8"?>
<include>
<context name="info">
<extension name="Call_Info">
<condition field="destination_number" expression="^INFO$" />
</condition>
<condition field="${leg}" expression="^a$">
<!-- We are in the b-leg-->
<anti-action application="set" data="On_Answer_Is_It_Then_Passed=${NEWVARIABLE}"/>
<anti-action application="info"/>
</condition>
</extension>
</context>
</include>
Sorry about my inconsistent use of the terms, the XML about should explain. /Jon
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (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 ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400 |
|
Back to top |
|
|
jbr at consiglia.dk Guest
|
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|