[AsteriskBrasil] DISA e Interligacao entre asterisk (via SIP)

César Davi Avila do Nascimento cesargxn em gmail.com
Quinta Julho 9 13:13:01 BRT 2009


Pessoal,

Estou precisando testar o seguinte cenário:

+-----------+       +-----------+
| asterisk 1|       | asterisk 2|
+-----------+       +-----------+
       |                  |

       |                  |
_______|__________________|___________
      |                      |
      |                      |
      |                      |
  +-------+              +-------+

  | ATA 1 |              | ATA 2 |
  +-------+              +-------+
    /  \                   /  \
   /    \                 /    \

    21     22                     10        11


Ou seja, tenho 2 asterisks interligados via SIP, dois ATAs com duas linhas,
sendo que o ATA1 está registrado no asterisk 1 e o ATA 2 está registrado no
asterisk 2 e, todas as chamadas entrantes no asterisk2 vindas do asterisk 1
(via SIP), são atendidas por um DISA.

Consigo fazer ligações do ATA 1 para o ATA 2 sem problemas (a chamada
vai até o asterisk1 é roteada para o asterisk 2, cai no DISA e eu
chamo um dos telefones do ATA2). Estou tentando agora fazer com que a
chamada vinda por exemplo do ramal 21, vá até o asterisk 2, caia no
DISA e retorne para o asterisk 1 (no ramal 22).


Como sou newbie no assunto, gostaria de saber com os amigos da lista
se isto é possível... Ou se existe uma outra forma de fazer isso....
Abaixo segue meus arquivos de conf.

Grande abraço

César


===============================================================================================================================

Arquivos de conf do asterisk 1

******
sip.conf
********

[21]
type=friend

context=phones               	; Where to start in the dialplan when
this phone calls
secret=21
;callerid=John Doe <1234>       ; Full caller ID, to override the phones config
                                ; on incoming calls to Asterisk

host=dynamic              	; we have a static but private IP address
                                ; No registration allowed
;nat=no                         ; there is not NAT between phone and Asterisk
;canreinvite=yes                ; allow RTP voice traffic to bypass Asterisk

;dtmfmode=info                  ; either RFC2833 or INFO for the BudgeTone
;call-limit=1                   ; permit only 1 outgoing call and 1
incoming call at a time
                                ; from the phone to asterisk

                                ; 1 for the explicit peer, 1 for the
explicit user,
                                ; remember that a friend equals 1 peer
and 1 user in
                                ; memory
                                ; This will affect your subscriptions as well.

                                ; There is no combined call counter
for a "friend"
                                ; so there's currently no way in
sip.conf to limit
                                ; to one inbound or outbound call per phone. Use

                                ; the group counters in the dial plan for that.
                                ;
;mailbox=1234 em default           ; mailbox 1234 in voicemail context "default"
disallow=all                   ; need to disallow=all before we can use allow=

allow=ulaw                     ; Note: In user sections the order of codecs
                                ; listed with allow= does NOT matter!
allow=alaw
allow=g723.1                   ; Asterisk only supports g723.1 pass-thru!

allow=g729                     ; Pass-thru only unless g729 license obtained
;callingpres=allowed_passed_screen        ; Set caller ID presentation
                                ; See doc/callingpres.txt for more information


[22]
type=friend
context=phones               	; Where to start in the dialplan when
this phone calls
secret=22
;callerid=John Doe <1234>       ; Full caller ID, to override the phones config

                                ; on incoming calls to Asterisk
host=dynamic              	; we have a static but private IP address
                                ; No registration allowed
;nat=no                         ; there is not NAT between phone and Asterisk

;canreinvite=yes                ; allow RTP voice traffic to bypass Asterisk
;dtmfmode=info                  ; either RFC2833 or INFO for the BudgeTone
;call-limit=1                   ; permit only 1 outgoing call and 1
incoming call at a time

                                ; from the phone to asterisk
                                ; 1 for the explicit peer, 1 for the
explicit user,
                                ; remember that a friend equals 1 peer
and 1 user in

                                ; memory
                                ; This will affect your subscriptions as well.
                                ; There is no combined call counter
for a "friend"

                                ; so there's currently no way in
sip.conf to limit
                                ; to one inbound or outbound call per phone. Use
                                ; the group counters in the dial plan for that.

                                ;
;mailbox=1234 em default           ; mailbox 1234 in voicemail context "default"
disallow=all                   ; need to disallow=all before we can use allow=
allow=ulaw                     ; Note: In user sections the order of codecs

                                ; listed with allow= does NOT matter!
allow=alaw
allow=g723.1                   ; Asterisk only supports g723.1 pass-thru!
allow=g729                     ; Pass-thru only unless g729 license obtained

;callingpres=allowed_passed_screen        ; Set caller ID presentation
                                ; See doc/callingpres.txt for more information

;comunicação entre asterisks

[asterisk2]
type=friend

secret=welcome
context=asterisk2_incoming
host=dynamic
disallow=all                   ; need to disallow=all before we can use allow=
allow=ulaw                     ; Note: In user sections the order of codecs

                                ; listed with allow= does NOT matter!
allow=alaw
allow=g723.1                   ; Asterisk only supports g723.1 pass-thru!
allow=g729                     ; Pass-thru only unless g729 license obtained


