Instalación TFTP – Aastra. RedHat/CentOS.

Buen día,

En ocasiones requerimos que las terminales Aastra se auto-provisionen, por decirlo que otro modo que tomen la configuración de una extensión en particular, para ello es necesario un Servidor DHCP (no es mandatorio), el Super-Demonio XINETD y de su hijo tftp-server, para ello les dejo otro pequeño tutorial que puede ayudarles en esta tarea.

Incluyó todas las configuraciones que una terminal Aastra puede soportar.

Espero les sirva.

Saludos,

@rodman1942

Howto_tftp_redhat_centos

 

 

 

 

 

Instalación de OpenR2 + Sangoma + Asterisk.

Buen día,

Les dejo un Howto que realice hace tiempo, creo que podría servir de referencia si se encuentran configurando un enlace E1 R2 (TELMEX) y tarjetas Sangoma.

Espero les sirva.

Saludos,

@rodman1942

Howto_OpenR2_Sangoma_Asterisk

Actualizando los Equipos Xorcom de Elastix 1.6 a Elastix 2.2

Xorcom, nos envía el procedimiento de como actualizar los equipos de Xorcom de la versión 1.6 a la versión 2.2 de Elastix.

Ésta utileria de actualización fue desarrollada por Palosanto y modificada por Xorcom Ltd.

1. Descargar la utileria de actualización y descomprimirla:

cd /tmp
wget http://updates.xorcom.com/servers/tools/el-16to22-v1.tar.gz
tar xzf el-16to22-v1.tar.gz

2. Ejecutarl el “script” de actualización:

cd el-16to22-v1
./run-migrate

Si se ha cambiado la contraseña original de la base de datos en MySQL (eLaStIx.2oo7) entonces le será solicitada:

*** Stage_2: Migrate the MySQL databases.
The password (eLaStIx.2oo7) is not correct.
Please define the MySQL root’s password:
If the software upgrade has been completed successfully the following message will appear:
Complete!
*** Stage_9: Completed successfully.
Migration Complete Successful!!!…

3. Reinicie el servidor

4. Reinicie los dispositivos Astribank (en caso de tenerlo instalados):

/etc/init.d/asterisk stop
/etc/init.d/dahdi stop
/usr/share/dahdi/xpp_fxloader reset

Espere hasta que el comando lsusb muestre el estado e4e4:1162 de todos los dispositivos Astribank. Por ejemplo:

#lsusb
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 005: ID e4e4:1162
Bus 001 Device 001: ID e4e4:1162
Bus 003 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000

Inicie DAHDI and Asterisk de nuevo:

/etc/init.d/dahdi start
/etc/init.d/asterisk start

5. Acceda a la interfaz Web del PBX y aplique los cambios por medio del botón “PBX”->”PBX Configuration” “Apply Configuration Changes Here”.

Listo!

Asterisk 1.8 + ISDN PRI(Telmex) + Sangoma A101

Sé que cualquiera diría que la configuración de un enlace ISDN PRI de Telmex es muy trivial, y estoy de acuerdo, sin embargo me encontre con un pequeño problema; al poner el enlace al PBX solo podía recibir llamadas de la PSTN, pero no podía generar llamadas desde el PBX hacia la PSTN(nunca me había sucedido), recibía una causa de congestion ’0′.

rodman*CLI> console dial 04455XXXXXXXX@rodman
== Console is full duplex
— Executing [04455XXXXXXXX@rodman:1] Dial(“Console/dsp”, “DAHDI/1/04455XXXXXXXX”) in new stack
— Requested transfer capability: 0×00 – SPEECH
— Called DAHDI/1/04455XXXXXXXX
— DAHDI/i1/04455XXXXXXXXX-f is proceeding passing it to Console/dsp
— Span 1: Channel 0/1 got hangup request, cause 0
— Hungup ‘DAHDI/i1/04455XXXXXXXX-f’
== Everyone is busy/congested at this time (1:0/0/1)
— Auto fallthrough, channel ‘Console/dsp’ status is ‘CHANUNAVAIL’
rodman*CLI>

Esto era muy raro ya que con Dahdi 2.3 y Asterisk 1.4 (Elastix 1.6) no sucedía, obvio revise que mis configuraciones fueran las correctas, una vez que valide esto, que se me ocurre hablar al COR del Carrier para solicitar una traza del enlace al intentar enlazar una llamada… comentaron que ellos no veían ningun intento de llamada, ¡pufff!, habilite el debug del span para ver con más detalle si existía un problema; aquí el comando:

pri set debug on span 1

Una vez hablitado el debug el CLI mostraba lo siguiente:

