Mostrando entradas con la etiqueta asterisk. Mostrar todas las entradas
Mostrando entradas con la etiqueta asterisk. Mostrar todas las entradas

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 :-)

OpenVox G400P en Debian

This post is also available in english.
Éste post también se encuentra redactado en inglés.

Instalando un servidor de telefonía IP no tuve mejor idea que adquirir una placa OpenVox G400P para conectarme a la red GSM sin buscar lo suficiente en la web antes. Mi error.

Los problemas:
  • Al momento de adquirir la placa (hace apenas ~6 meses) no existía soporte oficial para Dahdi.
  • Cuando el mismo apareció, resulta ser que no constaba de unos simples parches, sino un script que supone que uno usa un sistema basado en RPMs, baja y modifica las fuentes de Dahdi y Asterisk, los compila e instala, sin dejar lugar a modificaciones por parte del usuario.
  • Al preguntar al soporte, me dijeron que me lo instalaban ellos mismos... si les daba acceso SSH (de no creer). Me tomé el trabajo de explicarles que pedir acceso SSH a sus clientes era una mala idea, pero me parece que no entendieron. 

Desarmando el script:

Mi idea entonces fué instalar una máquina virtual con la versión de Elastix o Trixbox que ellos pedían para hacer correr el script, obtener el código fuente parcheado, revisarlo y compilarlo en mi Debian. Llegué a bajar tres versiones distintas de ésas distros... y parece ser que ninguna de ellas era la que el script esperaba. Para ese momento decidí hacer lo que debía haber hecho desde un principio: imprimir el script, desarmarlo y armar ése código fuente yo mismo.

Por supuesto, usé git para el proceso :)

El código fuente resultante:

Asterisk: http://dumbledore.com.ar/gitweb/?p=asterisk.git;a=summary (puede estar incompleto, todavía lo tengo que chequear).

En el caso de Dahdi, la rama openvox-g400p contiene las modificaciones de chan-extra, la rama oslec contiene el soporte para el cancelador de eco OSLEC. Finalmente la rama master es un merge de ambas. Todavía no probé que la placa funcione con oslec, pero está ahí porque la uso en la otra placa que tengo en el servidor.

Recomendaciones para la gente de OpenVox:

Si bien me parece excelente que quieran proveer a sus clientes de un script "automágico", un usuario de otras distribuciones y/o un usuario avanzado va a encontrar mejor que le proporcionen un patch para el código fuente. Lo bueno es que gracias a git ésto no es complicado.

Les sugiero el siguiente workflow:

1.- Descomprimir el código fuente original de Dahdi, renombrar el directorio y crear un repositorio git del mismo.

$ 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.- Crear una rama upstream para seguir el desarrollo de Dahdi.

$ git checkout -b upstream

3.- Taggear la release específica de Dahdi en la rama upstream.

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

4.- Volver a la rama master y realizar el desarrollo del driver en la misma.

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

5.- Una vez terminada una release, taggearla.

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

6.- Crear un parche a partir de ambas ramas (aunque sería mejor publicar el repositorio git directamente):

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

Nota: hay mejores formas para obtener un parche que ésta manera... pero no es algo que haya explorado lo suficiente. Se aceptan comentarios ;)

7.- Cuando se deba desarrollar para una nueva versión de Dahdi, basta con actualizar la rama correspondiente y hacer un merge:


$ 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


Luego el usuario podrá aplicar el parche usando patch y compilar. Basta con seguir el mismo workflow para crear parches para Asterisk.

Por supuesto, se aceptan comentarios sobre éste workflow :-)

sábado, 21 de noviembre de 2009

Instalando FreePBX en Debian

Siempre me pego unos mareos bárbaros cada vez que quiero instalar FreePBX en Debian. Pero esta guía me dió una mano mas que interesante.

Si, éste es uno de ésos posts de "backup de info" :-)

martes, 10 de febrero de 2009

Una semana interesante

Esta está resultando una semana bastante interesante (quitando el insomnio que sufrí esta madrugada, claro).

Este miércoles rindo la tesis, por acá conocida como "Proyecto final de carrera". Se titula (a no desmayarse de lo profundo del título) "VoIP en la UNS". Quizás debiese llamarla "Como intentar que una central Siemens HiCom300 te dé una línea E1 mediante una placa DIUS2 y no desfallecer por no lograrlo". Sería un título mas correcto e informativo, pero mas desesperanzador :-/ Como sea, aprendí un montón de cosas que me han sido muy útiles tanto en Punta Alta Digital como para el laboratorio de mi papá (próximamente con central Asterisk atendiendo llamadas ;-) )

El viernes van a pasar dos grandes sucesos: el tiempo Unix va a llegar a 1234567890 (11:31:30pm UTC, eso sería 21:31:30 AR) y mi mamá viene de visita ;-)

Para completarla, el sábado podemos llegar a ver el desenlace del romance del año:



Bueno, en verdad no es el único ni el primero, aunque espero que éste no se malogre ;-)

jueves, 2 de octubre de 2008

Siemens HiCom 300 and Asterisk

I have spent almost two years trying to get a Siemens HiCom 300 to work with an Asterisk setup trough a DIUS2 card. It seems that the HiCom is not well configured :-(

Dear Lazy Web, if you happen to know how to make this work, please do not heasitate to leave a comment :-)