<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'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'm assuming the FreeSWITCH team has some logical reason for using ports 5080 instead of 5060, but I'm still not 100% sure I understand that part. All I know is it works.</div>
<div><br></div><div>I'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'm thinking that's probably the safer thing to do.</div>
<div><br></div><div>Since I'm new to FreeSWITCH, I'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'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'm hoping the confusion I faced here will help others get through this, and if there's a way I can get an account on the FreeSWITCH wiki, I'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"><<a href="mailto:james.mortensen@synclio.com" target="_blank">james.mortensen@synclio.com</a>></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'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.</div>
<div><br></div><div>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.</div><div><br></div><div>
sip_profiles/external/bandwidth.com.xml:<br>
</div><div><br></div><div><div><include></div><div> <gateway name="<a href="http://bandwidth.com" target="_blank">bandwidth.com</a>"></div><div> <param name="username" value="your user name"/></div>
<div> <param name="password" value="your password"/></div><div> <param name="from-user" value="fromuser"/></div><div> <param name="from-domain" value="67.X.X.X"/></div>
<div> <param name="proxy" value="67.X.X.X"/></div><div> <param name="expire-seconds" value="600"/></div><div> <param name="register" value="false"/></div>
<div> <param name="retry_seconds" value="30"/></div><div> <param name="extension" value=""/></div><div> <param name="context" value="public"/></div>
<div> <param name="avp" value="true"/></div><div> </gateway></div><div></include></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'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...</div>
<div><br></div><div><div><include></div><div> <extension name="<a href="http://bandwidth.com" target="_blank">bandwidth.com</a> inbound"></div><div> <condition field="context" data="public"/></div>
<div> <!-- The following line detects the e164 format on incoming calls --></div><div> <!-- Note: The leading '+' needs to be escaped by adding a '\' before it --></div><div> <condition field="destination_number" expression="^(XXXxxxxxxx)$"></div>
<div> <action application="set" data="domain_name=$${domain}"/></div><div> <action application="transfer" data="$1 XML default"/></div><div> </condition></div>
<div> </extension></div><div><br></div><div></include></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'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....</div>
<div><br></div><div><div><include></div><div><extension name="<a href="http://bandwidth.com" target="_blank">bandwidth.com</a> Outbound 9.10d"></div><div> <!-- The following line detects outbound calls with a 9 as a dropped prefix --></div>
<div> <!-- The line after changes the 10 digit number into 11 digit with a leading '+' --></div><div> <condition field="destination_number" expression="^9(\d{10})$"></div><div>
<action application="bridge" data="sofia/gateway/<a href="http://bandwidth.com/+1$1" target="_blank">bandwidth.com/+1$1</a>"/></div>
<div> </condition></div><div></extension></div><div><br></div><div> <!-- <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> --></div>
<div> <extension name="Local_Extensioi2"></div><div> <condition field="destination_number" expression="^(XXXxxxxxxx)$"></div><div> <action application="set" data="dialed_ext=$1"/></div>
<div> </condition></div><div> <condition field="destination_number" expression="^${caller_id_number}$"></div><div> <action application="set" data="voicemail_authorized=${sip_authorized}"/></div>
<div> <action application="answer"/></div><div> <action application="sleep" data="1000"/></div><div> <action application="voicemail" data="check default $${domain} ${dialed_ext}"/></div>
<div> <anti-action application="ring_ready"/></div><div> <anti-action application="set" data="call_timeout=10"/></div><div> <anti-action application="set" data="hangup_after_bridge=true"/></div>
<div> <anti-action application="set" data="continue_on_fail=true"/></div><div> <anti-action application="bridge" data="USER/1000@$${domain}"/></div><div> <anti-action application="answer"/></div>
<div> <anti-action application="sleep" data="1000"/></div><div> <anti-action application="voicemail" data="default $${domain} ${dialed_ext}"/></div><div> </condition></div>
<div> </extension></div><div></include></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 "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? </div>
<div><br></div><div>
<p>freeswitch@ip-10-166-245-111> 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 "domains". 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 "domains". 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'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.</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>