[Freeswitch-users] Multiple contexts per sip profile

Grant Bagdasarian GB at cm.nl
Wed Oct 9 14:58:04 MSD 2013


When setting the transfer_on_fail variable, does this only apply when bridging the call?
The call hangs up immediately when transferring to another context fails.

Is it possible to recover from a failed transfer?

<?xml version="1.0" encoding="utf-8"?>
<include>
  <X-PRE-PROCESS cmd="include" data="inbound/*.xml"/>
  <context name="inbound">
    <extension name="route_to_context">
      <condition field="destination_number" expression="^(\d+)$">
        <action application="set" data="continue_on_fail=true"/>
        <action application="set" data="transfer_on_fail=NO_ROUTE_DESTINATION context_not_found XML inbound"/>
        <action application="transfer" data="start XML $1"/>
      </condition>
    </extension>

   <extension name="context_not_found" continue="true">
      <condition field="destination_number" expression="^(.+)$">
        <action application="playback" data="/usr/src/freeswitch/sounds/fs-invalid-number.wav"/>
      </condition>
    </extension>

  </context>
</include>

2013-10-09 12:47:45.543748 [NOTICE] switch_ivr.c:1831 Transfer sofia/inbound/31700000000 at 192.168.1.10:5060 to XML[start at 1002]
2013-10-09 12:47:45.543748 [DEBUG] switch_core_state_machine.c:480 (sofia/inbound/31700000000 at 192.168.1.10:5060) State EXECUTE going to sleep
2013-10-09 12:47:45.543748 [DEBUG] switch_core_state_machine.c:418 (sofia/inbound/31700000000 at 192.168.1.10:5060) Running State Change CS_ROUTING
2013-10-09 12:47:45.543748 [DEBUG] switch_core_state_machine.c:473 (sofia/inbound/31700000000 at 192.168.1.10:5060) State ROUTING
2013-10-09 12:47:45.543748 [DEBUG] mod_sofia.c:137 sofia/inbound/31700000000 at 192.168.1.10:5060 SOFIA ROUTING
2013-10-09 12:47:45.543748 [DEBUG] switch_core_state_machine.c:117 sofia/inbound/31700000000 at 192.168.1.10:5060 Standard ROUTING
2013-10-09 12:47:45.543748 [INFO] mod_dialplan_xml.c:558 Processing 31700000000 <31700000000>->start in context 1002
2013-10-09 12:47:45.543748 [WARNING] mod_dialplan_xml.c:588 Context 1002 not found
2013-10-09 12:47:45.543748 [INFO] switch_core_state_machine.c:192 No Route, Aborting
2013-10-09 12:47:45.543748 [NOTICE] switch_core_state_machine.c:193 Hangup sofia/inbound/31700000000 at 192.168.1.10:5060 [CS_ROUTING] [NO_ROUTE_DESTINATION]

From: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Grant Bagdasarian
Sent: Wednesday, October 9, 2013 11:52 AM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] Multiple contexts per sip profile

Ahhhh, right!

Thank you, that worked!

From: freeswitch-users-bounces at lists.freeswitch.org<mailto:freeswitch-users-bounces at lists.freeswitch.org> [mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Andrew Cassidy
Sent: Wednesday, October 9, 2013 11:38 AM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] Multiple contexts per sip profile

Move the include outside of the context definition as shown below. You were creating contexts within a context which I'm not sure is possible.

dialplan/inbound.xml:

<?xml version="1.0" encoding="utf-8"?>
<include>
<X-PRE-PROCESS cmd="include" data="inbound/*.xml"/>
  <context name="inbound">


    <extension name="route_to_context">
      <condition field="destination_number" expression="^(\d+)$">
        <action application="transfer" data="start XML $1"/>
      </condition>
    </extension>

  </context>
</include>


On 9 October 2013 09:29, Grant Bagdasarian <GB at cm.nl<mailto:GB at cm.nl>> wrote:
Isn't it possible to load more than one context?

When entering the initial inbound context. It should be possible to transfer to another, shouldn't it?


From: freeswitch-users-bounces at lists.freeswitch.org<mailto:freeswitch-users-bounces at lists.freeswitch.org> [mailto:freeswitch-users-bounces at lists.freeswitch.org<mailto:freeswitch-users-bounces at lists.freeswitch.org>] On Behalf Of Lloyd Aloysius
Sent: Tuesday, October 8, 2013 5:00 PM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] Multiple contexts per sip profile

Please have a look into here

http://wiki.freeswitch.org/wiki/Multi-tenant

Lloyd


On Tue, Oct 8, 2013 at 10:51 AM, Grant Bagdasarian <GB at cm.nl<mailto:GB at cm.nl>> wrote:
Hello,

I'm trying to configure FreeSWITCH to have multiple contexts per sip profile like below.

But this does not seem to work.
The reason I want this, is to have each incoming called number to have its own context in which extensions can be created.
The problem with using extensions and only one context is I can't defined more than one extension with the same name. FS seems to overwrite or ignore ones that do.

Is this even possible? If so, what do I need to change? Is there perhaps a better way for doing this?

sip_profile/inbound.xml:

<profile name="inbound">

  <settings>

    <param name="context" value="inbound"/>
    <param name="dialplan" value="XML"/>

  </settings>
</profile>

dialplan/inbound.xml:

<?xml version="1.0" encoding="utf-8"?>
<include>
  <context name="inbound">
   <X-PRE-PROCESS cmd="include" data="inbound/*.xml"/>

    <extension name="route_to_context">
      <condition field="destination_number" expression="^(\d+)$">
        <action application="transfer" data="start XML $1"/>
      </condition>
    </extension>

  </context>
</include>

dialplan/inbound/1000.xml:

<include>

  <context name="1000">

    <extension name="start">
      <condition field="destination_number" expression="^(\d+)">
        <action application="answer"/>
        <action application="transfer" data="playback"/>
      </condition>
    </extension>


    <extension name="playback">
      <condition>
        <action application="playback" data="/usr/src/freeswitch/sounds/fs-hello-world-for-1000.wav"/>
      </condition>
    </extension>

  </context>
</include>

dialplan/inbound/1001.xml:

<include>

  <context name="1001">

    <extension name="start">
      <condition field="destination_number" expression="^(\d+)">
        <action application="answer"/>
        <action application="transfer" data="playback"/>
      </condition>
    </extension>


    <extension name="playback">
      <condition>
        <action application="playback" data="/usr/src/freeswitch/sounds/fs-hello-world-for-1001.wav"/>
      </condition>
    </extension>

  </context>
</include>





_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org<mailto:consulting at freeswitch.org>
http://www.freeswitchsolutions.com




Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at 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 at freeswitch.org<mailto:consulting at freeswitch.org>
http://www.freeswitchsolutions.com




Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



--
Andrew Cassidy BSc (Hons) MBCS SSCA
Managing Director
[cid:image001.jpg at 01CEC4EF.312306D0]

T<mailto:info at cassidywebservices.co.uk> 03300 100 960  F<mailto:info at cassidywebservices.co.uk> 03300 100 961
E<mailto:info at cassidywebservices.co.uk> andrew at cassidywebservices.co.uk<mailto:andrew at cassidywebservices.co.uk>
W<mailto:info at cassidywebservices.co.uk> www.cassidywebservices.co.uk<http://www.cassidywebservices.co.uk>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20131009/210c3578/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 823 bytes
Desc: image001.jpg
Url : http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20131009/210c3578/attachment-0001.jpg 


Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list