[Freeswitch-users] Unable to receive calls from external sources.

Rocky Hetherington rocky at hetherington.co.uk
Tue Aug 12 11:10:59 PDT 2008


Shortly after posting my original message it suddenly dawned on me
that my soft-client might be attempting to dial into my server using
port 5060 which i recalled was used, by default, for users in the
default context, not the public.  Tacking :5080 onto the end of the
SIP URI i was dialing gave me a whole different set of errors.  After
reading through the log messages and trying out some different
configuration i managed to get the basics working (accepting a call
from an external domain and passing it through to an internal user or
directing to voicemail if user isn't online).

I'll post my config here incase anyone else ever has this particular problem.

conf/directory/default/bert.xml:

<include>
 <user id="bert" mailbox="2378">
   <params>
     <param name="password" value="password"/>
     <param name="vm-password" value="1000"/>
   </params>
   <variables>
     <variable name="accountcode" value="2378"/>
     <variable name="user_context" value="default"/>
     <variable name="effective_caller_id_name" value="Bert"/>
     <variable name="effective_caller_id_number" value="2378"/>
   </variables>
 </user>
</include>

Added to conf/dialplan/public.xml:

    <extension name="bert">
      <condition field="destination_number" expression="^(bert|2378)$">
        <action application="transfer" data="bert XML default"/>
      </condition>
    </extension>

Create the file conf/dialplan/extensions/bert.xml:

<include>
  <extension name="bert">

      <condition field="destination_number" expression="^(bert|2378)$">
        <action application="set" data="dialed_ext=$1"/>
        <action application="export" 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}"/>
        <!-- bind_meta_app can have these args <key> [a|b|ab]
[a|b|o|s] <app> -->
        <anti-action application="bind_meta_app" data="1 b s
execute_extension::dx XML features"/>
        <anti-action application="bind_meta_app" data="2 b s
record_session::$${base_dir}/recordings/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
        <anti-action application="bind_meta_app" data="3 b s
execute_extension::cf XML features"/>
        <anti-action application="set" data="transfer_ringback=${uk-ring}"/>
        <anti-action application="set" data="call_timeout=30"/>
        <!-- <anti-action application="set"
data="sip_exclude_contact=${network_addr}"/> -->
        <anti-action application="set" data="hangup_after_bridge=true"/>
        <!--<anti-action application="set"
data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,TIMEOUT,NO_ROUTE_DESTINATION"/>
-->
        <anti-action application="set" data="continue_on_fail=true"/>
        <anti-action application="db"
data="insert/call_return/${dialed_ext}/${caller_id_number}"/>
        <anti-action application="db"
data="insert/last_dial_ext/${dialed_ext}/${uuid}"/>
        <anti-action application="bridge" data="user/${dialed_ext}@$${domain}"/>
        <anti-action application="answer"/>
        <!--<anti-action application="send_display" data="Voicemail
for ${dialed_ext}"/>-->
        <anti-action application="sleep" data="1000"/>
        <anti-action application="voicemail" data="default $${domain}
${dialed_ext}"/>
      </condition>

  </extension>
</include>

This seems to work well, although the IVR before leaving a vm seems a
bit choppy (perhaps due to being on a Xen VPS?).  The only question i
still have regarding this bit is whether it would be better to switch
the ports around so that FreeSWITCH accepts calls from external
domains on port 5060 and registrations within the default context on
port 5080 or do the majority of SIP servers look up and adhere to
what's specified in a domain's SRV records?




More information about the FreeSWITCH-users mailing list