Three things… debug mode is a beautiful thing.

 

First, my mistake:

I had set my trunk (peer) user & friendly name to ‘main’. 

I modified these on my SIP provider portal, called my DID, and I was able to pass the dial plan step.  

For this example say my DID is 3213214321.

 

[DEBUG] mod_dialplan_xml.c:107 parse_exten() test conditions destination_number(main) =~ /^(3213214321)$/

where DID is my SIP provider number. 

 

Second, I added this to: conf/dialplan/public.xml

     <extension name="test_did">

       <condition field="destination_number" expression="^(3213214321)$">

         <action application="transfer" data="$1 XML default"/>

       </condition>

     </extension>

 

Modified to transfer to 1000 instead of $1 (my SIP endpoint conf/directory/default/1000.xml), else I would have had to change my user id.

All depend how you want to organize endpoints. 

     <extension name="test_did">

       <condition field="destination_number" expression="^(3213214321)$">

         <action application="transfer" data="1000 XML default"/>

       </condition>

     </extension>

 

Third, I added this to: conf/dialplan/default.xml

 

   <!-- Inbound calls handled first - You will want to configure one or            -->

   <!-- more of these depending upon the ways in which you can receive calls       -->

   <!-- If you have a number of similar DID's and they get the same call treatment -->

   <!-- you may want to use Regex pattern matching instead of a hard coded number  -->

   <extension name="Inbound-3213214321">

    <!-- EDIT: change the DID to your inbound DID (DN) number     -->

    <!--       Note - you can use regx pattern matching if needed -->

    <condition field="destination_number" expression="^3213214321$">

     <!-- If you are going to ring multiple extensions you should send back -->

     <!-- a 180 ringing message to the provider.                            -->

     <action application="ringback" />

 

     <!-- Set the maximum amount of time you want to ring the extensions (seconds) -->

     <action application="set" data="call_timeout=20"/>

 

     <!-- Sample: Bridge the call to 100, 101, 102, 103, 104 and 105 extensions. If you                 -->

     <!-- do not have 5 extensions configured you can remove the extra ones or just leave               -->

     <!-- them in... it will not cause a problem... just extra log messages.                            -->

     <!-- Note: use "," between extensions to dial at the same time and "|" to dial sequentially.       -->

     <!-- Note: No spaces can exist in the data string data="sofia/sip/100%${...},sofia/sip/101%${...}  -->

     <!-- EDIT: You will also need to change the IP (or domain name) in the URI to that of your server. -->

     <action application="bridge" data="sofia/sip/1000%$${domain}"/>

     <!-- No one answered so launch the answering machine application -->

     <action application="javascript" data="/usr/local/freeswitch/scripts/pizza.js"/>

     <!-- Sample single extension bridge -->

     <!--action application="bridge" data="sofia/sip/1000%$${domain}"/-->

    </condition>

   </extension>

 

 

Thanks,

Roberto

 


From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Ilan Perez
Sent: Monday, August 04, 2008 6:14 PM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] inbound calls

 

What did you do?

 

 

Ilan Perez

 

From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Roberto Hernandez
Sent: 05 August 2008 08:53
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] inbound calls

 

Figured it out. 

 

Thanks,

Roberto

 


From: Roberto Hernandez [mailto:rh@bluevisor.com]
Sent: Monday, August 04, 2008 11:01 AM
To: 'freeswitch-users@lists.freeswitch.org'
Subject: inbound calls

 

I’ve configured one X-Lite softphone (id=1000) and made my first few PSTN outbound calls with no problem. 

Inbound is a bit of a mystery.  How do I configure PSTN inbound calls to terminated on my softphone?   

 

I found the following archived email, would someone break it down so new users can understand?  Thanks in advance.

 

In public.xml, you want something like this:

 

     <extension name="test_did">

       <condition field="destination_number" expression="^(4153084258)$">

         <action application="transfer" data="$1 XML default"/>

       </condition>

     </extension>

 

and then in default.xml have something like this in the default context:

 

<extension name="Local_Extension">

       <condition field="destination_number" expression="^(4153084258)$" continue="on-true">

         <action application="set" data="dialed_ext=$1"/>

       </condition>

       <condition field="destination_number" expression="^${caller_id_number}$">

         <action application="set" data="voicemail_authorized=${sip_authorized}"/>

         <action application="answer"/>

         <action application="sleep" data="1000"/>

         <action application="voicemail" data="check default $${domain} ${dialed_ ext}"/>

         <anti-action application="ring_ready"/>

         <anti-action application="set" data="call_timeout=10"/>

         <anti-action application="set" data="hangup_after_bridge=true"/>

         <anti-action application="set" data="continue_on_fail=true"/>

         <anti-action application="bridge" data="USER/${dialed_ext}@$${domain}"/>

         <anti-action application="answer"/>

         <anti-action application="sleep" data="1000"/>

         <anti-action application="voicemail" data="default $${domain} ${dialed_e xt}"/>

       </condition>

     </extension>

 

Thanks,

Roberto