Freeswitch – Softswitch, Softphone, PBX

I’ve somewhat been following the development of FreeSWITCH, described as a softswitch, although I see they’ve added PBX to the description now.

It’s still in beta, about to be released any day now(tm). It doesn’t have the features of asterisks out of the box, however, it’s extendable with javascript, perl, python, java, C of cause, and more. Its main advantage for me is its efficiency and stability, it’s able to handle 6000 simultaneous calls. 6000 calls isn’t that useful to me, but being able to use a lower powered box is

It’s a well run project, with lots of activity on IRC and the lists. I’ll attach a working PBX config below with a few softphones and a SIP gateway

In a previous post I recorded what steps I took to compile, install, and setup three softphones. Adding on to that.

My SIP gateway’s is mysip.com.au, my username is 612555555, and my password is password.

sofia.conf.xml looks like

<configuration name="sofia.conf" description="sofia Endpoint">
  <profiles>
    <profile name="$${sip_profile}">
      <aliases>
	<alias name="default"/>
      </aliases>
      <gateways>
      </gateways>
      <domains>
      </domains>
      <settings>
	<param name="debug" value="1"/>
	<param name="rfc2833-pt" value="101"/>
	<param name="sip-port" value="5060"/>
	<param name="dialplan" value="XML"/>
	<param name="dtmf-duration" value="100"/>
	<param name="codec-prefs" value="$${global_codec_prefs}"/>
	<param name="codec-ms" value="20"/>
	<param name="use-rtp-timer" value="true"/>
	<param name="rtp-timer-name" value="soft"/>
	<param name="rtp-ip" value="$${bind_server_ip}"/>
	<param name="sip-ip" value="$${bind_server_ip}"/>
	<param name="manage-presence" value="true"/>
	<param name="inbound-codec-negotiation" value="generous"/>
	<param name="accept-blind-reg" value="false"/>
	<param name="nonce-ttl" value="60"/>
	<param name="auth-calls" value="true"/>
      </settings>
    </profile>
    <profile name="mysip">
      <gateways>
        <gateway name="mysip.com.au">
          <param name="username" value="612555555"/>
          <param name="password" value="password"/>
          <param name="register" value="true"/>
        </gateway>
      </gateways>
      <domains>
      </domains>
      <settings>
        <param name="debug" value="1"/>
        <param name="rfc2833-pt" value="101"/>
        <param name="sip-port" value="5061"/>
        <param name="dialplan" value="XML"/>
        <param name="dtmf-duration" value="100"/>
        <param name="codec-prefs" value="$${global_codec_prefs}"/>
        <param name="codec-ms" value="20"/>
        <param name="use-rtp-timer" value="true"/>
        <param name="rtp-timer-name" value="soft"/>
        <param name="rtp-ip" value="$${bind_server_ip}"/>
        <param name="sip-ip" value="$${bind_server_ip}"/>
        <param name="inbound-codec-negotiation" value="generous"/>
        <param name="accept-blind-reg" value="false"/>
        <param name="nonce-ttl" value="60"/>
        <param name="ext-sip-ip" value="myswitch.dyndns.com"/>
      </settings>
    </profile>
  </profiles>
</configuration>

In my case, freeswitch is behind a NAT with a dynamic IP address. The internal phones will register on port 5060, and the gateway 5061.

The dailplan, default_context.xml looks like

<context name="default">
  <extension name="612555555">
    <condition field="destination_number" expression="^612555555$">
       <action application="set" data="call_timeout=18" />
       <action application="set" data="hangup_after_bridge=true" />
       <action application="set" data="continue_on_fail=true" />
       <action application="bridge" data="sofia/switch.mylan/100,sofia/mydomain.com/101,sofia/mydomain.com/102"/>
       <action application="javascript" data="answermachine.js" />
    </condition>
  </extension>
 <extension name="internal">
    <condition field="destination_number" expression="^(10\d)$">
      <action application="set" data="call_timeout=50" />
      <action application="set" data="hangup_after_bridge=true" />
      <action application="set" data="continue_on_fail=true" />
      <action application="bridge" data="sofia/${sip_profile}/$1" />
      <action application="javascript" data="answermachine.js" />
    </condition>
  </extension>
 <extension name="mysip">
    <condition field="${ruleset}" expression="internal" />
    <condition field="destination_number" expression="^(.*)">
      <action application="bridge" data="sofia/gateway/mysip.com.au/$1"/>
    </condition>
  </extension>
</context>

So basically, incoming calls from mysip will ring 100 and 101, 10[0-9] are internal numbers, any other number gets sent to myisp.

Related posts:

  1. Freeswitch on Ubuntu Feisty
  2. FreeSWITCH and Google Talk
  3. FreeSWITCH and Voicemail
  4. Latest FreeSWITCH, PennyTel and Billion 5200N development
  5. FreeSWITCH – Google Talk – Dingaling – Jingle All The Way

One Comment

  1. Gab
    Posted December 3, 2008 at 8:16 pm | Permalink

    What about the configuration for calling a remote endpoint registered on the local realm? The remote endpoint places call okay, but local endpoint could not place call to remote endpoint.

    “Would appreciate any advice, please.

    Regards

Post a Comment

Your email is never shared. Required fields are marked *

*
*