[Freeswitch-users] Bandwidth Dialplan for inbound calls

James Mortensen james.mortensen at synclio.com
Tue Sep 17 01:28:31 MSD 2013


Hello,

I've gone through the dialplan documentation several times and am having
trouble getting inbound calls from the PSTN to land on my extension 1000.
 I've followed the example here as best I can, but what I'm seeing are 482
Request Merged and Bandwidth continuing to hammer the server with INVITE
after INVITE.

I've verified the firewall is open and can make outbound calls and calls
between two Chrome browsers, but seem to have trouble setting up the
dialplan for PSTN to Chrome.

sip_profiles/external/bandwidth.com.xml:

<include>
   <gateway name="bandwidth.com">
     <param name="username" value="your user name"/>
     <param name="password" value="your password"/>
     <param name="from-user" value="fromuser"/>
     <param name="from-domain" value="67.X.X.X"/>
     <param name="proxy" value="67.X.X.X"/>
     <param name="expire-seconds" value="600"/>
     <param name="register" value="false"/>
     <param name="retry_seconds" value="30"/>
     <param name="extension" value=""/>
     <param name="context" value="public"/>
     <param name="avp" value="true"/>
   </gateway>
</include>


/dialplan/public/bandwidth.com.xml:

The way I understand this is that I match the number **being called in the
public context** and then that is transferred to the default context.  The
number I'm calling is 503389xxxx and in my INVITE it shows as +1503389xxxx.
 I've tried matching the destination number as XXXxxxxxxx, 503389xxxx, and
\+1(5033896xxx) but I get the same result every time. Can someone please
explain how to tell which extension context my calls are going through?
Putting the console in DEBUG mode doesn't show me how these patterns are
being matched...

<include>
  <extension name="bandwidth.com inbound">
    <condition field="context" data="public"/>
    <!-- The following line detects the e164 format on incoming calls -->
    <!-- Note: The leading '+' needs to be escaped by adding a '\' before
it -->
    <condition field="destination_number" expression="^(XXXxxxxxxx)$">
      <action application="set" data="domain_name=$${domain}"/>
      <action application="transfer" data="$1 XML default"/>
    </condition>
  </extension>

</include>


/dialplan/default/bandwidth.com.xml:

In the default context, you first see my outbound config, which works like
a charm. But the second block, taken from Example 9 in the documentation,
is something I don't quite understand. I'm pattern matching a 10 digit
number, which is what I'm calling... I've tried matching this to
XXXxxxxxxx, 503389xxxx and \+1503389xxxx with no change....

<include>
<extension name="bandwidth.com Outbound 9.10d">
   <!-- The following line detects outbound calls with a 9 as a dropped
prefix -->
   <!-- The line after changes the 10 digit number into 11 digit with a
leading '+' -->
   <condition field="destination_number" expression="^9(\d{10})$">
       <action application="bridge" data="sofia/gateway/bandwidth.com/+1$1
"/>
   </condition>
</extension>

   <!--
http://wiki.freeswitch.org/wiki/Dialplan_XML#Example_9:_Routing_DID_to_an_extension-->
     <extension name="Local_Extensioi2">
     <condition field="destination_number" expression="^(XXXxxxxxxx)$">
       <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/1000@$${domain}"/>
       <anti-action application="answer"/>
       <anti-action application="sleep" data="1000"/>
       <anti-action application="voicemail" data="default $${domain}
${dialed_ext}"/>
     </condition>
   </extension>
</include>


In the logs, I just see looping over and over and over again.  Why is it
using "internal" instead of "external"?  Why is it showing my 971 callerid
and not the number I dialed?  Where is the part of the logs that show all
of the Rexex patterns being parsed to determine what context to use?

freeswitch at ip-10-166-245-111> 2013-09-16 19:40:59.695046 [NOTICE]
switch_channel.c:1030 New Channel
sofia/internal/+1971238yyyy at 67.231.1.115[1902fee8-f2d9-4678-b841-bf59948c4937]

2013-09-16 19:40:59.695046 [DEBUG] switch_core_session.c:1006 Send signal
sofia/internal/+1971238yyyy at 67.231.1.115 [BREAK]

2013-09-16 19:40:59.695046 [DEBUG] switch_core_session.c:1006 Send signal
sofia/internal/+1971238yyyy at 67.231.1.115 [BREAK]

2013-09-16 19:40:59.695046 [DEBUG] switch_core_state_machine.c:418
(sofia/internal/+1971238yyyy at 67.231.1.115) Running State Change CS_NEW

2013-09-16 19:40:59.695046 [DEBUG] switch_core_state_machine.c:436
(sofia/internal/+1971238yyyy at 67.231.1.115) State NEW

2013-09-16 19:40:59.715055 [DEBUG] sofia.c:8003 IP 67.231.4.195 Rejected by
acl "domains". Falling back to Digest auth.

2013-09-16 19:40:59.715055 [DEBUG] switch_core_session.c:1006 Send signal
sofia/internal/+1971238yyyy at 67.231.1.115 [BREAK]

2013-09-16 19:40:59.715055 [DEBUG] sofia.c:1787 detaching session
1902fee8-f2d9-4678-b841-bf59948c4937

2013-09-16 19:41:00.055048 [NOTICE] switch_channel.c:1030 New Channel
sofia/internal/+1971238yyyy at 67.231.9.59[3295c812-2f36-4d31-8cd4-ef9bbd5cdbdb]

2013-09-16 19:41:00.055048 [DEBUG] switch_core_session.c:1006 Send signal
sofia/internal/+1971238yyyy at 67.231.9.59 [BREAK]

2013-09-16 19:41:00.055048 [DEBUG] switch_core_session.c:1006 Send signal
sofia/internal/+1971238yyyy at 67.231.9.59 [BREAK]

2013-09-16 19:41:00.055048 [DEBUG] switch_core_state_machine.c:418
(sofia/internal/+1971238yyyy at 67.231.9.59) Running State Change CS_NEW

2013-09-16 19:41:00.055048 [DEBUG] switch_core_state_machine.c:436
(sofia/internal/+1971238yyyy at 67.231.9.59) State NEW

2013-09-16 19:41:00.075081 [DEBUG] sofia.c:8003 IP 67.231.4.195 Rejected by
acl "domains". Falling back to Digest auth.

2013-09-16 19:41:00.075081 [DEBUG] switch_core_session.c:1006 Send signal
sofia/internal/+1971238yyyy at 67.231.9.59 [BREAK]

2013-09-16 19:41:00.075081 [DEBUG] sofia.c:1787 detaching session
3295c812-2f36-4d31-8cd4-ef9bbd5cdbdb

I've poured through the dialplan docs and examples, but I really believe I
could benefit from some explanation based on the problems I'm facing, which
I'm sure is just me missing some key piece of insight.

Oh I also just commented out the acl lines in both internal and
external.xml, which removed the acl warnings, but things still loop.

Thank you!

James Mortensen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130916/df5d44d2/attachment-0001.html 


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