While listening to Ray LaMontagne, I’ve been playing with freeswitch on Ubuntu Feisty.
Starting from a bare bones feisty, well, actually a bare bones dapper (openvz template I downloaded) upgraded to feisty in one fell swoop.
Getting freeswitch:
apt-get install subversion subversion-tools svn checkout http://svn.freeswitch.org/svn/freeswitch/trunk freeswitch apt-get install autoconf automake libtool libmudflap0-dev libltdl3-dev\\ flex bison gdb build-essential wget unixodbc-dev libnspr4 cd freeswitch ./bootstrap.sh ./configure --enable-core-odbc-support cp build/modules.conf.in modules.conf
I edited modules.conf and uncommented spidermonkey. Spidermonkey is a javascript engine used by freeswitch to add functionality. So far for me, that’s just an answering machine.
make all sudo make install
It installs in /usr/local/freeswitch
edit /usr/local/freeswitch/conf/freeswitch.xml
<!--#set "sip_profile=mydomain.com"-->
Assuming you don’t have srv records and know how to configure them, change mydomain.com to whatever fqdn resolves to the ip address freeswitch is installed on. I think (but I’m not sure ;) that you can choose any name you like, but it’s safer to use the fqdn for now.
You can leave the rest of the file alone.
edit /usr/local/freeswitch/conf/directory.xml
This is where you add extensions. You can modify that file, and add extensions, I moved it out of the way and created a new one like this.
<domain name="$${sip_profile}">
<user id="100">
<params>
<param name="password" value="100"/>
</params>
<variables>
<variable name="ruleset" value="internal" />
</variables>
</user>
<user id="101">
<params>
<param name="password" value="101"/>
</params>
<variables>
<variable name="ruleset" value="internal" />
</variables>
</user>
<user id="102">
<params>
<param name="password" value="102"/>
</params>
<variables>
<variable name="ruleset" value="internal" />
</variables>
</user>
</domain>
edit /usr/local/freeswitch/conf/spidermonkey.conf.xml
and add
<load module="mod_spidermonkey_etpan"/>
One more file to edit.
edit default_context.xml
add
<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%${sip_profile}" />
<action application="javascript" data="answermachine.js" />
</condition>
</extension>
If you want to play with the answering machine, you’ll also need to download answermachine and edit it with your email address, etc, and save it as /usr/local/freeswitch/scripts/answermachine.js .
you can then cd to the bin directory and ./freeswitch
You should be able to register a couple of phones as 101, 102 and 103.
After you’ve made a few test calls, and everything appears to be working.
edit /usr/local/freeswitch/conf/sofia.conf.xml
change <param name=”accept-blind-reg” value=”true”/> to false
and uncomment <!–<param name=”auth-calls” value=”true”/>–>
Done, I’ve also setup a gateway which I’ll post about later
Related posts: