miércoles, 1 de diciembre de 2010

OpenVox G400P in Debian

Éste post está también disponible en español.
This post is also available in spanish.

I bought an OpenVox G400P GSM telephony card to set up a VoIP server running Debian. I clearly didn't do my research homework before starting, and it turned out that it was not easy to set up this card with Dahdi, wich I had to keep in order to be able to use another card I already had on that server.

Problems I found:
  • There was not official Dahdi support for this board until about  ~6 months ago.
  • When it finally appeared, it turned out that there were not just some patches to the original source code, but some scripts that supossed that my system was RPM based. Oh, and it also downloads, modifies, compiles and installs Dahdi and Asterisk, leaving no room for customization.
  • When I asked the support about this issue, they told me that if I gave them SSH access they would install it for me (!?). I took the time to explain them that asking their clients for SSH access to their servers was not a good idea. Sadly, it seems that they didn't took my advice

Dissasembling the script:

So my next move was to get and install either Elastix or Trixbox in a virtual machine, supossedly supported by the script they provide, get the modified source code, check it and compile it in my Debian box.  I got to download three different versions of those distros, and it seems I couldn't get the correct version the script needed. So the next step was obvious: print the script, analyze it and modify it to get the source code.

Of course, I used git to keep the changes :-)

Final source code:

Asterisk: http://dumbledore.com.ar/gitweb/?p=asterisk.git;a=summary (might be incomplete, I still have to check it).

In the Dahdi repo, the openvox-g400p branch has the chan-extra modifications, the oslec branch contains the support for OSLEC echo canceler. Finally master is a merge of both. I still didn't check if the G400P supports oslec, but I have it there because I use it with the other card I have in the server.

Recommendations for OpenVox:

While I find an excellent idea to have an "automagic" script for your clients, a user os another distributions or/and an advanced user will find a patch most suitable. The good thing about this is that git makes it's creation quite simple.

I suggest the following workflow:

1.- Uncompress Dahdi's source code, rename the new directory and create a git repo out of it.

$ tar -xf dahdi-x.y.z.tar.gz
$ mv dahdi-x.y.z dahdi
$ cd dahdi
$ git init
$ git add -A
$ git commit -m "Original Dahdi source code version x.y.z."

2.- Create an upstream branch to follow Dahdi's development.

$ git checkout -b upstream

3.- Tag Dahdi's release in the upstream branch.

$ git tag -a dahdi-x.y.z

4.- Go back to the master branch and develop the driver.

$ git checkout master
[... desarrollo...]

5.- Once finished a release, tag it.

$ git tag -a chan-extra-x.y.z

6.- Make a patch out of it (althought it would be better to just publish the git repo).

$ git diff upstream master > chan-extra-x.y.z.patch

Note: there are far more better ways to generate a proper patch using git... but I had no time to get into that yet :-/ Comments welcomed :-)

7.- Whenever we need to develop with a newer Dahdi's release, we just need to update the upstream branch and merge it back to master.


$ git checkout upstream
$ git rm '*'
$ git clean -xdff
$ tar zxfv ../../dahdi-x.y.z+1.tar.gz --strip=1
$ git add -A
$ git commit -m "Import upstream x.y.z+1 release."
$ git checkout master
$ git merge upstream


Then the user will just need to patch the original source code and compile. Of course, the same workflow can be used for making patches for Asterisk.

Comments on this workflow will be much appreciated :-)

7 comentarios:

  1. hi im having trouble with openvon G400p
    i have install it on debian lenny 64
    i have download chan_extra-current.tar.gz unzip it
    and run ./install.sh the compilation went ok
    but when i log into asterisk and do
    CLI> gsm show span 1
    No GSM running on span 1
    the driver is load when i do lsmod | grep opv it shows
    opvxg4xx 20268 2
    could u please help me

    ResponderEliminar
  2. how can download new dahdi version that support G400P

    ResponderEliminar
  3. @Anonimous: either follow the instructions on this post or ask OpenVox's support. If you have questions on this post, just ask them :)

    @ammaro: this is exactly what this post is about... Anyway, you can always check chan-extra's webpage or ask OpenVox's support.

    ResponderEliminar
  4. Ya se que alguno puede escandalizarse.... pero no existen driver para windows de esta tarjeta? Me gustaria que me simulara puertos serie para desarrollo de un gateway SMS (comandos AT) para la integracion de una aplicacion y por las circunstancias tiene que ser windows ... a ser posible drivers X64.

    No encuentro absolutamente nada que no sea windows.

    ResponderEliminar
    Respuestas
    1. Perdon, no encuentro nada que no se Linux!

      Eliminar
    2. Abel, ahorrate disgustos y usá Linux. Mas con esa placa, que de por sí es molesta.

      Eliminar
  5. can someone tell me if this card have driver for windows?.

    ResponderEliminar