rodman*CLI> console dial 53259000@rodman
== Console is full duplex
— Executing [53259000@rodman:1] Dial(“Console/dsp”, “DAHDI/g0/53259000″) in new stack
PRI Span: 1 — Making new call for cref 32770
— Requested transfer capability: 0×00 – SPEECH
PRI Span: 1
PRI Span: 1 > DL-DATA request
PRI Span: 1 > Protocol Discriminator: Q.931 (8)  len=31
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 2/0×2) (Sent from originator)
PRI Span: 1 > Message Type: SETUP (5)
PRI Span: 1 TEI=0 Transmitting N(S)=0, window is open V(A)=0 K=7
PRI Span: 1
PRI Span: 1 > TEI: 0 State 7(Multi-frame established)
PRI Span: 1 > V(A)=0, V(S)=0, V(R)=0
PRI Span: 1 > K=7, RC=0, l3_initiated=1, reject_except=0, ack_pend=0
PRI Span: 1 > T200_id=0, N200=3, T203_id=8192
PRI Span: 1 > [ 00 01 00 00 08 02 00 02 05 04 03 80 90 a3 18 03 a1 83 81 6c 02 21 80 70 09 80 35 37 33 35 33 39 39 30 a1 ]
PRI Span: 1 > Informational frame:
PRI Span: 1 > SAPI: 00  C/R: 0 EA: 0
PRI Span: 1 >  TEI: 000        EA: 1
PRI Span: 1 > N(S): 000   0: 0
PRI Span: 1 > N(R): 000   P: 0
PRI Span: 1 > 31 bytes of data
PRI Span: 1 > Protocol Discriminator: Q.931 (8)  len=31
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 2/0×2) (Sent from originator)
PRI Span: 1 > Message Type: SETUP (5)
PRI Span: 1 > [04 03 80 90 a3]
PRI Span: 1 > Bearer Capability (len= 5) [ Ext: 1  Coding-Std: 0  Info transfer capability: Speech (0)
PRI Span: 1 >                              Ext: 1  Trans mode/rate: 64kbps, circuit-mode (16)
PRI Span: 1 >

User information layer 1: A-Law (35)
PRI Span: 1 > [18 03 a1 83 81]
PRI Span: 1 > Channel ID (len= 5) [ Ext: 1  IntID: Implicit  Other(PRI)  Spare: 0  Preferred  Dchan: 0
PRI Span: 1 >                       ChanSel: As indicated in following octets
PRI Span: 1 >                       Ext: 1  Coding: 0  Number Specified  Channel Type: 3
PRI Span: 1 >                       Ext: 1  Channel: 1 Type: CPE]
PRI Span: 1 > [6c 02 21 80]
PRI Span: 1 > Calling Number (len= 4) [ Ext: 0  TON: National Number (2)  NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1)
PRI Span: 1 >                           Presentation: Presentation permitted, user number not screened (0)  '' ]
PRI Span: 1 > [70 09 80 35 37 33 35 33 39 39 30]
PRI Span: 1 > Called Number (len=11) [ Ext: 1  TON: Unknown Number Type (0)  NPI: Unknown Number Plan (0)  '53259000 ]
PRI Span: 1 > [a1]
PRI Span: 1 > Sending Complete (len= 1)
PRI Span: 1 — Stopping T203 timer
PRI Span: 1 — Starting T200 timer
PRI Span: 1 q931.c:6036 q931_setup: Call 32770 enters state 1 (Call Initiated).  Hold state: Idle
— Called DAHDI/g0/53259000
PRI Span: 1
PRI Span: 1 < TEI: 0 State 7(Multi-frame established)
PRI Span: 1 < V(A)=0, V(S)=1, V(R)=0
PRI Span: 1 < K=7, RC=0, l3_initiated=1, reject_except=0, ack_pend=0
PRI Span: 1 < T200_id=8192, N200=3, T203_id=0
PRI Span: 1 < [ 00 01 01 02 ]
PRI Span: 1 < Supervisory frame:
PRI Span: 1 < SAPI: 00  C/R: 0 EA: 0
PRI Span: 1 <  TEI: 000        EA: 1
PRI Span: 1 < Zero: 0     S: 0 01: 1  [ RR (receive ready) ]
PRI Span: 1 < N(R): 001 P/F: 0
PRI Span: 1 < 0 bytes of data
PRI Span: 1 — Got ACK for N(S)=0 to (but not including) N(S)=1
PRI Span: 1 — ACKing N(S)=0, tx_queue head is N(S)=-1 (-1 is empty, -2 is not transmitted)
PRI Span: 1 — Stopping T200 timer
PRI Span: 1 — Starting T203 timer
PRI Span: 1 Done handling message for SAPI/TEI=0/0
PRI Span: 1
PRI Span: 1 < TEI: 0 State 7(Multi-frame established)
PRI Span: 1 < V(A)=1, V(S)=1, V(R)=0
PRI Span: 1 < K=7, RC=0, l3_initiated=1, reject_except=0, ack_pend=0
PRI Span: 1 < T200_id=0, N200=3, T203_id=8192
PRI Span: 1 < [ 02 01 00 02 08 02 80 02 02 18 03 a9 83 81 ]
PRI Span: 1 < Informational frame:
PRI Span: 1 < SAPI: 00  C/R: 1 EA: 0
PRI Span: 1 <  TEI: 000        EA: 1
PRI Span: 1 < N(S): 000   0: 0
PRI Span: 1 < N(R): 001   P: 0
PRI Span: 1 < 10 bytes of data
PRI Span: 1 < Protocol Discriminator: Q.931 (8)  len=10
PRI Span: 1 < TEI=0 Call Ref: len= 2 (reference 2/0×2) (Sent to originator)
PRI Span: 1 < Message Type: CALL PROCEEDING (2)
PRI Span: 1 < [18 03 a9 83 81]
PRI Span: 1 < Channel ID (len= 5) [ Ext: 1  IntID: Implicit  Other(PRI)  Spare: 0  Exclusive  Dchan: 0
PRI Span: 1 <                       ChanSel: As indicated in following octets
PRI Span: 1 <                       Ext: 1  Coding: 0  Number Specified  Channel Type: 3
PRI Span: 1 <                       Ext: 1  Channel: 1 Type: CPE]
PRI Span: 1 — Got ACK for N(S)=1 to (but not including) N(S)=1
PRI Span: 1 — T200 requested to stop when not started
PRI Span: 1 T203 requested to start without stopping first
PRI Span: 1 — Starting T203 timer
PRI Span: 1 Received message for call 0x88c92d0 on link 0x85cd9ec TEI/SAPI 0/0
PRI Span: 1 — Processing IE 24 (cs0, Channel Identification)
PRI Span: 1 q931.c:8454 post_handle_q931_message: Call 32770 enters state 3 (Outgoing Call Proceeding).  Hold state: Idle
PRI Span: 1
PRI Span: 1 > TEI: 0 State 7(Multi-frame established)
PRI Span: 1 > V(A)=1, V(S)=1, V(R)=1
PRI Span: 1 > K=7, RC=0, l3_initiated=1, reject_except=0, ack_pend=0
PRI Span: 1 > T200_id=0, N200=3, T203_id=8192
PRI Span: 1 > [ 02 01 01 02 ]
PRI Span: 1 > Supervisory frame:
PRI Span: 1 > SAPI: 00  C/R: 1 EA: 0
PRI Span: 1 >  TEI: 000        EA: 1
PRI Span: 1 > Zero: 0     S: 0 01: 1  [ RR (receive ready) ]
PRI Span: 1 > N(R): 001 P/F: 0
PRI Span: 1 > 0 bytes of data
PRI Span: 1 Done handling message for SAPI/TEI=0/0
Span: 1 Processing event: PRI_EVENT_PROCEEDING
— DAHDI/i1/53259000-2 is proceeding passing it to Console/dsp
PRI Span: 1
PRI Span: 1 < TEI: 0 State 7(Multi-frame established)
PRI Span: 1 < V(A)=1, V(S)=1, V(R)=1
PRI Span: 1 < K=7, RC=0, l3_initiated=1, reject_except=0, ack_pend=0
PRI Span: 1 < T200_id=0, N200=3, T203_id=8192
PRI Span: 1 < [ 02 01 02 02 08 02 80 02 45 08 03 02 80 9c 1e 02 82 88 ]
PRI Span: 1 < Informational frame:
PRI Span: 1 < SAPI: 00  C/R: 1 EA: 0
PRI Span: 1 <  TEI: 000        EA: 1
PRI Span: 1 < N(S): 001   0: 0
PRI Span: 1 < N(R): 001   P: 0
PRI Span: 1 < 14 bytes of data
PRI Span: 1 < Protocol Discriminator: Q.931 (8)  len=14
PRI Span: 1 < TEI=0 Call Ref: len= 2 (reference 2/0×2) (Sent to originator)
PRI Span: 1 < Message Type: DISCONNECT (69)
PRI Span: 1 < [08 03 02 80 9c]
PRI Span: 1 < Cause (len= 5) [ Ext: 0  Coding: CCITT (ITU) standard (0)  Spare: 0  Location: Public network serving the local user (2)
PRI Span: 1 <                  Ext: 1  Cause: Unknown (0), class = Normal Event (0) ]
PRI Span: 1 <              Cause data 1: 9c (156)
PRI Span: 1 < [1e 02 82 88]
PRI Span: 1 < Progress Indicator (len= 4) [ Ext: 1  Coding: CCITT (ITU) standard (0)  0: 0  Location: Public network serving the local user (2)
PRI Span: 1 <                               Ext: 1  Progress Description: Inband information or appropriate pattern now available. (8) ]
PRI Span: 1 — Got ACK for N(S)=1 to (but not including) N(S)=1
PRI Span: 1 — T200 requested to stop when not started
PRI Span: 1 T203 requested to start without stopping first
PRI Span: 1 — Starting T203 timer
PRI Span: 1 Received message for call 0x88c92d0 on link 0x85cd9ec TEI/SAPI 0/0
PRI Span: 1 — Processing IE 8 (cs0, Cause)
PRI Span: 1 — Processing IE 30 (cs0, Progress Indicator)
PRI Span: 1 — Found active call: 0x88c92d0 cref:32770
PRI Span: 1 q931.c:8707 post_handle_q931_message: Call 32770 enters state 12 (Disconnect Indication).  Hold state: Idle
PRI Span: 1
PRI Span: 1 > TEI: 0 State 7(Multi-frame established)
PRI Span: 1 > V(A)=1, V(S)=1, V(R)=2
PRI Span: 1 > K=7, RC=0, l3_initiated=1, reject_except=0, ack_pend=0
PRI Span: 1 > T200_id=0, N200=3, T203_id=8192
PRI Span: 1 > [ 02 01 01 04 ]
PRI Span: 1 > Supervisory frame:
PRI Span: 1 > SAPI: 00  C/R: 1 EA: 0
PRI Span: 1 >  TEI: 000        EA: 1
PRI Span: 1 > Zero: 0     S: 0 01: 1  [ RR (receive ready) ]
PRI Span: 1 > N(R): 002 P/F: 0
PRI Span: 1 > 0 bytes of data
PRI Span: 1 Done handling message for SAPI/TEI=0/0
Span: 1 Processing event: PRI_EVENT_HANGUP_REQ
— Span 1: Channel 0/1 got hangup request, cause 0
PRI Span: 1 q931.c:6837 q931_hangup: Hangup other cref:32770
PRI Span: 1 q931.c:6594 __q931_hangup: ourstate Disconnect Indication, peerstate Disconnect Request, hold-state Idle
PRI Span: 1 q931.c:5703 q931_release: Call 32770 enters state 19 (Release Request).  Hold state: Idle
PRI Span: 1
PRI Span: 1 > DL-DATA request
PRI Span: 1 > Protocol Discriminator: Q.931 (8)  len=9
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 2/0×2) (Sent from originator)
PRI Span: 1 > Message Type: RELEASE (77)
PRI Span: 1 TEI=0 Transmitting N(S)=1, window is open V(A)=1 K=7
PRI Span: 1
PRI Span: 1 > TEI: 0 State 7(Multi-frame established)
PRI Span: 1 > V(A)=1, V(S)=1, V(R)=2
PRI Span: 1 > K=7, RC=0, l3_initiated=1, reject_except=0, ack_pend=0
PRI Span: 1 > T200_id=0, N200=3, T203_id=8192
PRI Span: 1 > [ 00 01 02 04 08 02 00 02 4d 08 02 81 90 ]
PRI Span: 1 > Informational frame:
PRI Span: 1 > SAPI: 00  C/R: 0 EA: 0
PRI Span: 1 >  TEI: 000        EA: 1
PRI Span: 1 > N(S): 001   0: 0
PRI Span: 1 > N(R): 002   P: 0
PRI Span: 1 > 9 bytes of data
PRI Span: 1 > Protocol Discriminator: Q.931 (8)  len=9
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 2/0×2) (Sent from originator)
PRI Span: 1 > Message Type: RELEASE (77)
PRI Span: 1 > [08 02 81 90]
PRI Span: 1 > Cause (len= 4) [ Ext: 1  Coding: CCITT (ITU) standard (0)  Spare: 0  Location: Private network serving the local user (1)
PRI Span: 1 >                  Ext: 1  Cause: Normal Clearing (16), class = Normal Event (1) ]
PRI Span: 1 — Stopping T203 timer
PRI Span: 1 — Starting T200 timer

