<div dir="ltr">I wanted to update this thread so that others may be helped by it.  I went into vars.xml and changed the external profile ports from 5080 and 5081 to 5060 and 5061.  I set the internal ports to 5070 and 5071. I don&#39;t believe internal are being used, but I may be wrong about that.<div>

<br></div><div>After making this change, I could get inbound calls from Bandwidth.com, make outbound calls through Bandwidth.com, and dial from extension 1000 to another peer at extension 1001.  This is Chrome to PSTN, PSTN to Chrome, and Chrome to Chrome!</div>

<div><br></div><div>I realize external profiles are for configuration like Bandwidth or other external entities, so I feel like I have that part setup, so my next step may be to configure Bandwidth so that the inbound calls terminate at port 5080 instead so I can put the ports back to their defaults. I&#39;m assuming the FreeSWITCH team has some logical reason for using ports 5080 instead of 5060, but I&#39;m still not 100% sure I understand that part. All I know is it works.</div>

<div><br></div><div>I&#39;ve read on the mailing list and other places that swapping the ports helped people, and one other person suggested putting the Bandwidth gateway configuration under internal instead, but since the wiki docs say to keep these gateway configurations in the external profile, I&#39;m thinking that&#39;s probably the safer thing to do.</div>

<div><br></div><div>Since I&#39;m new to FreeSWITCH, I&#39;m taking all the security stuff to heart to avoid toll fraud.  So I just tried dialing out using a user not listed in the configuration.  I got back a 403 Forbidden, so I&#39;m assuming that means anonymous dialing is protected and that things are configured correctly.....</div>

<div><br></div><div>Also, I registered with the default user and confirmed I cannot dial out through my gateway.  I also removed users 1000-1019 from the directory and changed the default password to something other than 1234, which is a nice Spaceballs reference by the way! :) Seems like things are good to go!  </div>

<div><br></div><div>I&#39;m hoping the confusion I faced here will help others get through this, and if there&#39;s a way I can get an account on the FreeSWITCH wiki, I&#39;m happy to help make some tweaks to the documentation to help others who may be confused, since my confusion is still fresh in my mind, and I know where the trouble spots are in the documentation! :)</div>

<div><br></div><div>Thanks for the help! </div><div><br></div><div>James Mortensen</div><div><br></div><div class="gmail_extra"><div><div dir="ltr"><div><br></div></div></div><br><div class="gmail_quote">On Mon, Sep 16, 2013 at 2:28 PM, James Mortensen <span dir="ltr">&lt;<a href="mailto:james.mortensen@synclio.com" target="_blank">james.mortensen@synclio.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>I&#39;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&#39;ve followed the example here as best I can, but what I&#39;m seeing are 482 Request Merged and Bandwidth continuing to hammer the server with INVITE after INVITE.</div>


<div><br></div><div>I&#39;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.</div><div><br></div><div>

sip_profiles/external/bandwidth.com.xml:<br>
</div><div><br></div><div><div>&lt;include&gt;</div><div>   &lt;gateway name=&quot;<a href="http://bandwidth.com" target="_blank">bandwidth.com</a>&quot;&gt;</div><div>     &lt;param name=&quot;username&quot; value=&quot;your user name&quot;/&gt;</div>


<div>     &lt;param name=&quot;password&quot; value=&quot;your password&quot;/&gt;</div><div>     &lt;param name=&quot;from-user&quot; value=&quot;fromuser&quot;/&gt;</div><div>     &lt;param name=&quot;from-domain&quot; value=&quot;67.X.X.X&quot;/&gt;</div>


<div>     &lt;param name=&quot;proxy&quot; value=&quot;67.X.X.X&quot;/&gt;</div><div>     &lt;param name=&quot;expire-seconds&quot; value=&quot;600&quot;/&gt;</div><div>     &lt;param name=&quot;register&quot; value=&quot;false&quot;/&gt;</div>


<div>     &lt;param name=&quot;retry_seconds&quot; value=&quot;30&quot;/&gt;</div><div>     &lt;param name=&quot;extension&quot; value=&quot;&quot;/&gt;</div><div>     &lt;param name=&quot;context&quot; value=&quot;public&quot;/&gt;</div>


<div>     &lt;param name=&quot;avp&quot; value=&quot;true&quot;/&gt;</div><div>   &lt;/gateway&gt;</div><div>&lt;/include&gt;</div></div><div><br></div><div><br></div><div>/dialplan/public/bandwidth.com.xml:</div><div><br>


</div><div>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&#39;m calling is 503389xxxx and in my INVITE it shows as +1503389xxxx.  I&#39;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&#39;t show me how these patterns are being matched...</div>


