El protocolo IAX2 nos permite unificar varios servidores asterisk haciendo posible que pueda marcar desde un grupo de extensiones de una localidad a otra de manera transparente.
Vamos a suponer que tenemos dos servidores y queremos que desde una extension registrada en el sitio A se pueda marcar a una extension del sitio B:
Servidor IP Extensiones
AsteriskA 192.168.0.1 100 a 199
AsteriskB 192.168.1.1 200 a 299
Para lograr nuestro cometido necesitamos crear una troncal IAX2 para el servidor remoto en cada localidad.
Empezamos con [b]AsteriskA[/b]:
En /etc/asterisk/iax.conf
[servidorb]
type=friend
username=servidora
secret=password
auth=plaintext
host=192.168.1.1
context=entrantes
trunk=yes
requirecalltoken=no
En /etc/asterisk/extensions.conf
[entrantes]
exten => 2XX,1,Dial(IAX2/servidorb/${EXTEN},90,tr)
exten => 2XX,2,HangUp()
En [b]servidorB[/b]:
Editamos /etc/asterisk/iax.conf
[servidora]
type=friend
username=servidorb
secret=password
auth=plaintext
host=192.168.0.1
context=entrantes
trunk=yes
requirecalltoken=no
En /etc/asterisk/extensions.conf:
[entrantes]
exten => 1XX,1,Dial(IAX2/servidora/${EXTEN},90,tr)
exten => 1XX,2,HangUp()
Por ultimo ejecutamos:
asterisk -r -x "reload"
Ahora es posible marcar desde ServidorA hacia las extensiones 2XX de ServidorB y viceversa :)
Comentarios
aqui esta el log
hola amigos como estan bueno aqui esta el log, aun no encuentro el error, hice algunos cambios en iax.conf y en extensions.con, en el servidor a, como en el servidor b, no son cambios q afectan a la interconexion, bueno les dejo a ver donde puede estar el error, graciasss chauuu
Llamando desde el interno 1002 del Servidor A hacia el interno 2002 del Servidor B
Servidor A
Connected to Asterisk 1.2.24 currently running on localhost (pid = 1482)
Verbosity is at least 3 Asterisk Ready.
-- Remote UNIX connection
NOTICE[1505]: res_musiconhold.c:533 monmp3thread: Request to schedule in the past?!?!
-- Registered SIP '1002' at 192.168.1.6 port 14894 expires 3600
NOTICE[1505]: res_musiconhold.c:533 monmp3thread: Request to schedule in the past?!?!
-- Executing Dial("SIP/1002-088d5140","IAX2/servidorb:password@192.168.1.55/2002|30|r") in new stack
-- Called servidorb:password@192.168.1.55/2002
WARNING[1536]: chan_iax2.c:7170 socket_read: Call rejected by 192.168.1.55: No authority found
-- Hungup 'IAX2/servidorb-1'
== Everyone is busy/congested at this time (1:0/0/1)
NOTICE[1505]: res_musiconhold.c:533 monmp3thread: Request to schedule in the past?!?!
WARNING[2014]: pbx.c:2435 __ast_pbx_run: Timeout, but no rule 't' in context 'default'
Y esto ocurre en el Servidor B
NOTICE[1524]: chan_iax2.c:socket_read: Rejected connect attempt from 192.168.1.5, who was trying to reach '2002@'
Ahora llamando desde el interno 2002 del Servidor B hacie el internos 1002 del Servidor A
Servidor B
Connected to Asterisk 1.2.24 currently running on localhost (pid = 1482)
Verbosity is at least 3 Asterisk Ready.
-- Remote UNIX connection
NOTICE[1505]: res_musiconhold.c:533 monmp3thread: Request to schedule in the past?!?!
-- Registered SIP '2002' at 192.168.1.56 port 14894 expires 3600
NOTICE[1505]: res_musiconhold.c:533 monmp3thread: Request to schedule in the past?!?!
-- Executing Dial("SIP/2002-088d5140", "IAX2/servidora:password@192.168.1.5/1002|30|r") in
new stack
-- Called servidora:password@192.168.1.5/1002
WARNING[1536]: chan_iax2.c:7170 socket_read: Call rejected by 192.168.1.5: No authority found
-- Hungup 'IAX2/servidora-1'
== Everyone is busy/congested at this time (1:0/0/1)
NOTICE[1505]: res_musiconhold.c:533 monmp3thread: Request to schedule in the past?!?!
WARNING[2014]: pbx.c:2435 __ast_pbx_run: Timeout, but no rule 't' in context 'default'
Y esto ocurre en el Servidor A
NOTICE[1524]: chan_iax2.c:socket_read: Rejected connect attempt from 192.168.1.55, who was trying to reach '1002@'
Cambia el contexto en la
Cambia el contexto en la configuracion iax de cada servidor, en vez de entrantes coloca internos.
------------
Antes de preguntar visita el [url=http://www.sindominio.net/ayuda/preguntas-inteligentes.html]link[/url] :evil:
[img]http://www.bbspot.com/Images/News_Features/2003/01/os_quiz/debian.jpg[/img]
-----
Visita este [url=http://www.sindominio.net/ayuda/preguntas-inteligentes.html]link[/url] :evil:
[img]http://www.bbspot.com/Images/News_Features/2003/01/os_quiz/debian.jpg[/img]
(adsbygoogle = window.adsbygoogle || []).push({});
aun sigue el error
t cuento q lo cambie pero tampoco funciono :( y nose q mas modificar ya esta casi todo pero no funciona, y nose q mas hacer,por favor tirenme una ayuda para hacer q funcione ok?? graciasss chauuuuu
asterisk 1
ip:192.168.1.5 255.255.255.0
sip.conf
[general]
language=es
context=default
[1000]
type=friend
secret=123
host=dynamic
[1001]
type=friend
secret=123
host=dynamic
[1002]
type=friend
secret=123
host=dynamic
iax.conf
[general]
bindport=4569
bandwidth=low
disallow=lpc10
jitterbuffer=no
forcejitterbuffer=no
tos=lowdelay
autokill=yes
[servidorb]
type=friend
host=dynamic
secret=password
auth=plaintext
context=default
qualify=yes
extensions.conf
[general]
[globals]
TRUNK=IAX2/servidorb:password@192.168.1.55
[internos]
exten=> 1000,1,Dial(SIP/1000,20,r)
exten=> 1000,n,Voicemail(u1000)
exten=> 1000,n,Hangup
exten=> 1000,n,Voicemail(b1000)
exten=> 1000,n,Hangup
exten=> 1001,1,Dial(SIP/1001,20,r)
exten=> 1001,n,Voicemail(u1001)
exten=> 1001,n,Hangup
exten=> 1001,n,Voicemail(b1001)
exten=> 1001,n,Hangup
exten=> 1002,1,Dial(SIP/1002,20,r)
exten=> 1002,n,Voicemail(u1002)
exten=> 1002,n,Hangup
exten=> 1002,n,Voicemail(b1002)
exten=> 1002,n,Hangup
exten=> 100,1,Voicemailmain
[entrantes]
exten => _2XXX,1,Dial(${TRUNK}/${EXTEN},30,r)
[default]
include=> internos
include=> entrantes
asterisk 2
ip:192.168.1.55 255.255.255.0
sip.conf
[general]
language=es
context=default
[2000]
type=friend
secret=123
host=dynamic
[2001]
type=friend
secret=123
host=dynamic
[2002]
type=friend
secret=123
host=dynamic
iax.conf
[general]
bindport=4569
bandwidth=low
disallow=lpc10
jitterbuffer=no
forcejitterbuffer=no
tos=lowdelay
autokill=yes
[servidora]
type=friend
host=dynamic
secret=password
auth=plaintext
context=default
qualify=yes
extensions.conf
[general]
[globals]
TRUNK=IAX2/servidora:password@192.168.1.5
[internos]
exten=> 2000,1,Dial(SIP/2000,20,r)
exten=> 2000,n,Voicemail(u2000)
exten=> 2000,n,Hangup
exten=> 2000,n,Voicemail(b2000)
exten=> 2000,n,Hangup
exten=> 2001,1,Dial(SIP/2001,20,r)
exten=> 2001,n,Voicemail(u2001)
exten=> 2001,n,Hangup
exten=> 2001,n,Voicemail(b2001)
exten=> 2001,n,Hangup
exten=> 2002,1,Dial(SIP/2002,20,r)
exten=> 2002,n,Voicemail(u2002)
exten=> 2002,n,Hangup
exten=> 2002,n,Voicemail(b2002)
exten=> 2002,n,Hangup
exten=> 200,1,Voicemailmain
[entrantes]
exten => _1XXX,1,Dial(${TRUNK}/${EXTEN},30,r)
[default]
include=> internos
include=> entrantes
Llamando desde el interno 1002 del Servidor A hacia el interno 2002 del Servidor B
Servidor A
Connected to Asterisk 1.2.24 currently running on localhost (pid = 1482)
Verbosity is at least 3 Asterisk Ready.
-- Remote UNIX connection
NOTICE[1505]: res_musiconhold.c:533 monmp3thread: Request to schedule in the past?!?!
-- Registered SIP '1002' at 192.168.1.6 port 14894 expires 3600
NOTICE[1505]: res_musiconhold.c:533 monmp3thread: Request to schedule in the past?!?!
-- Executing Dial("SIP/1002-088d5140","IAX2/servidorb:password@192.168.1.55/2002|30|r") in new stack
-- Called servidorb:password@192.168.1.55/2002
WARNING[1536]: chan_iax2.c:7170 socket_read: Call rejected by 192.168.1.55: No authority found
-- Hungup 'IAX2/servidorb-1'
== Everyone is busy/congested at this time (1:0/0/1)
NOTICE[1505]: res_musiconhold.c:533 monmp3thread: Request to schedule in the past?!?!
WARNING[2014]: pbx.c:2435 __ast_pbx_run: Timeout, but no rule 't' in context 'default'
Y esto ocurre en el Servidor B
NOTICE[1524]: chan_iax2.c:socket_read: Rejected connect attempt from 192.168.1.5, who was trying to reach '2002@'
Ahora llamando desde el interno 2002 del Servidor B hacie el internos 1002 del Servidor A
Servidor B
Connected to Asterisk 1.2.24 currently running on localhost (pid = 1482)
Verbosity is at least 3 Asterisk Ready.
-- Remote UNIX connection
NOTICE[1505]: res_musiconhold.c:533 monmp3thread: Request to schedule in the past?!?!
-- Registered SIP '2002' at 192.168.1.56 port 14894 expires 3600
NOTICE[1505]: res_musiconhold.c:533 monmp3thread: Request to schedule in the past?!?!
-- Executing Dial("SIP/2002-088d5140", "IAX2/servidora:password@192.168.1.5/1002|30|r") in
new stack
-- Called servidora:password@192.168.1.5/1002
WARNING[1536]: chan_iax2.c:7170 socket_read: Call rejected by 192.168.1.5: No authority found
-- Hungup 'IAX2/servidora-1'
== Everyone is busy/congested at this time (1:0/0/1)
NOTICE[1505]: res_musiconhold.c:533 monmp3thread: Request to schedule in the past?!?!
WARNING[2014]: pbx.c:2435 __ast_pbx_run: Timeout, but no rule 't' in context 'default'
Y esto ocurre en el Servidor A
NOTICE[1524]: chan_iax2.c:socket_read: Rejected connect attempt from 192.168.1.55, who was trying to reach '1002@'
ok ok ya salio
hola amigos como va??
bueno les cuento q ya salio la conexion :) lo hice funcionar, pero ahora quisiera saber, si puedo llamar del internos 1000 al interno 2000,quisiera saber como puedo hacer para que cuando llame en un tiempo determinado, me salga el mensaje diciendome q no se encuentra disponible y q deje el mensaje despues del tono, o en todo caso q si se encuentra apagado su telefono o xlite, q tambien me salga el mensaje de q no se encuntra y q deje el mensaje despues del tono.
coloq esta linea de comando.
[entrantes]
exten=> _1XXX,1,Dial(${TRUNK}/${EXTEN},30,r)
exten=> _1xxx,1,voicemail(u${EXTEN})
exten=> _1xxx,n,hangup()
exten=> _1xxx,n,voicemail(b${EXTEN})
exten=> _1xxx,n,hangup()
pero no sale nada de audio
Si ya te salio me podrias ayudar tengo el mismo problema
Hey _alive_ ya que te salio me podrias colaborar aun no he podido conectar mis dos servidores...te lo agradeceria inmensamente
los telefonos que usas para la comunicacion son ?
estoy tratando de implementar algo asi en mi oficina pero no se que telefonos comprar por favor me puedes ayudar con las caracterisitcas y marcas
gracias.
Louis
Intentando sin exito
Que tal, tengo algunas dudas y suposiciones tontas debido a mi falta de experiencia:
1.- Las extensiones tienen que ser IAX?
2.- El login y password en ambas configuraciones tiene que ser el mismo? es decir algo asi como una preshared key?
3.- Ya le googleé un rato y no encuentro clientes tipo X-Lite que soporten protocolo IAX, tiene alguna recomendacion?
Les agradezco de antemano y muchas felicidades por el sitio, tienen contenidos muy interesantes.
Saludos!!
Cita: 1.- Las extensiones
[quote]1.- Las extensiones tienen que ser IAX?[/quote]
No necesariamente, tambien se puede realizar con SIP.
Varian algunos datos de la configuracion pero en general es muy parecido. Solo debes hacerlo en el sip.conf
Si buscas aqui mismo encontraras un "como"
[quote]2.- El login y password en ambas configuraciones tiene que ser el mismo? es decir algo asi como una preshared key?[/quote]
En la configuracion que ofrece Razametal el secret debe ser el mismo. Si por alguna extraña razon debes usar secret diferente para cada terminal deberias utilizar alguna otra manera para registrar los extremos.
AsteriskA (iax.conf)
registry => nombre_de_registro_en_B:password_B@192.168.1.1
[nombre_de_registro_en_A]
type=peer
username=nombre_de_registro_en_A
secret=password_A
auth=plaintext
host=192.168.1.1
peercontext=entrantes
context=entrantes
trunk=yes
AsteriskB (iax.conf)
registry => nombre_de_registro_en_A:password_A@192.168.0.1
[nombre_de_registro_en_B]
type=friend
username=nombre_de_registro_en_B
secret=password_B
auth=plaintext
host=192.168.0.1
peercontext=entrantes
context=entrantes
trunk=yes
[quote]3.- Ya le googleé un rato y no encuentro clientes tipo X-Lite que soporten protocolo IAX, tiene alguna recomendacion?[/quote]
si pones en google "softphone iax" seguro aparecerá algo.
te puede servir el zoiper http://www.zoiper.com/
Es muy sencillo, es gratis, soporta 2 extensiones, SIP / IAX, todos los codecs mas comunes
Pregunta
Hola
Bueno leyendo estos comentarios a mi tambien se me creo una interrogante, puedo conectar dos redes ejemplo digamos 10.102.1.0 con 10.102.8.0 teniendo en cuenta que solo tengo un servidor Asterisk en la IP 10.102.8.0 como puedo enlazar estas dos redes que deberia hacer o configurar.
Puedes usar un router para
Puedes usar un router para conectar las 2 redes.
Puedes usar algun software de ruteo.
O puedes realizar una configuracion de tablas para enrutar el trafico.
De todas maneras es externo a Asterisk. Es mas un problema de networking que de telefonia.
Páginas