Con el debug note que el Carrier no sabía o no identificaba la marcación que yo le estaba envíando por lo que solo agregue la siguiente línea en chan_dahdi.conf:

pridialplan=local

Una vez con esto en el CLI vemos que la llamada ya se establece:

rodman*CLI> console dial 53259000@rodman
== Console is full duplex
— Executing [53259000@rodman:1] Dial(“Console/dsp”, “DAHDI/g0/53259000″) in new stack
— Requested transfer capability: 0×00 – SPEECH
— Called DAHDI/g0/53259000
— DAHDI/i1/53259000-1 is proceeding passing it to Console/dsp
— DAHDI/i1/53259000-1 is ringing
— DAHDI/i1/53259000-1 is making progress passing it to Console/dsp
rodman*CLI> con
config   console
rodman*CLI> console hangup
— Hungup ‘DAHDI/i1/53259000-1′
== Spawn extension (rodman, 53259000, 1) exited non-zero on ‘Console/dsp’
<< Hangup on console >>

Les dejo los archivos de configuración.

——————- CHAN_DAHDI.CONF ————————

[trunkgroups]

[channels]
context=default
usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
relaxdtmf=yes
rxgain=0.0
txgain=0.0
group=0
callgroup=1
pickupgroup=1
immediate=no

;Sangoma A101 port 1 [slot:4 bus:4 span:1] <wanpipe1>
switchtype=euroisdn
context=from-pstn
group=0
echocancel=yes
signalling=pri_cpe