******
extensions.conf
******

[phones]
include=>internal
include=>remote


[internal]
exten=>_2x,1,NoOp()
exten=>_2x,n,Dial(SIP/${EXTEN},30)
exten=>_2x,n,Hangup()


[remote]
;exten=>_1x,1,NoOp()
exten=>_1x,1,Dial(SIP/asterisk2/${EXTEN})
exten=>_3x,1,Dial(SIP/asterisk2/${EXTEN})
exten=>_1x,n+101,Hangup()
exten=>_3x,n+101,Hangup()

[asterisk2_incoming]

include=>internal

**************************************************
Arquivos de conf do asterisk 2

******
sip.conf
*******

[10]
type=friend
context=phones               ; Where to start in the dialplan when
this phone calls

secret=10
;callerid=John Doe <1234>       ; Full caller ID, to override the phones config
                                ; on incoming calls to Asterisk
host=dynamic              	; we have a static but private IP address

                                ; No registration allowed
;nat=no                         ; there is not NAT between phone and Asterisk
;canreinvite=yes                ; allow RTP voice traffic to bypass Asterisk

;dtmfmode=info                  ; either RFC2833 or INFO for the BudgeTone
;call-limit=1                   ; permit only 1 outgoing call and 1
incoming call at a time
                                ; from the phone to asterisk

                                ; 1 for the explicit peer, 1 for the
explicit user,
                                ; remember that a friend equals 1 peer
and 1 user in
                                ; memory
                                ; This will affect your subscriptions as well.

                                ; There is no combined call counter
for a "friend"
                                ; so there's currently no way in
sip.conf to limit
                                ; to one inbound or outbound call per phone. Use

                                ; the group counters in the dial plan for that.
                                ;
;mailbox=1234 em default           ; mailbox 1234 in voicemail context "default"
disallow=all                   ; need to disallow=all before we can use allow=

allow=ulaw                     ; Note: In user sections the order of codecs
                                ; listed with allow= does NOT matter!
allow=alaw
allow=g723.1                   ; Asterisk only supports g723.1 pass-thru!

allow=g729                     ; Pass-thru only unless g729 license obtained
;callingpres=allowed_passed_screen        ; Set caller ID presentation
                                ; See doc/callingpres.txt for more information


[11]
type=friend
context=phones               ; Where to start in the dialplan when
this phone calls
secret=11
;callerid=John Doe <1234>       ; Full caller ID, to override the phones config

                                ; on incoming calls to Asterisk
host=dynamic              	; we have a static but private IP address
                                ; No registration allowed
;nat=no                         ; there is not NAT between phone and Asterisk

;canreinvite=yes                ; allow RTP voice traffic to bypass Asterisk
;dtmfmode=info                  ; either RFC2833 or INFO for the BudgeTone
;call-limit=1                   ; permit only 1 outgoing call and 1
incoming call at a time

                                ; from the phone to asterisk
                                ; 1 for the explicit peer, 1 for the
explicit user,
                                ; remember that a friend equals 1 peer
and 1 user in

                                ; memory
                                ; This will affect your subscriptions as well.
                                ; There is no combined call counter
for a "friend"

                                ; so there's currently no way in
sip.conf to limit
                                ; to one inbound or outbound call per phone. Use
                                ; the group counters in the dial plan for that.

                                ;
;mailbox=1234 em default           ; mailbox 1234 in voicemail context "default"
disallow=all                   ; need to disallow=all before we can use allow=
allow=ulaw                     ; Note: In user sections the order of codecs

                                ; listed with allow= does NOT matter!
allow=alaw
allow=g723.1                   ; Asterisk only supports g723.1 pass-thru!
allow=g729                     ; Pass-thru only unless g729 license obtained

;callingpres=allowed_passed_screen        ; Set caller ID presentation
                                ; See doc/callingpres.txt for more information

;****
;**** Comunicação entre asterisks
;****

[asterisk1]

type=friend
secret=welcome
context=asterisk1_incoming
host=dynamic
disallow=all                   ; need to disallow=all before we can use allow=
allow=ulaw                     ; Note: In user sections the order of codecs

                                ; listed with allow= does NOT matter!
allow=alaw
allow=g723.1                   ; Asterisk only supports g723.1 pass-thru!
allow=g729                     ; Pass-thru only unless g729 license obtained


*****************************************************************
extensions.conf

[phones]
include=>internal
include=>remote


[internal]
exten=>_1x,1,NoOp()
exten=>_1x,n,Dial(SIP/${EXTEN},30)

exten=>_1x,n+101,Hangup()

[remote]
;exten=>_2x,1,NoOp()
exten=>_2x,1,Dial(SIP/asterisk1/${EXTEN})
exten=>_2x,n+101,Hangup()

[asterisk1_incoming]
exten=>_1x,1,DISA(no-password,internal)

exten=>_3x,1,DISA(no-password,remote)
exten=>_1x,102,Hangup()
exten=>_3x,102,Hangup()
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: http://listas.asteriskbrasil.org/pipermail/asteriskbrasil/attachments/20090709/79e997f2/attachment-0001.htm 


Mais detalhes sobre a lista de discussão AsteriskBrasil