Variables from failed call to be exported to a a new B leg

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Variables from failed call to be exported to a a new B leg

Tchavdar Paskov
Hi Everybody,

this is what i' trying to do / unsuccessfully / so far:


   <extension name="test">
      <condition field="destination_number" expression="^1(\d+)$" break="never">
         <action application="set" data="bypass_media=true" />
         <action application="set" data="continue_on_fail=true"/>
         <action application="bridge" data="sofia/gateway/gw_1/$1"/>
         <action application="info" />  -> at this point i'd like to collect some sip Vars from the failed call
         <action application="export" data="nolocal:sip_hangup_phrase" /> - from what i red in wiki i think this is the way to export the var to the Bleg
         <action application="bridge" data="sofia/gateway/gw_2/$0" />
      </condition>
    </extension>

the gw_2  does not  seem to receive the  sip_hangup_phrase.
pls  help me to figure out what i'm doing wrong.

thank you in advance.
regards
Chav

_______________________________________________
Freeswitch-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: Variables from failed call to be exported to a a new B leg

mercutioviz
>          <action application="bridge" data="sofia/gateway/gw_2/$0" />

Why are you using $0 here? Is that a typo?
-MC

_______________________________________________
Freeswitch-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: Variables from failed call to be exported to a a new B leg

Tchavdar Paskov
Yes it was typo.My Bad
Chav

----- Original Message -----
From: Michael Collins <[hidden email]>
Date: Thursday, February 26, 2009 1:07 pm
Subject: Re: [Freeswitch-users] Variables from failed call to be exported to a a new B leg
To: [hidden email]

> >          <action application="bridge"
> data="sofia/gateway/gw_2/$0" />
>
> Why are you using $0 here? Is that a typo?
> -MC
>
> _______________________________________________
> Freeswitch-users mailing list
> [hidden email]
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
_______________________________________________
Freeswitch-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: Variables from failed call to be exported to a a new B leg

Brian West
In reply to this post by Tchavdar Paskov
You might also want to actually SET a value to the variable.

/b

On Feb 26, 2009, at 2:56 PM, Tchavdar Paskov wrote:

> <action application="export" data="nolocal:sip_hangup_phrase" />


_______________________________________________
Freeswitch-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: Variables from failed call to be exported to a a new B leg

Tchavdar Paskov
isn't this already done because of the info application called before ?
Chav

----- Original Message -----
From: Brian West <[hidden email]>
Date: Thursday, February 26, 2009 1:14 pm
Subject: Re: [Freeswitch-users] Variables from failed call to be exported to a a new B leg
To: [hidden email]

> You might also want to actually SET a value to the variable.
>
> /b
>
> On Feb 26, 2009, at 2:56 PM, Tchavdar Paskov wrote:
>
> > <action application="export"
> data="nolocal:sip_hangup_phrase" />
>
>
> _______________________________________________
> Freeswitch-users mailing list
> [hidden email]
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
_______________________________________________
Freeswitch-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: Variables from failed call to be exported to a a new B leg

mercutioviz
On Thu, Feb 26, 2009 at 1:18 PM, Tchavdar Paskov <[hidden email]> wrote:
> isn't this already done because of the info application called before ?
> Chav
>

to make sure that there is indeed a value and that it gets exported to
the second b-leg try this:
<action application="set" data="my_var=${nolocal:sip_hangup_phrase}"/>
<action application="export" data="my_var" />

see if my_var is populated on the new b-leg.
-MC

_______________________________________________
Freeswitch-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: Variables from failed call to be exported to a a new B leg

Brian West
In reply to this post by Tchavdar Paskov
You then don't use the export command...  you set the variable <action  
application="set" data=""export_vars=sip_hangup_phrase"/>

/b

On Feb 26, 2009, at 3:18 PM, Tchavdar Paskov wrote:

> isn't this already done because of the info application called  
> before ?
> Chav


_______________________________________________
Freeswitch-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: Variables from failed call to be exported to a a new B leg

mrene
In reply to this post by Tchavdar Paskov
<action application="set" data="import=vars,you,want,from,the,bleg" />
<action application="bridge" data="..." />
<!-- Vars defined in the import var will be copied back to the A-leg -->
<action application="bridge" data="..." />

