How to run Freeswitch mod_dingaling on windows
We recently began to explore Freeswitch. This is a powerful telephony platform that provides many communication functionalities with agile configuration. Amongst others, we looked at the dingaling implementation which enables communications with GoogleTalk using XMPP implementation. We quickly found out there’re a few steps to complete before the code will run on Windows/VS environment. So, instead of having others struggle like we did, here’s a list of the required steps. Have fun.
- Configuration
- Enable mod_dingaling by un-commenting on modules.conf.xml the line
. Alternatively, you can run on the console load mod_dingaling. - Enable debug mode for the module (dingaling.conf.xml). It’s not required but will helps in understanding what’s going on.
- Create jingle-profile like the one below:
<include> <profile type="client"> <param name="name" value="<meaningful name>"/> <param name="login" value="<your username>/gtalk"/> <param name="password" value="<your password>"/> <param name="server" value="talk.google.com"/> <param name="dialplan" value="XML"/> <param name="context" value="public"/> <param name="message" value="Send help or ? to learn more"/> <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="exten" value="1000"/> <param name="vad" value="both"/> profile> include>
- Enable mod_dingaling by un-commenting on modules.conf.xml the line
-
TLS. You need this to insure your XMPP stanzas are encrypted as required by the specifications. There’re few steps you need to do on windows:
- Install GnuTls for windows. Pick the latest exe file. At time of writing, the last one is 2.7.3.
- Assuming you’re using visual studio as your IDE, open visual studio command prompt (not your normal console) and type:
lib /def:libgnutls-26.def
on GnuTls bin folder. This will create a libgnutls-26.lib that can be used as a import library for Visual Studio projects.
-
Configure library ixemel to work with TL S libraries:
- Add additional include directory
- Add additional dependency.
- Add additional include directory
-
Last step, 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
/Debug: - libgcrypt-11.dll
- libgnutls-26.dll
- libgnutls-extra-26.dll
- libgnutls-openssl-26.dll
- libgpg-error-0.dll
- libtasn1-3.dll
A post-build event should take care of it:
xcopy "$(SolutionDir)GnuTLS-2.7.3\bin\*.dll" "$(SolutionDir)$(OutDir)\" /C /D /Y /S /F
-
I-can’t-find-config.h-step. Copy it from
\libs\win32\iksemel. Make sure the following line is not commented: #define HAVE_GNUTLS
- Questions?
March 5th, 2009 at 08:45
FreeSWITCH rocks.
March 23rd, 2009 at 14:35
hello,
thanks!
good tutorial,
but my server is not requiring tls
then i must alwed use tls ?
March 23rd, 2009 at 15:33
Hi Meftah,
Theoretically, communicating with XMPP servers that don’t require TLS is possible. However, any “respectable” server that adheres to the RFCs should support TLS so I encourage you to add it. BTW, GoogleTalk servers mandate the use of TLS.
March 24th, 2009 at 04:45
Hello,
I have tried to compile freeswith (revision 12724) in Visual studio 2008, and when I follow the directions here about compiling freeswitch with gnutls I get an error “cannot open file ‘pthread.h’” in the file stream.c in the iksemel project. I was wondering if you had the same problem with this?
Maybe this isn’t the exact place to ask this question, but it’s worth a shot if you have already solved this.
Thanks a lot.
March 24th, 2009 at 18:19
Hi Estuardo,
pthread.h exists in \libs\pthreads-w32-2-7-0-release. This is not part of the repository which it means it’s created during build of the solution. Make sure to add it as the last include path in the project properties.
March 25th, 2009 at 15:21
Really helpful…
After including the pthread file and compiling there are many errors in gnutls.h
March 25th, 2009 at 17:55
Hi Moiz,
can you elaborate on the errors?
Tzahi
March 26th, 2009 at 08:41
Here are errors:
1.
Error 1 error C2061: syntax error : identifier ‘gnutls_record_send’ D:\Downloads\gnutls-2.7.3\include\gnutls\gnutls.h 454
…
[I removed the rest of the errors for clarity. see my comment below for a solution. Tzahi]
Moiz.
March 26th, 2009 at 11:53
Hi Mois,
There’s no defintion for ssize_t. You need to add the following to the header file:
typedef long ssize_t;