prilocaldialplan=unknown
pridialplan=local

channel =>1-10

——————- SYSTEM.CONF ————————

loadzone=us
defaultzone=us

#Sangoma A101 port 1 [slot:4 bus:4 span:1] <wanpipe1>
span=1,1,0,ccs,hdb3
bchan=1-10
echocanceller=mg2,1-10
hardhdlc=16

——————- WANPIPE1.CONF ————————

[devices]
wanpipe1 = WAN_AFT_TE1, Comment

[interfaces]
w1g1 = wanpipe1, , TDM_VOICE, Comment

[wanpipe1]
CARD_TYPE       = AFT
S514CPU         = A
CommPort        = PRI
AUTO_PCISLOT    = NO
PCISLOT         = 4
PCIBUS          = 4
FE_MEDIA        = E1
FE_LCODE        = HDB3
FE_FRAME        = NCRC4
FE_LINE         = 1
TE_CLOCK        = NORMAL
TE_REF_CLOCK    = 0
TE_SIG_MODE     = CCS
TE_HIGHIMPEDANCE        = NO
TE_RX_SLEVEL    = 430
LBO             = 120OH
FE_TXTRISTATE   = NO
MTU             = 1500
UDPPORT         = 9000
TTL             = 255
IGNORE_FRONT_END        = NO
TDMV_SPAN               = 1
TDMV_DCHAN              = 16
TE_AIS_MAINTENANCE = NO         #NO: defualt  YES: Start port in AIS Blue Alarm and keep line down