<div><br></div><div><div>&lt;include&gt;</div><div>  &lt;extension name=&quot;<a href="http://bandwidth.com" target="_blank">bandwidth.com</a> inbound&quot;&gt;</div><div>    &lt;condition field=&quot;context&quot; data=&quot;public&quot;/&gt;</div>


<div>    &lt;!-- The following line detects the e164 format on incoming calls --&gt;</div><div>    &lt;!-- Note: The leading &#39;+&#39; needs to be escaped by adding a &#39;\&#39; before it --&gt;</div><div>    &lt;condition field=&quot;destination_number&quot; expression=&quot;^(XXXxxxxxxx)$&quot;&gt;</div>


<div>      &lt;action application=&quot;set&quot; data=&quot;domain_name=$${domain}&quot;/&gt;</div><div>      &lt;action application=&quot;transfer&quot; data=&quot;$1 XML default&quot;/&gt;</div><div>    &lt;/condition&gt;</div>


<div>  &lt;/extension&gt;</div><div><br></div><div>&lt;/include&gt;</div></div><div><br></div><div><br></div><div>/dialplan/default/bandwidth.com.xml:</div><div><br></div><div>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&#39;t quite understand. I&#39;m pattern matching a 10 digit number, which is what I&#39;m calling... I&#39;ve tried matching this to XXXxxxxxxx, 503389xxxx and \+1503389xxxx with no change....</div>


<div><br></div><div><div>&lt;include&gt;</div><div>&lt;extension name=&quot;<a href="http://bandwidth.com" target="_blank">bandwidth.com</a> Outbound 9.10d&quot;&gt;</div><div>   &lt;!-- The following line detects outbound calls with a 9 as a dropped prefix --&gt;</div>


<div>   &lt;!-- The line after changes the 10 digit number into 11 digit with a leading &#39;+&#39; --&gt;</div><div>   &lt;condition field=&quot;destination_number&quot; expression=&quot;^9(\d{10})$&quot;&gt;</div><div>

       &lt;action application=&quot;bridge&quot; data=&quot;sofia/gateway/<a href="http://bandwidth.com/+1$1" target="_blank">bandwidth.com/+1$1</a>&quot;/&gt;</div>
<div>   &lt;/condition&gt;</div><div>&lt;/extension&gt;</div><div><br></div><div>   &lt;!-- <a href="http://wiki.freeswitch.org/wiki/Dialplan_XML#Example_9:_Routing_DID_to_an_extension" target="_blank">http://wiki.freeswitch.org/wiki/Dialplan_XML#Example_9:_Routing_DID_to_an_extension</a> --&gt;</div>


<div>     &lt;extension name=&quot;Local_Extensioi2&quot;&gt;</div><div>     &lt;condition field=&quot;destination_number&quot; expression=&quot;^(XXXxxxxxxx)$&quot;&gt;</div><div>       &lt;action application=&quot;set&quot; data=&quot;dialed_ext=$1&quot;/&gt;</div>


<div>     &lt;/condition&gt;</div><div>     &lt;condition field=&quot;destination_number&quot; expression=&quot;^${caller_id_number}$&quot;&gt;</div><div>       &lt;action application=&quot;set&quot; data=&quot;voicemail_authorized=${sip_authorized}&quot;/&gt;</div>


<div>       &lt;action application=&quot;answer&quot;/&gt;</div><div>       &lt;action application=&quot;sleep&quot; data=&quot;1000&quot;/&gt;</div><div>       &lt;action application=&quot;voicemail&quot; data=&quot;check default $${domain} ${dialed_ext}&quot;/&gt;</div>


<div>       &lt;anti-action application=&quot;ring_ready&quot;/&gt;</div><div>       &lt;anti-action application=&quot;set&quot; data=&quot;call_timeout=10&quot;/&gt;</div><div>       &lt;anti-action application=&quot;set&quot; data=&quot;hangup_after_bridge=true&quot;/&gt;</div>


<div>       &lt;anti-action application=&quot;set&quot; data=&quot;continue_on_fail=true&quot;/&gt;</div><div>       &lt;anti-action application=&quot;bridge&quot; data=&quot;USER/1000@$${domain}&quot;/&gt;</div><div>       &lt;anti-action application=&quot;answer&quot;/&gt;</div>


<div>       &lt;anti-action application=&quot;sleep&quot; data=&quot;1000&quot;/&gt;</div><div>       &lt;anti-action application=&quot;voicemail&quot; data=&quot;default $${domain} ${dialed_ext}&quot;/&gt;</div><div>     &lt;/condition&gt;</div>


<div>   &lt;/extension&gt;</div><div>&lt;/include&gt;</div><div>              </div></div><div><br></div><div>In the logs, I just see looping over and over and over again.  Why is it using &quot;internal&quot; instead of &quot;external&quot;?  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? </div>


<div><br></div><div>







