Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] how to set different action for different cause code


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
woodydickson at gmail.com
Guest





PostPosted: Sun Aug 16, 2009 6:33 am    Post subject: [Freeswitch-users] how to set different action for different Reply with quote

Hello,
 
I find hangup_hook, but I would like to define different actions for different hangup codes.  Is there anyway to do that?
 
Woody
Back to top
msc at freeswitch.org
Guest





PostPosted: Mon Aug 17, 2009 11:10 am    Post subject: [Freeswitch-users] how to set different action for different Reply with quote

On Sun, Aug 16, 2009 at 4:24 AM, Woody Dickson <woodydickson@gmail.com (woodydickson@gmail.com)> wrote:
Quote:
Hello,
 
I find hangup_hook, but I would like to define different actions for different hangup codes.  Is there anyway to do that?
 

I can think of at least two ways you could do this: one that uses only the dialplan and one that uses a script. If you don't mind using a scripting language then you can make it very clean:

<action application="set" data="api_hangup_hook=luarun chancleanup.lua ${hangup_cause}"/>

Then have your Lua script handle all the if-then-else or case stuff.

Question: are you trying to transfer the a-leg to some other destination if the b-leg hangup is a specific cause, or are you just doing some external cleanup stuff? Just curious...

-MC
 

Quote:

Woody

_______________________________________________
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

Back to top
woodydickson at gmail.com
Guest





PostPosted: Tue Aug 18, 2009 11:31 am    Post subject: [Freeswitch-users] how to set different action for different Reply with quote

Hi,

I have my dialplan to do some simple routing. What I need to do is when certain hangup code is received, route advance to the next or the route after next based on the hangup code received.

So, I have:

<condition>
   <action application="set" data="hangup_after_bridge=true"/>
   <action application="set" data="continue_on_fail="false"/>
   <action application="bridge" data="sofia/internal/aaa@123.3.3./>
   <action application="bridge" data="sofia/internal/bbb@123.3.3./>
   <action application="bridge" data="sofia/internal/ccc@123.3.3./>
   <action application="bridge" data="sofia/internal/ddd@123.3.3./>

</condition>

What I want to do is that based on the error code received from ( bridge to aaa), it can route to either bbb or ccc depends on the hangup code received from aaa.

So there anyway to do it in the dialplan without any scripting?

thannks,
woody




On Mon, Aug 17, 2009 at 11:59 PM, Michael Collins <msc@freeswitch.org (msc@freeswitch.org)> wrote:
Quote:


On Sun, Aug 16, 2009 at 4:24 AM, Woody Dickson <woodydickson@gmail.com (woodydickson@gmail.com)> wrote:
Quote:
Hello,
 
I find hangup_hook, but I would like to define different actions for different hangup codes.  Is there anyway to do that?
 


I can think of at least two ways you could do this: one that uses only the dialplan and one that uses a script. If you don't mind using a scripting language then you can make it very clean:

<action application="set" data="api_hangup_hook=luarun chancleanup.lua ${hangup_cause}"/>

Then have your Lua script handle all the if-then-else or case stuff.

Question: are you trying to transfer the a-leg to some other destination if the b-leg hangup is a specific cause, or are you just doing some external cleanup stuff? Just curious...

-MC
 

Quote:

Woody

_______________________________________________
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




_______________________________________________
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

Back to top
msc at freeswitch.org
Guest





PostPosted: Wed Aug 19, 2009 11:43 am    Post subject: [Freeswitch-users] how to set different action for different Reply with quote

On Tue, Aug 18, 2009 at 9:23 AM, Woody Dickson <woodydickson@gmail.com (woodydickson@gmail.com)> wrote:
Quote:
Hi,

I have my dialplan to do some simple routing. What I need to do is when certain hangup code is received, route advance to the next or the route after next based on the hangup code received.

So, I have:

<condition>
   <action application="set" data="hangup_after_bridge=true"/>
   <action application="set" data="continue_on_fail="false"/>
   <action application="bridge" data="sofia/internal/aaa@123.3.3./>
   <action application="bridge" data="sofia/internal/bbb@123.3.3./>
   <action application="bridge" data="sofia/internal/ccc@123.3.3./>
   <action application="bridge" data="sofia/internal/ddd@123.3.3./>

</condition>

What I want to do is that based on the error code received from ( bridge to aaa), it can route to either bbb or ccc depends on the hangup code received from aaa.

So there anyway to do it in the dialplan without any scripting?

Yes, you can use the result of the previous bridge to execute a transfer. You'd need to use the hangup cause as the transfer destination, or part of the destination. For example, you could try something like this:

   <action application="set" data="hangup_after_bridge=true"/>
   <action application="set" data="continue_on_fail="false"/>
   <action application="bridge" data="sofia/internal/aaa@123.3.3./>
   <action application="transfer" data="${hangup_cause}_AAA XML default"/>
...

And then have an extension for each of the various hangup_causes
<extension name="normal clearing">
  <condition field="destination_number" expression="^(normal_clearing_AAA)$">
    <!-- Do whatever you want for "normal clearing" bridged calls -->
  </condition>
</extension>

<extension name="user busy">
  <condition field="destination_number" expression="^(user_busy_AAA)$">
    <!-- Do whatever you want for "user busy" bridged calls -->
  </condition>
</extension>

<extension name="no answer">
  <condition field="destination_number" expression="^(no_answer_AAA)$">
    <!-- Do whatever you want for "no answer" bridged calls -->
  </condition>
</extension>
 
Etc., etc.

I don't claim it's pretty, but it would let you avoid the use of scripting languages. However, I would caution you to examine just why you want/need to avoid scripting langs. The dp-only method may indeed be best for you, or perhaps using mod_xml_curl would be better. It does depend on your specific needs and your environment.

-MC


Quote:


thannks,
woody





On Mon, Aug 17, 2009 at 11:59 PM, Michael Collins <msc@freeswitch.org (msc@freeswitch.org)> wrote:
Quote:


On Sun, Aug 16, 2009 at 4:24 AM, Woody Dickson <woodydickson@gmail.com (woodydickson@gmail.com)> wrote:
Quote:
Hello,
 
I find hangup_hook, but I would like to define different actions for different hangup codes.  Is there anyway to do that?
 


I can think of at least two ways you could do this: one that uses only the dialplan and one that uses a script. If you don't mind using a scripting language then you can make it very clean:

<action application="set" data="api_hangup_hook=luarun chancleanup.lua ${hangup_cause}"/>

Then have your Lua script handle all the if-then-else or case stuff.

Question: are you trying to transfer the a-leg to some other destination if the b-leg hangup is a specific cause, or are you just doing some external cleanup stuff? Just curious...

-MC
 

Quote:

Woody

_______________________________________________
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




_______________________________________________
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






_______________________________________________
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

Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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

VoiceMeUp - Corporate & Wholesale VoIP Services