Tzah 2.0


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.

  1. Configuration
    1. Enable mod_dingaling by un-commenting on modules.conf.xml the line . Alternatively, you can run on the console load mod_dingaling.
    2. Enable debug mode for the module (dingaling.conf.xml). It’s not required but will helps in understanding what’s going on.
    3. 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>
      

  2. 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:

    1. Install GnuTls for windows. Pick the latest exe file. At time of writing, the last one is 2.7.3.
    2. 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.
  3. Configure library ixemel to work with TL S libraries:

    1. Add additional include directory

         addInclude

    2. Add additional dependency. 
         addDependency
  4. 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

  5. I-can’t-find-config.h-step. Copy it from \libs\win32\iksemel. Make sure the following line is not commented:

    #define HAVE_GNUTLS 
  6. Questions?

9 Responses to “How to run Freeswitch mod_dingaling on windows”

  1. Diego Viola Says:

    FreeSWITCH rocks.

  2. Meftah Tayeb Says:

    hello,
    thanks!
    good tutorial,
    but my server is not requiring tls
    then i must alwed use tls ?

  3. tzah Says:

    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.

  4. Estuardo Says:

    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.

  5. tzah Says:

    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.

  6. Moiz Says:

    Really helpful…

    After including the pthread file and compiling there are many errors in gnutls.h

  7. tzah Says:

    Hi Moiz,

    can you elaborate on the errors?
    Tzahi

  8. Moiz Says:

    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.

  9. tzah Says:

    Hi Mois,

    There’s no defintion for ssize_t. You need to add the following to the header file:
    typedef long ssize_t;

Leave a Reply

Jajah is the VoIP player that brought you web-activated telephony.