[:es]Marcar una extensión remota desde una IVR en Asterisk[:en]Dial an external extension from an Asterisk IVR

Hace poco tuve que conectar dos centrales telefónicas Asterisk. De hecho, tuve que separar dos grupos de internos en dos centrales, pero quería retener la habilidad del marcado directo de internos desde la IVR de una de las dos centrales. Para eso, hay que perderle un poco el miedo al extensions.conf de asterisk.

En este caso, y para convivir con una instalación de FreePBX agregué este texto, en cada central, en el archivo

I had to connect two Asterisk PBX I really had to split one PBX in two for bandwidth reasons but I wanted to keep them as one. One thing that I had to do was to keep the direct dial working on the main IVR. Well, there where TWO ivr’s now, so I had to make special magic on them.

To avoid the interference of FreePBX y edited, on both installations, the file

/etc/asterisk/extensions_custom.conf

En las oficinas centrales, para que vaya hacia la planta.In the main office, to dial to the plant.

#IVR PRINCIPAL
[ivr-2-custom]

#LaPlanta
exten => _22X,1,dial(iax2/laplanta/${EXTEN})
exten => _62X,n,dial(iax2/laplanta/${EXTEN}

Y en la otra, la de la planta:The other one, in the plant:

#IVR PLANTA
[ivr-1-custom]
#oficinas
exten => _2[013]X,1,dial(iax2/oficinas/${EXTEN})
exten => _6[013]X,n,dial(iax2/oficinas/${EXTEN})

Como verán, tuve que encontrar el nombre de la ivr para Asterisk, que no es el mismo nombre de fantasía que nos pone el FreePBX. Para encontrar el nombre correcto fuí hasta la página de configuración de las IVR’s y me fijé en el link el ID de la ivr que estaba mirando. La que me interesaba era la nro 2 así que el texto que tenía que agregar era [ivr-2-custom].

Si nos fijamos en el código de extensions_additional.conf veremos que para todas las aplicaciones el FreePBX inserta un include => nombredeaplicacion-custom, que muchas veces no existe pero que sirve para que podamos incluir nuestro código específico. Si vamos a la aplicación [ivr-2] la primera línea llama a nuestro agregado: include => ivr-2-custom.

Por eso instruímos a nuestro agregado para que ante un patrón de marcado de un número que empiece con 22 y tenga otro número más (22x), deberá marcar ese número encontrado, ${EXTEN}, a través del módulo iax2 usando la línea llamada laplanta. Atentis que si modificamos las rutas de salida, este archivo queda fijado en una ruta determinada.

Me parece que esto da para hacer una categoría: Cómo se juntan dos o más centrales Asterisk .

As you can see, the name of the IVR is not the one Asterisk is showing, it only has names as ivr-n. To find the right name I went to the editing page of the IVR in FreePBX and I looked the link it was showing for the editing of each IVR. The key was the ID, and the main IVR in the offices PBX was number 2. So the text I had to add was [ivr-2-custom].

FreePBX places an include => appname-custom as the first line of every application it adds. This custom thing may not exists –in fact, the usual thing is that there is no appname-custom–  but that’s not a problem with Asterisk. Go check the file /etc/asterisk/extensions_additional.conf and you will see. Make a search on -custom so you can find the custom call for an IVR, or calltrace, or any other thing.

On our code, we instruct our adendum to look for a number like 22X and to dial that number ${EXTEN} through the iax2 module using the trunk laplanta. Achtung! A change in the outbound routes will not modify this one, fixed here.

I think I’m going to create a new category on How to Connect Many Asterisks PBX.