SIPX JINGLE HACK
From QXIP
Contents |
SIPX:SIPX JINGLE HACK
So, sipXecs uses Freeswitch as its mediaserver, and FS comes with mod_dingaling ready - sipXecs comes with its own Openfire/Jabber IM server but surprisingly it doesn not have a module to register accounts and route calls... or does it? Time to squeeze some more juice out..
The following hacks will allow audio bridging between FS/mod_dingaling <> sipXecs/SIP Endpoints
THE LOGIC:
- sipXecs/FS/mod_dingaling registers a Jingle <user> on sipXecs/Openfire (same server)
- sipXecs/FS/mod_dingaling goes online and accepts calls via jingle/xmpp (see gTalk)
- gTalk/user calls sipXecs/user via jingle/audio (using speex codec)
- sipXecs/FS/mod_jinglaling accepts the jingle invite and creates SIP Bridge to <user>
- sipXecs/FS/mod_dingaling accepts the call and creates SIP bridge to sipXecs > SIP Device
Result: gTALK Client <speex> jingle < > FS <> sipXecs <speex> SIP UA
PRE-REQUISITES:
- sipXecs 4.4.0 or higher
- sipXecs/SIP Endpoint 2002 registered (or change the vars in this example)
- sipXecs/IM Enabled
- DNS SRV records set for XMPP client/server
- gTalk/gMail account (w/ voice & video plugin)
CHANGES:
Add the following block as last option to: /etc/sipxpbx/freeswitch/conf/dialplan/sipX_context.xml
<extension name="sipXecs-loop">
<condition field="source" expression="mod_dingaling">
<action application="set" data="proxy_media=true"/>
<action application="bridge" data="sofia/your.host.net/${destination_number}@your.host.net"/>
</condition>
</extension>
To make this persistent, add the same to /etc/sipxpbx/freeswitch/default_context.xml.vm
Add the following jingle profile to: /etc/sipxpbx/freeswitch/conf/jingle_profiles/2002.xml
<include>
<profile type="client">
<param name="name" value="$${xmpp_client_profile}"/>
<param name="login" value="2002@your.host.net/talk"/>
<param name="password" value="2002"/>
<param name="dialplan" value="XML"/>
<param name="context" value="default"/>
<param name="message" value="Jingle all the way"/>
<param name="rtp-ip" value="$${bind_server_ip}"/>
<param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
<param name="auto-login" value="true"/>
<param name="sasl" value="plain"/>
<param name="tls" value="true"/>
<param name="use-rtp-timer" value="true"/>
<param name="rtp-timer-name" value="none"/>
<param name="exten" value="2002"/>
<param name="vad" value="both"/>
<param name="candidate-acl" value="wan.auto"/>
<param name="local-network-acl" value="localnet.auto"/>
</profile>
</include>
This will register Jingle user 2002 and make it appear available as configured, ready to accept invites and audio calls.
Add the following codec to: /etc/sipxpbx/freeswitch/conf/autoload_configs/dingaling.conf.xml
<param name="codec-prefs" value="speex,PCMU"/>
Enable mod_dingaling in: /etc/sipxpbx/freeswitch/conf/autoload_configs/modules.conf.xml
<load module="mod_dingaling"/>
To make this persistent, add the same to /etc/sipxpbx/freeswitch/modules.conf.xml.vm
Activate the new configuration and reload mod_dingaling from your shell:
/opt/freeswitch/bin/fs_cli -x "reloadxml" /opt/freeswitch/bin/fs_cli -x "reload mod_dingaling"
TEST IT
- Register SIP Endpoint 2002
- From Gmail add to chat 2002@your.host.net
- The contact should immediately appear online (if not, check FS console)
- Open Chat and call 2002@your.host.net (audio only)
- The SIP Endpoint should be ringing... pick it up!
NOTE: If working, you might want to drop a quick configuration backup in case sipX restores defaults..
TROUBLESHOOTING SUPERSTARS
In case of federation issues with other jabber networks or gmail, verify your Openfire configuration by enabling Openfire admin console: (5094)
sipxopenfire.sh -a enable sipxproc -k SipXopenfire sipxproc -s SipXopenfire
Make sure the domain and the FQDN are set to the very same value or things will not work as expected, and keep and eye on the sessions. The authentication details for the above are the official documents.
Once done, you really really want to proceed disabling it by restarting sipX or:
sipxopenfire.sh -a disable sipxproc -k SipXopenfire sipxproc -s SipXopenfire
TO DO...
- Outbound calls routing... should be easy but a system wide solution is needed 1st
<extension name="jingle_out">
<condition field="destination_number" expression="^1(\d{10})$">
<action application="set" data="hangup_after_bridge=true"/>
<action application="ring_ready"/>
<action application="bridge" data="dingaling/${user_name}/+1$1@your.host.net"/>
</condition>
- Server component mode (domain catch-all)