#wanpipemon -i w1g1 -c Ttx_ais_off to disable AIS maintenance mode
#wanpipemon -i w1g1 -c Ttx_ais_on to enable AIS maintenance mode
TDMV_HW_DTMF            = NO            # YES: receive dtmf events from hardware
TDMV_HW_FAX_DETECT              = NO            # YES: receive fax 1100hz events from hardware
HWEC_OPERATION_MODE     = OCT_NORMAL    # OCT_NORMAL: echo cancelation enabled with nlp (default)
# OCT_SPEECH: improves software tone detection by disabling NLP (echo possible)
# OCT_NO_ECHO:disables echo cancelation but allows VQE/tone functions.
HWEC_DTMF_REMOVAL       = NO    # NO: default  YES: remove dtmf out of incoming media (must have hwdtmf enabled)
HWEC_NOISE_REDUCTION    = NO    # NO: default  YES: reduces noise on the line – could break fax
HWEC_ACUSTIC_ECHO       = NO    # NO: default  YES: enables acustic echo cancelation
HWEC_NLP_DISABLE        = NO    # NO: default  YES: guarantees software tone detection (possible echo)
HWEC_TX_AUTO_GAIN       = 0     # 0: disable   -40-0: default tx audio level to be maintained (-20 default)
HWEC_RX_AUTO_GAIN       = 0     # 0: disable   -40-0: default tx audio level to be maintained (-20 default)
HWEC_TX_GAIN            = 0             # 0: disable   -24-24: db values to be applied to tx signal
HWEC_RX_GAIN            = 0             # 0: disable   -24-24: db values to be applied to tx signal 

[w1g1]
ACTIVE_CH       = ALL
TDMV_HWEC       = NO
MTU             = 8

 

Versiones utilizadas:

  • Elastix 2.2
  • Asterisk 1.8.7.0
  • DAHDI Version: 2.4.1.2
  • WANPIPE Release: 3.5.23

Referencia:

http://lists.digium.com/pipermail/asterisk-users/2005-May/102837.html

Espero les sirva.

@rodman1942

Obteniendo y analizando trazados PRI/BRI/SS7/WAN con Wireshark y Sangoma

Pues Sangoma a través de su Wiki publica un “How-to” para obtener trazados PRI/BRI/SS7/WAN con Wireshark.