<p>freeswitch@ip-10-166-245-111&gt; 2013-09-16 19:40:59.695046 [NOTICE] switch_channel.c:1030 New Channel sofia/internal/+<a href="mailto:1971238yyyy@67.231.1.115" target="_blank">1971238yyyy@67.231.1.115</a> [1902fee8-f2d9-4678-b841-bf59948c4937]</p>



<p>2013-09-16 19:40:59.695046 [DEBUG] switch_core_session.c:1006 Send signal sofia/internal/+<a href="mailto:1971238yyyy@67.231.1.115" target="_blank">1971238yyyy@67.231.1.115</a> [BREAK]</p>
<p>2013-09-16 19:40:59.695046 [DEBUG] switch_core_session.c:1006 Send signal sofia/internal/+<a href="mailto:1971238yyyy@67.231.1.115" target="_blank">1971238yyyy@67.231.1.115</a> [BREAK]</p>
<p>2013-09-16 19:40:59.695046 [DEBUG] switch_core_state_machine.c:418 (sofia/internal/+<a href="mailto:1971238yyyy@67.231.1.115" target="_blank">1971238yyyy@67.231.1.115</a>) Running State Change CS_NEW</p>
<p>2013-09-16 19:40:59.695046 [DEBUG] switch_core_state_machine.c:436 (sofia/internal/+<a href="mailto:1971238yyyy@67.231.1.115" target="_blank">1971238yyyy@67.231.1.115</a>) State NEW</p>
<p>2013-09-16 19:40:59.715055 [DEBUG] sofia.c:8003 IP 67.231.4.195 Rejected by acl &quot;domains&quot;. Falling back to Digest auth.</p>
<p>2013-09-16 19:40:59.715055 [DEBUG] switch_core_session.c:1006 Send signal sofia/internal/+<a href="mailto:1971238yyyy@67.231.1.115" target="_blank">1971238yyyy@67.231.1.115</a> [BREAK]</p>
<p>2013-09-16 19:40:59.715055 [DEBUG] sofia.c:1787 detaching session 1902fee8-f2d9-4678-b841-bf59948c4937</p>
<p>2013-09-16 19:41:00.055048 [NOTICE] switch_channel.c:1030 New Channel sofia/internal/+<a href="mailto:1971238yyyy@67.231.9.59" target="_blank">1971238yyyy@67.231.9.59</a> [3295c812-2f36-4d31-8cd4-ef9bbd5cdbdb]</p>
<p>2013-09-16 19:41:00.055048 [DEBUG] switch_core_session.c:1006 Send signal sofia/internal/+<a href="mailto:1971238yyyy@67.231.9.59" target="_blank">1971238yyyy@67.231.9.59</a> [BREAK]</p>
<p>2013-09-16 19:41:00.055048 [DEBUG] switch_core_session.c:1006 Send signal sofia/internal/+<a href="mailto:1971238yyyy@67.231.9.59" target="_blank">1971238yyyy@67.231.9.59</a> [BREAK]</p>
<p>2013-09-16 19:41:00.055048 [DEBUG] switch_core_state_machine.c:418 (sofia/internal/+<a href="mailto:1971238yyyy@67.231.9.59" target="_blank">1971238yyyy@67.231.9.59</a>) Running State Change CS_NEW</p>
<p>2013-09-16 19:41:00.055048 [DEBUG] switch_core_state_machine.c:436 (sofia/internal/+<a href="mailto:1971238yyyy@67.231.9.59" target="_blank">1971238yyyy@67.231.9.59</a>) State NEW</p>
<p>2013-09-16 19:41:00.075081 [DEBUG] sofia.c:8003 IP 67.231.4.195 Rejected by acl &quot;domains&quot;. Falling back to Digest auth.</p>
<p>2013-09-16 19:41:00.075081 [DEBUG] switch_core_session.c:1006 Send signal sofia/internal/+<a href="mailto:1971238yyyy@67.231.9.59" target="_blank">1971238yyyy@67.231.9.59</a> [BREAK]</p>
<p>2013-09-16 19:41:00.075081 [DEBUG] sofia.c:1787 detaching session 3295c812-2f36-4d31-8cd4-ef9bbd5cdbdb</p></div><div><br></div><div>I&#39;ve poured through the dialplan docs and examples, but I really believe I could benefit from some explanation based on the problems I&#39;m facing, which I&#39;m sure is just me missing some key piece of insight.</div>


<div><br></div><div>Oh I also just commented out the acl lines in both internal and external.xml, which removed the acl warnings, but things still loop.</div><div><br></div><div>Thank you!<span class="HOEnZb"><font color="#888888"><br clear="all">

<div><div dir="ltr">
<div><br></div><div>James Mortensen<br></div><div><br><div><br></div></div></div></div>
</font></span></div></div>
</blockquote></div><br></div></div>