On 26-Feb-09, at 3:56 PM, Tchavdar Paskov wrote:

> Hi Everybody,
>
> this is what i' trying to do / unsuccessfully / so far:
>
>
>    <extension name="test">
>       <condition field="destination_number" expression="^1(\d+)$"  
> break="never">
>          <action application="set" data="bypass_media=true" />
>          <action application="set" data="continue_on_fail=true"/>
>          <action application="bridge" data="sofia/gateway/gw_1/$1"/>
>          <action application="info" />  -> at this point i'd like to  
> collect some sip Vars from the failed call
>          <action application="export"  
> data="nolocal:sip_hangup_phrase" /> - from what i red in wiki i  
> think this is the way to export the var to the Bleg
>          <action application="bridge" data="sofia/gateway/gw_2/$0" />
>       </condition>
>     </extension>
>
> the gw_2  does not  seem to receive the  sip_hangup_phrase.
> pls  help me to figure out what i'm doing wrong.
>
> thank you in advance.
> regards
> Chav
> _______________________________________________
> Freeswitch-users mailing list
> [hidden email]
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org


_______________________________________________
Freeswitch-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: Variables from failed call to be exported to a a new B leg

Brian West
In reply to this post by mercutioviz
You can also do it like this:

<action application="bridge" data="{sip_hangup_phrase=$
{sip_hangup_phrase}}sofia/gateway/gw_2/$1" />

I don't think what MC pointed out works.  I'll have to double check.

/b


On Feb 26, 2009, at 3:35 PM, Michael Collins wrote:

>
>
> to make sure that there is indeed a value and that it gets exported to
> the second b-leg try this:
> <action application="set" data="my_var=${nolocal:sip_hangup_phrase}"/>
> <action application="export" data="my_var" />
>
> see if my_var is populated on the new b-leg.
> -MC


_______________________________________________
Freeswitch-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: Variables from failed call to be exported to a a new B leg

mrene
In reply to this post by Tchavdar Paskov
Oh I just remembered something,

You can set the "failed_xml_cdr_prefix" variable (on the A-leg).
And it will copy ALL variables from the B-leg if the call fails.

<action application="set" data="failed_xml_cdr_prefix=providerA" />
<action application="bridge" data="...." />
<action application="set" data="failed_xml_cdr_prefix=providerB" />
<action application="bridge" data="...." />


Then you should have providerA_hangup_cause, providerB_hangup_cause.

Mathieu

On 26-Feb-09, at 3:56 PM, Tchavdar Paskov wrote:

> Hi Everybody,
>
> this is what i' trying to do / unsuccessfully / so far:
>
>
>    <extension name="test">
>       <condition field="destination_number" expression="^1(\d+)$"  
> break="never">
>          <action application="set" data="bypass_media=true" />
>          <action application="set" data="continue_on_fail=true"/>
>          <action application="bridge" data="sofia/gateway/gw_1/$1"/>
>          <action application="info" />  -> at this point i'd like to  
> collect some sip Vars from the failed call
>          <action application="export"  
> data="nolocal:sip_hangup_phrase" /> - from what i red in wiki i  
> think this is the way to export the var to the Bleg
>          <action application="bridge" data="sofia/gateway/gw_2/$0" />
>       </condition>
>     </extension>
>
> the gw_2  does not  seem to receive the  sip_hangup_phrase.
> pls  help me to figure out what i'm doing wrong.
>
> thank you in advance.
> regards
> Chav
> _______________________________________________
> Freeswitch-users mailing list
> [hidden email]
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org


_______________________________________________
Freeswitch-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: Variables from failed call to be exported to a a new B leg

Brian West
In reply to this post by mrene
OK I think we have covered BOTH directions now ;)

/b

On Feb 26, 2009, at 3:48 PM, Mathieu Rene wrote:

> <action application="set" data="import=vars,you,want,from,the,bleg" />
> <action application="bridge" data="..." />
> <!-- Vars defined in the import var will be copied back to the A-leg  
> -->
> <action application="bridge" data="..." />


_______________________________________________
Freeswitch-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: Variables from failed call to be exported to a a new B leg