Ésta es la liga. [http://wiki.sangoma.com/wanpipe-wireshark-pcap-pri-bri-wan-t1-e1-tracing]

Es recomendable, para la gente que no le gusta emplear la consola de Asterisk

@el_jerry

Jugando con Vtiger y Elastix 2.2

Pues resulta que un cliente me solicitó apoyarlo con una demo para hacer una especie de CTI entre Vtiger y Elastix;  y la  idea es que se tenga un grupo de agentes contestando llamadas a través del sistema de manejo de Colas de Asterisk/Elastix.

Este cliente me trajo un servidor con la versión 2.0 de Elastix, Asterisk 1.6 y Vtiger 5.1.0  y seguí los pasos propuestos aquí y aquí . Al final del día los “scripts” propuestos, tardaban años en efectuar el “pop-up” de la llamada con el CallerId del llamante. En algunos casos ni lo hacia :S.

Después de un largo batallar opté por tomar uno de mis servers Dell PowerEdge y hacer una instalación limpia y plana de Elastix 2.2. No sé que tanto le habia metido el cliente a su server que al final del día nada funcionaba. De las ligas arriba mencionada, en la consola de “El Elastix” , a pesar de emplear la version 1.8.7.0 para Asterisk y seguir con la version 5.1.0 de Vtiger, actualicé en la base de datos de éste último la versión de Asterisk por medio del query:
update vtiger_asterisk set version=1.6;.

Finalmente adecué un script viejito que encontré en la red para que funcione con las modificaciones del AMI de Asterisk para 1.6/1.8 y listo. El script no se muere, se ejecuta rápidamente (los 2 rings que tarda la PSTN en enviar el CallerID sobre troncales analógicas).

Posteriormente troncalicé éste Elastix con el PBX de Neocenter vía SIP, efectué unas modificaciones al IVR principal, y listo. Las llamadas que entran por la PSTN al PBX de Neocenter, se reenvian vía SIP a una cola del PBX “demo” en el que se encuentra configurada una cola con un agente estático. El CallerID pasa sin problemas y el “pop-up” se desplega de manera eficiente. Veremos cómo se comporta el Demo cuando se tienen varios agentes y colas funcionando.

Espero que les sirva.

Aqui va el script que usé.


#!/usr/bin/php
/***********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
* Some Code added by dicko for the Elastix Project
************************************************************************************/

/**
* this file will be run as a shell script (in linux) or a batch file (under windows).
* the purpose of the file is to create a master socket which will be connecting to the asterisk server
* and to keep it (the socket) alive all the time.
*/

ini_set("include_path", "/var/www/html/vtigercrm/");

require_once('modules/PBXManager/utils/AsteriskClass.php');
require_once('config.php');
require_once('include/utils/utils.php');
require_once('include/language/en_us.lang.php');
require_once('modules/PBXManager/AsteriskUtils.php');

asteriskClient();

/**
* this function defines the asterisk client
*/

function asteriskClient(){
global $app_strings, $current_user;
global $adb, $log;

$data = getAsteriskInfo($adb);
$server = $data['server'];
$port = $data['port'];
$username = $data['username'];
$password = $data['password'];
$version = $data['version'];

$errno = $errstr = NULL;
$sock = @fsockopen($server, $port, $errno, $errstr, 1);
stream_set_blocking($sock, true);
if( $sock === false ) {
echo "Socket cannot be created due to error: $errno: $errstr\n";
$log->debug(“Socket cannot be created due to error: $errno: $errstr\n”);
exit(0);
}else{
echo “Date: “.date(“d-m-Y”).”\n”;
echo “Connecting to asterisk server…..\n”;
$log->debug(“Connecting to asterisk server…..\n”);
}
echo “Connected successfully\n\n\n”;
$asterisk = new Asterisk($sock, $server, $port);

authorizeUser($username, $password, $asterisk);

//keep looping continuosly to check if there are any calls
while (true) {
//check for incoming calls and insert in the database
$incoming = handleIncomingCalls($asterisk, $adb, $version);
}
fclose($sock);
unset($sock);
}

/**
* this function checks if there are any incoming calls for the current user
* if any call is found, it just inserts the values into the vtiger_asteriskincomingcalls table
*
* @param $asterisk – the asterisk object
* @param $adb – the peardatabase type object
* @return incoming call information if successful
* false if unsuccessful
*/
function handleIncomingCalls($asterisk, $adb, $version=”1.4″){

$response = $asterisk->getAsteriskResponse();
if(empty($response)){
return false;
}

if($version == “1.6″){
$state = “ChannelStateDesc”;
}else{
$state = “State”;
}

echo “START”;

if($response['Event'] == ‘Dial’){
// if(($response['Event'] == ‘Newstate’ || $response['Event'] == ‘Newchannel’) && ($response[$state] == ‘Ring’ || $response[$state] == ‘Ringing’)){
print date(‘m/d/Y H:i:s’).” – Event: “.$response['Event']. ” | “;
Print_r($response);

$dest = explode(“/”,$response['Destination']);
$ext = explode(“-”,$dest[1]);

$extension=$ext[0];
$callerType=$dest[0];
//$callerType=”";
$callerNumber=$response['CallerIDNum'];
$callerName=$response['CallerIDName'];

print “To: “.$extension.” From: “.$callerName.” <".$callerNumber.">\n”;

if(checkExtension($extension, $adb)){

print date(‘m/d/Y H:i:s’).” – AddToMysqld | To: “.$extension.” From: “.$callerName.” <".$callerNumber.">\n”;

//insert into database
$sql = “insert into vtiger_asteriskincomingcalls values (?,?,?,?,?,?)”;
$flag= 0;
$timer = time();
$params = array($callerNumber, $callerName, $extension, $callerType,$flag,$timer);
$adb->pquery($sql, $params);
addToCallHistory($extension, $callerType.”:”.$callerNumber, $extension, “incoming”, $adb);
// break; //break the while loop
}

return true;
}
else
{
print date(‘m/d/Y H:i:s’).” – Event: “.$response['Event'].” \r”;
return false;
}

}

/**
* this function takes a XML response and converts it to an array format
* @param string $response – the xml response
* @return the xml formatted into an array
*/
function getArray($xml){
$lines = explode(“\r\n”, $xml);

$response = array();
foreach($lines as $line){
list($key, $value) = explode(“:”, $line);
$response[$key] = $value;
}
return $response;
}

/**
* this function checks if the given extension is a valid vtiger extension or not
* if yes it returns true
* if not it returns false
*
* @param string $ext – the extension to be checked
* @param object $adb – the peardatabase object
*/
function checkExtension($ext, $adb){
$sql = “select * from vtiger_asteriskextensions where asterisk_extension=’$ext’ and use_asterisk=1 limit 1″;
$result = $adb->pquery($sql, array());

if($adb->num_rows($result)>0){

return true;
}else{
return false;
}
}
?>

Saluditos
by @el_jerry

 

Xorcom – Concordancia de puertos y número de extensiones.

Con ayuda de este video podremos identificar que extensión corresponde a que puerto en un Xorcom de la Serie XE.

Xorcom – Concordancia de puertos y extensiones.

Espero les sirva.

Saludos.

@rodman1942

Integración Asterisk-Nortel en MFC/R2

La semana pasada nos vimos en el reto de interconectar un Nortel Meridian Opcion 11 con Asterisk y una A102 de Sangoma.

Al principio se nos dijo que se trataba de un enlace ISDN/PRI, pero preguntando con el Operador del Nortel, nos comentó que ell enlace era un DTI T2. Investigando, encontramos que Nortel le llama DTI T2 a un enlace en R2, aunque nunca se nos dijo si era R2 Modificado (MFC/R2) o simplemente R2. Creemos suponer que un enlace DTI T1 corresponde a un enlace ISDN/PRI con señalización tipo “National” o DMS100.

Después de contactar a un experto en Nortel, se configuró en enlace y todo funcionó. Hay que señalar que ésta vez Nortel se tuvo que “acoplar” a Asterisk y no al revés.

La configuración de Asterisk quedó asi:

span=1,1,0,cas,hdb3
cas=1-15, 17-31:1101

loadzone        = mx
defaultzone     = mx

Algo curioso que nos sucedió es que al configurar /etc/dahdi/system.conf de la siguiente manera, se desbloqueaban 8 canales y los siguientes 4 se bloqueaban, y los 8 subsecuentes se desbloqueaban, etc.
cas=1-15:1101
cas=17-31:1101

 

La configuración de chan_dadhi.conf referente a la señalización quedó asi:

 

context=from-pstn

language=es

signalling=mfcr2

mfcr2_variant=mx

mfcr2_get_ani_first=no

mfcr2_max_ani=20

mfcr2_max_dnis=4

mfcr2_category=national_subscriber

mfcr2_mfback_timeout=-1

mfcr2_metering_pulse_timeout=-1

mfcr2_allow_collect_calls=no

mfcr2_double_answer=no

mfcr2_charge_calls=yes

 

Esta es la configuración final del enlace DTI T2:

 

RUTA

————————————————————————————————————

TYPE RDB

CUST 00

DMOD

ROUT 11

DES ELECTROSYSTEMS

TKTP TIE

NPID_TBL_NUM 0

ESN NO

RPA NO

CNVT NO

SAT NO

RCLS EXT

VTRK NO

DTRK YES

DGTP DTI2

DSEL VOD

PTYP DTT

AUTO NO

DNIS NO

ICOG IAO

SRCH RRB

TRMB YES

STEP

ACOD 7111

TARG

CLEN 1

BILN NO

OABS

INST

IDC NO

DCNO 0 *

NDNO 0

DEXT NO

ANTK

SIGO STD

STYP SDAT

MFC R2MF

INDMF NO

MFCI 1

R2MD NO

SGL NO

BSSU NO

MFCO 2

OPP NORM

SWP NORM

ICIS YES

ICNP UKWN

ICNT UKWN

ICPS YES

OGIS YES

PTUT 0

TIMR MFC 12032

MFO 0

MFID 0

ICF 512

OGF 512

EOD 13952

DSI 34944

NRD 10112

DDL 70

ODT 4096

RGV 640

GTO 896

PAGE 002

GTI 896

SFB 3

TFD 0

SST 5 0

DTD NO

SCDT NO

2 DT NO

NEDC ETH

FEDC ETH

CPDC NO

DLTN NO

HOLD 02 02 40

SEIZ 02 02

SVFL 02 02

DRNG NO

CDR NO

NATL YES

SSL

CFWR NO

IDOP NO

MUS NO

PANS YES

MANO NO

FRL 0 7

FRL 1 7

FRL 2 7

FRL 3 7

FRL 4 7

FRL 5 7

FRL 6 7

FRL 7 7

AUTH NO

TTBL 1

PNNC NO

ATAN NO

OHTD NO

PLEV 2

OPR NO

ALRM NO

NCNI 0

CNIE NO

CNIT NO

CTAT YES

ART 0

OPDL 0

PECL NO

DCTI 0

TIDY 7711 11

NADT 0

SGRP 0

FRIN NO

RRBS NO

RLSM 0

CCBA NO

AACR NO

 

____________________________________________

 

TRONCAL

 

DES ELECTRO

TN 006 01

TYPE TIE

CUST 0

TRK DTI2

SICA 1

PDCA 1

PCML A

NCOS 0

RTMB 11 1

TGAR 0

AST NO

IAPG 0

CLS UNR MFC CNA WTA LPR APN THFD XREP

P10 MID

MFLI 0

MFPD NO

TKID

DATE 6 MAR 2009

 

____________________________________________

 

TABLA DE R2 DE ENTRADA

 

TYPE R2MF

ICOG ICT

MAXT 5

TBNO 1

EECD 1

SMFC NO

SCNT NO

CNDR NO

LVNO 1

RECV 1 DGT1

2 DGT2

3 DGT3

4 DGT4

5 DGT5

6 DGT6

7 DGT7

8 DGT8

9 DGT9

10 DGT0

11 HTDM

12 ECNI

15 EODL

XMIT NEXT 1

TERM 3

COMP 3

CONG 4

SCAT 6

SCNI 1

FAIL 15

TYPE R2MF

ICOG ICT

MAXT 5

TBNO 1

EECD 1

LVNO 2

RECV 1 NOPR

2 PRIO

3 NOPR

5 OPER

6 NOPR

7 REST

8 NOPR

9 PRIO

10 OPER

11 NOPR

12 NOPR

13 NOPR

XMIT IDLE 1

BUSY 2

CONG 4

VACC 5

OUTT 8

FAIL 9

 

 

____________________________________________

 

TABLA DE R2 DE SALIDA

 

TYPE R2MF

ICOG OGT

MAXT 5

TBNO 2

SET 1

ATT 1

TIE 6

NTT 6

EECD 2

SMFC NO

SCNT NO

CNDR NO

LVNO 1

RECV 1 NEXT

2 TNM1

3 COMP

4 CONG

5 CCNI

6 SCAT    <—ESTO ES MUY IMPORTANTE CUANDO SE USA LA VARIANTE MX Y ASTERISK

7 TNM2

8 TNM3

9 SCNI

10 TFST

11 TNXT

15 FAIL

XMIT DGT1 1

DGT2 2

DGT3 3

DGT4 4

DGT5 5

DGT6 6

DGT7 7

DGT8 8

DGT9 9

DGT0 10

ECNI 12

EODL 15

HTDM 11

TYPE R2MF

ICOG OGT

MAXT 5

TBNO 2

SET 1

ATT 1

TIE 6

NTT 6

EECD 2

LVNO 2

RECV 1 IDLE

2 BUSY

4 CONG

5 VACC

8 OUTT

9 FAIL

XMIT NOPR 2

OPER 5

REST 7

 

____________________________________________

 

TABLA SEÑALIZACION SICA

 

IN/OUT CALLS

IDLE (S)1001

IDLE (R)1001

FALT (S)1101

FALT (R)1101

TIME 0

P RRC (S)UNUSED

INCOMING CALLS

E SEZ (R)0001

SEZD (R)UNUSED

SEZV (R)UNUSED

P CALL (R)UNUSED

SEZA (S)1101

TIME 150

FSZA NO

PRCS (S)UNUSED

P WNKS (S)UNUSED

P DIGT (R)UNUSED

NRCV (S)UNUSED

P EOSF (S)UNUSED

EOSF (S)UNUSED

P EOSB (S)UNUSED

EOSB (S)UNUSED

P OPCA (R)UNUSED

E CONN (S)0101

CONN (R)0001

P BURS (S)UNUSED

P BURS (R)UNUSED

C CLRB (S)1101

P RCTL (S)UNUSED

P RCOD (S)UNUSED

P OPRS (R)UNUSED

P NXFR (S)UNUSED

P ESNW (S)UNUSED

P CAS (S)UNUSED

CLRF (R)UNUSED

SOS (R)UNUSED

P BRLS (S)UNUSED

P FRLS (R)UNUSED

OUTGOING CALLS

E SEZ (S)0001

SEZD (S)UNUSED

SEZV (S)UNUSED

SEZA (R)1101

P WNKS (R)UNUSED

P EOS (R)UNUSED

CONN (S)0001

E CONN (R)0101

P OPRC (R)UNUSED

P BURS (S)UNUSED

P BURS (R)UNUSED

C CLRB (R)1101

P RCTL (R)UNUSED

P NXFR (R)UNUSED

P ESNW (R)UNUSED

P CAS (R)UNUSED

CLRF (S)UNUSED

SOS (R)UNUSED

P FRLS (S)UNUSED

P BRLS (R)UNUSED

 

____________________________________________

 

CONFIGURACION DEL CCS (CONTROLLED CLASS OF SERVICE)

 

NOTA: PARA QUE PUEDA CONECTAR UNA TRONCAL TIE CON UNA TRONCAL DID NECESITA ESTAR SIN RESTRICCIONES EL CCRS

 

REQ: PRT

TYPE: CCS

TYPE CCS_DATA

CUST 0

TYPE CCS_DATA

CUST 00

CCRS UNR

ECC1 UNR

ECC2 UNR

CNCS

PELK NO

 

Esperamos que les sea de utilidad @el_jerry

 

 

Elastix Market Place

Elastix lanza su propio Marketplace, en el cual se tendrá la opción de instalar software escrito por terceros, de manera sencilla y eficaz, totalmente compatibles con la Distribución.

Este es el lanzamiento oficial: http://elx.ec/empesp

@jerry

Cómo Usar el módulo Custom-context de FreePBX

Bueno, aqui les dejamos un videito de cómo descargar, instalar, configurar y usar el módulo Custom-Context de FreePBX, que como su nombre nos dice, nos permite crear y manejar diferentes contextos de las extensiones SIP.

Por @jerry

Neocenter Voip Toip