Call Us Today! 877.742.2583




Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: moved out of tree

...

More information about Jingle can be found here: Wikipedia Jingle Protocol

Note

As of 2022.08.29 mod_dingaling was removed from FreeSWITCH tree and placed in https://github.com/freeswitch 


Note

It has been announced that Google Voice over xmpp service, which is a dependency of several of the below examples, will be discontinued on May 15th, 2014. Keep that in mind when planning any deployments using GV.

...

Expand
titleClick here to expand Table of Contents


Panel
borderColorlightgray
bgColor#f7f7f7
borderWidth1
borderStyledotted

Table of Contents
maxLevel3
outlinetrue
indent1em
excludeAbout
stylenoneexcludeAbout
printablefalse


Getting it working

...

OpenSSL is required to ensure that your XMPP stanzas are encrypted as required by the specifications. Before running, make sure you have the ssl package installed.

CentOS 5.x

Code Block
languagexml
themeEmacs
languagexml
yum install openssl-devel

Ubuntu 10.x / Debian

Code Block
languagexml
themeEmacs
languagexml
sudo apt-get install libssl-dev

...

Make sure the following line is present and uncommented in /usr/src/freeswitch/modules.conf

Code Block
languagexml
themeEmacslanguagexml
endpoints/mod_dingaling

Then build and install mod_dingaling:

Code Block
languagexml
themeEmacs
languagexml
make mod_dingaling-install

...

Note

If you have installed SSL after building the dingaling module, you will need to re-bootstrap, re-configure and re-build freeswitch.

Run 'fs_cli'.

Code Block
language
languagexml
themeEmacsxml
load mod_dingaling

Windows using MSVC 2008

  • Since October 17,2011 this is no longer needed now OpenSSL is used. Mod_dingaling will now build with ssl out of the box.
  • Install GnuTls for windows. Take gnutls-2.9.9.exe, maybe more recent will work.
  • Build libgnutls-26.lib. This file will be used as a import library for Visual Studio projects. Open visual studio command prompt (not your normal console) and type in GnuTls bin folder:

    Code Block
    languagexml
    themeEmacs
    languagexml
    lib /def:libgnutls-26.def


  • Configure ixemel library to work with TLS library. Example
    • Add additional include directory.

    • Add additional dependency

  • If you have problems with the iksemel compilation process try:
    • for "syntax error: type" because of va_arg: include <starg.h> in config.h
    • for ENOENT errors: include <errno.h> - now found that the reason was config.h in libs/win32/iksemel was not included - to be checked
    • for ssize_t errors: add typedef long ssize_t in gnutls.h
  • If you have problems linking iksemel.lib because of strcasecmp errors, add the following in iksemel/utility.c
    • #define strcasecmp(s1, s2) stricmp(s1, s2)
    • #define strncasecmp(s1, s2, n) strnicmp(s1, s2, n)
  • Make sure the TLS dlls are copied to the configuration environment. For example, if you’re running on debug mode, you should have the following files in <your freeswitch root>/Debug:
    • libgcrypt-11.dll
    • libgnutls-26.dll
    • libgnutls-extra-26.dll
    • libgnutls-openssl-26.dll
    • libgpg-error-0.dll
    • libtasn1-3.dll

...

Uncomment the following in Modules.conf.xml.

Code Block
languagexml
themeEmacslanguagexml
<load module="mod_dingaling"/>

...

Settings similar to the following should work for A basic gtalk account:

Code Block
language
languagexml
themeEmacsxml
<profile type="client">
   <param name="name" value="gmail.com"/>
   <param name="login" value="MyUserName@gmail.com/gtalk"/>
   <param name="password" value="myPassWord"/>
   <param name="server" value="talk.google.com"/>
   <param name="dialplan" value="XML"/>
   <param name="message" value="FreeSwitch (The Future of Telephony)"/> <!-- You must specify a message for the profile to be valid -->
   <param name="rtp-ip" value="auto"/>
   <!-- if you are behind NAT, you should probably use STUN -->
   <param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
   <param name="auto-login" value="true"/>
   <param name="auto-reply" value="Press *Call* to join my conference"/>
   <param name="sasl" value="plain"/>
   <param name="tls" value="true"/>
   <param name="use-rtp-timer" value="true"/>
   <param name="exten" value="1000"/> <!-- The extension you want a call in to connect to -->
 </profile>

...

Settings similar to the following will enable Jingle support:

Code Block
languagexml
themeEmacs
languagexml
<profile type="client">
   <param name="name" value="gmail.com"/>
   <param name="login" value="MyUserName@gmail.com/gtalk"/>
   <param name="password" value="myPassWord"/>
   <param name="server" value="talk.google.com"/>
   <param name="dialplan" value="XML"/>
   <param name="message" value="FreeSwitch (The Future of Telephony)"/> <!-- You must specify a message for the profile to be valid -->
   <param name="rtp-ip" value="auto"/>
   <!-- if you are behind NAT, you should probably use STUN -->
   <param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
   <param name="auto-login" value="true"/>
   <param name="auto-reply" value="Press *Call* to join my conference"/>
   <param name="sasl" value="plain"/>
   <param name="tls" value="true"/>
   <param name="use-jingle" value="true"/> 
   <param name="use-rtp-timer" value="true"/>
   <param name="exten" value="1000"/> <!-- The extension you want a call in to connect to -->
 </profile>

To enable Video support, edit dingaling.conf.xml as follows (video does NOT work with GVoice):

Code Block
languagexml
themeEmacslanguagexml
<configuration name="dingaling.conf" description="XMPP Jingle Endpoint">
  <settings>
    <param name="debug" value="1"/>
    <param name="codec-prefs" value="H264,PCMU"/>
  </settings>
  <X-PRE-PROCESS cmd="include" data="../jingle_profiles/*.xml"/>
</configuration>

...

Sample Configuration (ejabberd)

Code Block
languagexml
themeEmacs
languagexml
<profile type="component">
   <param name="name" value="xmpp.example.com"/>
   <param name="password" value="123456"/>
   <param name="dialplan" value="XML"/>
   <param name="context" value="public"/>
   <param name="rtp-ip" value="$${bind_server_ip}"/>
   <param name="server" value="xmpp.example.com:5275"/>
   <param name="use-rtp-timer" value="true"/>
   <param name="exten" value="_auto_"/>
 </profile>

...

mod_dingaling sets the following variables:

Code Block
language
languagexml
themeEmacsxml
variable_dl_from_user: accessed as 'dl_from_user' using the getVariable API call
variable_dl_from_host: accessed as 'dl_from_host' using the getVariable API call


Code Block
languagexml
themeEmacs
languagexml
Lua Example:
freeswitch.consoleLog("info", "Receiving call from " .. session:getVariable('dl_from_user') .. " at the domain " .. session:getVariable('dl_from_host') .. "\n")

Events

Custom events:

Code Block
languagexml
themeEmacslanguagexml
dingaling::login_success
dingaling::login_failure
dingaling::connected

...