mercutioviz
In reply to this post by mercutioviz
>
> to make sure that there is indeed a value and that it gets exported to
> the second b-leg try this:
> <action application="set" data="my_var=${nolocal:sip_hangup_phrase}"/>

oops, that set line should have been:
<action application="set" data="my_var=${sip_hangup_phrase}"/>
That "nolocal:" was extraneous from a lazy copy & paste

> <action application="export" data="my_var" />
>
> see if my_var is populated on the new b-leg.
> -MC
>

The most elegant solution is the one Brian gave:
<action application="set" data=""export_vars=sip_hangup_phrase"/>

So use it, please, and forget what I wrote. :)
-MC

_______________________________________________
Freeswitch-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: Variables from failed call to be exported to a a new B leg

Brian West
You can use nolocal: with export.  Just not set.

/b

On Feb 26, 2009, at 4:03 PM, Michael Collins wrote:

> That "nolocal:" was extraneous from a lazy copy & paste


_______________________________________________
Freeswitch-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: Variables from failed call to be exported to a a new B leg

Anthony Minessale
In reply to this post by mercutioviz
set the var failed_xml_cdr_prefix=foo before you call bridge
and the failed calls will have a complete xml cdr saved in foo_X where X is an incrementing number from 1 upwards.



On Thu, Feb 26, 2009 at 4:03 PM, Michael Collins <[hidden email]> wrote:
>
> to make sure that there is indeed a value and that it gets exported to
> the second b-leg try this:
> <action application="set" data="my_var=${nolocal:sip_hangup_phrase}"/>

oops, that set line should have been:
<action application="set" data="my_var=${sip_hangup_phrase}"/>
That "nolocal:" was extraneous from a lazy copy & paste

> <action application="export" data="my_var" />
>
> see if my_var is populated on the new b-leg.
> -MC
>

The most elegant solution is the one Brian gave:
<action application="set" data=""export_vars=sip_hangup_phrase"/>

So use it, please, and forget what I wrote. :)



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
[hidden email]
GTALK/JABBER/[hidden email]
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
[hidden email]
iax:guest@.../888
[hidden email]
pstn:213-799-1400

_______________________________________________
Freeswitch-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: Variables from failed call to be exported to a a new B leg

Tchavdar Paskov
In reply to this post by Brian West
Worked like charm.
Thanks everyone for your support.
Regards
Chav

----- Original Message -----
From: Brian West <[hidden email]>
Date: Thursday, February 26, 2009 1:47 pm
Subject: Re: [Freeswitch-users] Variables from failed call to be exported to a a new B leg
To: [hidden email]

> You then don't use the export command...  you set the
> variable <action 
> application="set" data=""export_vars=sip_hangup_phrase"/>
>
> /b
>
> On Feb 26, 2009, at 3:18 PM, Tchavdar Paskov wrote:
>
> > isn't this already done because of the info application
> called 
> > before ?
> > Chav
>
>
> _______________________________________________
> Freeswitch-users mailing list
> [hidden email]
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
_______________________________________________
Freeswitch-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: Variables from failed call to be exported to a a new B leg

Brian West
Don't run off so fast.  ;)  You should join us on IRC... I would like  
to see the IRC numbers over 200 soon ;)

/b

On Feb 27, 2009, at 4:27 PM, Tchavdar Paskov wrote:

> Worked like charm.
> Thanks everyone for your support.
> Regards
> Chav


_______________________________________________
Freeswitch-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: Variables from failed call to be exported to a a new B leg

Tchavdar Paskov
Just logging into IRC
Regards
Chav

----- Original Message -----
From: Brian West <[hidden email]>
Date: Friday, February 27, 2009 2:31 pm
Subject: Re: [Freeswitch-users] Variables from failed call to be exported to a a new B leg
To: [hidden email]

> Don't run off so fast.  ;)  You should join us on
> IRC... I would like 
> to see the IRC numbers over 200 soon ;)
>
> /b
>
> On Feb 27, 2009, at 4:27 PM, Tchavdar Paskov wrote:
>
> > Worked like charm.
> > Thanks everyone for your support.
> > Regards
> > Chav
>
>
> _______________________________________________
> Freeswitch-users mailing list
> [hidden email]
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
_______________________________________________
Freeswitch-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org