Пожалуйста, войдите здесь. Часто задаваемые вопросы О нас
Задайте Ваш вопрос

История изменений [назад]

нажмите, чтобы скрыть/показать версии 1
изначальная версия
редактировать

спросил 2013-11-20 09:23:52 +0400

Menog Gravatar Menog

Addpack ap-gs1002 + Asterisk исходящие на вторую SIM карту

не пойму что не так, не могу позвонить через вторую симку извне. входящие все ок, а исходящие идут только через 1-ю симку , даже если чётко указать GSM2 пир.

addpack.cfg

Current configuration:
!
version 8.51.008
!
hostname GS1002
!
username root password router administrator
username guest password guest user
!
!
script ntpdate default
 resynchronize 1 0
 server ip time.yandex.ru
!
interface Loopback0
 ip address 127.0.0.1 255.0.0.0
!
interface FastEthernet0/0
 ip address 192.168.1.198 255.255.255.0
 speed auto
 no qos-control
!
interface FastEthernet0/1
 no ip address
 speed auto
 no qos-control
!
interface FastEthernet0/1:1
 ip address 192.168.10.1 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 192.168.1.100 10
!
!
!
!
dhcp server
http server
!
dns name-server 192.168.1.100
dns name-server 192.168.1.1
logging command
logging event 4-warning
logging on
!
!
!
!
! VoIP configuration.
!
!
! Voice service voip configuration.
!
voice service voip
 protocol sip
 dtmf-relay out-of-band
 fax protocol t38 redundancy 0
 fax rate 9600
 h323 call start fast
 h323 call tunnel enable
 no call-barring unconfigured-ip-address
 no voip-inbound-call-barring enable
!
!
! Voice port configuration.
!
! GSM
voice-port 0/0
 connection plar 881
 ring detect-timeout 70
 dial-tone-generate
 caller-id enable
 caller-id type etsi
 caller-id name disable
 gsm-auto-recharge balance-check-time 0
!
!
! GSM
voice-port 0/1
 connection plar 882
 ring detect-timeout 70
 dial-tone-generate
 caller-id enable
 caller-id type etsi
 caller-id name disable
 gsm-auto-recharge balance-check-time 0
!
!
! FXS
voice-port 0/2
 caller-id enable
!
!
! FXS
voice-port 0/3
 caller-id enable
!
!
!
!
! service port group configuration.
!
!
!
! Pots peer configuration.
!
dial-peer voice 1512 pots
 destination-pattern 307
 port 0/2
 no register e164
 user-name fxs1
 user-password fxs1pass
!
dial-peer voice 1513 pots
 destination-pattern 308
 port 0/3
 no register e164
 user-name fxs2
 user-password fxs2pass
!
dial-peer voice 3048 pots
 destination-pattern .T
 port 0/0
 call-waiting
 user-name gsm1
 user-password gsm1pass
 preference 2
!
dial-peer voice 3049 pots
 destination-pattern .T
 port 0/1
 call-waiting
 user-name gsm2
 user-password gsm2pass
 preference 3
!
!
!
! Voip peer configuration.
!
dial-peer voice 10100 voip
 destination-pattern 88[12]
 session target sip-server
 session protocol sip
 voice-class codec 0
 no vad
 dtmf-relay rtp-2833
 description asterisk
!
!
!
!
!
!
gatekeeper
!
!
! Gateway configuration.
!
gateway
 h323-id voip.192.168.1.198
 no ignore-msg-from-other-gk
!
!
! Codec classes configuration.
!
voice class codec 0
 codec preference 1 g711alaw
 codec preference 2 g711ulaw
 codec preference 3 g729
 codec preference 4 g7231r53
 codec preference 5 g726r16
 codec preference 6 g726r32
!
!
!
! Translation Rule configuration.
!
translation-rule 10100
 rule 0      88[12]                   %01%99
!
!
!
! SIP UA configuration.
!
sip-ua
 user-register
 sip-server 192.168.1.100 5060 126
 called-party-number to-field
 register e164
!
!
! Tones
!
!
!
!
! SMTP sendmail configuration
!
sms-delivery
!
!
!
line console
!
line vty
!
mobile dev-restart-by-unreg 300
!
mobile 0/0
 gsm sms-language utf8
!
mobile 0/1
 gsm sms-language utf8
!
end

sip.cfg

[addpac] 
username=addpac 
type=friend 
insecure=port,invite 
context=incoming
dtmfmode=auto 
qualify=yes 
host=192.168.1.198 
disallow=all 
allow=gsm ; GSM consumes far less bandwidth than ulaw
allow=ulaw
allow=alaw
nat=no
canreinvite=yes

[881] 
type=friend 
context=incoming
dtmfmode=auto 
host=dynamic

[882] 
type=friend 
context=incoming
dtmfmode=auto
host=dynamic

[gsm1]
username=gsm1
secret=gsm1pass
type=friend
context=outbound-local
dtmfmode=rfc2833
host=dynamic
deny=0.0.0.0/0.0.0.0
permit=192.168.1.198/255.255.255.255

[gsm2]
username=gsm2  
secret=gsm2pass
type=friend
context=outbound-local
dtmfmode=rfc2833
host=dynamic
deny=0.0.0.0/0.0.0.0
permit=192.168.1.198/255.255.255.255


[gs715](!) ; <== обратите внимание, восклицательный знак
; взят в круглые скобки. Это признак шаблона.
type=friend
context=phones
host=dynamic
disallow=all
allow=ulaw
dtmfmode=rfc2833
secret=qwerty

[xlite](!)
; Turn off silence suppression in X-Lite ("Transmit Silence"=YES)!
; Note that Xlite sends NAT keep-alive packets, so qualify=yes is not needed
"Transmit Silence"=YES
type=friend
;regexten=1234                   ; When they register, create extension 1234
context=phones
host=dynamic                    ; This device needs to register
secret=qwerty
directmedia=no                  ; Typically set to NO if behind NAT
disallow=all
allow=gsm                       ; GSM consumes far less bandwidth than ulaw
allow=ulaw
allow=alaw

[101](gs715)
callerid = "Secretary" <101> 
callgroup=1
pickupgroup=1

[103](gs715)
callerid = "User 103" <103> 
callgroup=1
pickupgroup=1

Extension.cfg

[globals]

[general]

autofallthrough=yes

[incoming]

exten => 881,1,Dial(SIP/101)
exten => 881,n,Hangup()

exten => 882,1,Dial(SIP/101)
exten => 882,n,Hangup()

include => employees
include => phones

[outbound-local]

exten => _8XXXXXXXXXX,1,Dial(SIP/addpac/${EXTEN},30)

exten => _8XXXXXXXXXX,n,HangUp()

[outbound-global]

exten => _9XXXXXXXXXXX,1,Dial(SIP/addpac/+${EXTEN:1},40)

exten => _9XXXXXXXXXXX,n,HangUp()

exten => _9XXXXXXXXXXXX,1,Dial(SIP/addpac/+${EXTEN:1},40)

exten => _9XXXXXXXXXXXX,n,HangUp()

exten => 910,1,Dial(SIP/gsm2/+79261111111,40) ; Проверка GSM1 пира

exten => 910,HangUp()

exten => 911,1,Dial(SIP/gsm2/+79261111111,40) ; Проверка GSM2 пира - не звонит!!

exten => 911,HangUp()

exten => 912,1,Dial(SIP/gsm2/+79261111111,40) ; Проверка общего addpack пира - не звонит, если первый GSM1 занят!!!
exten => 912,HangUp()

[phones]
include => outbound-local
include => outbound-global
include => employees


[employees]

exten => _1XX,1,Dial(SIP/${EXTEN})
exten => _2XX,1,Dial(SIP/${EXTEN})
exten => _3XX,1,Dial(SIP/${EXTEN})
exten => _4XX,1,Dial(SIP/${EXTEN})
exten => _5XX,1,Dial(SIP/${EXTEN})
exten => _6XX,1,Dial(SIP/${EXTEN})
exten => _7XX,1,Dial(SIP/${EXTEN})

exten => 307,1,Dial(SIP/addpac/${EXTEN},20)
exten => 307,n,HangUp()  

exten => 308,1,Dial(SIP/addpac/${EXTEN},20)
exten => 308,n,HangUp()

Addpack ap-gs1002 + Asterisk исходящие на вторую SIM карту

не пойму что не так, не могу позвонить через вторую симку извне. входящие все ок, а исходящие идут только через 1-ю симку , даже если чётко указать GSM2 пир.

addpack.cfg

Current configuration:
!
version 8.51.008
!
hostname GS1002
!
username root password router administrator
username guest password guest user
!
!
script ntpdate default
 resynchronize 1 0
 server ip time.yandex.ru
!
interface Loopback0
 ip address 127.0.0.1 255.0.0.0
!
interface FastEthernet0/0
 ip address 192.168.1.198 255.255.255.0
 speed auto
 no qos-control
!
interface FastEthernet0/1
 no ip address
 speed auto
 no qos-control
!
interface FastEthernet0/1:1
 ip address 192.168.10.1 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 192.168.1.100 10
!
!
!
!
dhcp server
http server
!
dns name-server 192.168.1.100
dns name-server 192.168.1.1
logging command
logging event 4-warning
logging on
!
!
!
!
! VoIP configuration.
!
!
! Voice service voip configuration.
!
voice service voip
 protocol sip
 dtmf-relay out-of-band
 fax protocol t38 redundancy 0
 fax rate 9600
 h323 call start fast
 h323 call tunnel enable
 no call-barring unconfigured-ip-address
 no voip-inbound-call-barring enable
!
!
! Voice port configuration.
!
! GSM
voice-port 0/0
 connection plar 881
 ring detect-timeout 70
 dial-tone-generate
 caller-id enable
 caller-id type etsi
 caller-id name disable
 gsm-auto-recharge balance-check-time 0
!
!
! GSM
voice-port 0/1
 connection plar 882
 ring detect-timeout 70
 dial-tone-generate
 caller-id enable
 caller-id type etsi
 caller-id name disable
 gsm-auto-recharge balance-check-time 0
!
!
! FXS
voice-port 0/2
 caller-id enable
!
!
! FXS
voice-port 0/3
 caller-id enable
!
!
!
!
! service port group configuration.
!
!
!
! Pots peer configuration.
!
dial-peer voice 1512 pots
 destination-pattern 307
 port 0/2
 no register e164
 user-name fxs1
 user-password fxs1pass
!
dial-peer voice 1513 pots
 destination-pattern 308
 port 0/3
 no register e164
 user-name fxs2
 user-password fxs2pass
!
dial-peer voice 3048 pots
 destination-pattern .T
 port 0/0
 call-waiting
 user-name gsm1
 user-password gsm1pass
 preference 2
!
dial-peer voice 3049 pots
 destination-pattern .T
 port 0/1
 call-waiting
 user-name gsm2
 user-password gsm2pass
 preference 3
!
!
!
! Voip peer configuration.
!
dial-peer voice 10100 voip
 destination-pattern 88[12]
 session target sip-server
 session protocol sip
 voice-class codec 0
 no vad
 dtmf-relay rtp-2833
 description asterisk
!
!
!
!
!
!
gatekeeper
!
!
! Gateway configuration.
!
gateway
 h323-id voip.192.168.1.198
 no ignore-msg-from-other-gk
!
!
! Codec classes configuration.
!
voice class codec 0
 codec preference 1 g711alaw
 codec preference 2 g711ulaw
 codec preference 3 g729
 codec preference 4 g7231r53
 codec preference 5 g726r16
 codec preference 6 g726r32
!
!
!
! Translation Rule configuration.
!
translation-rule 10100
 rule 0      88[12]                   %01%99
!
!
!
! SIP UA configuration.
!
sip-ua
 user-register
 sip-server 192.168.1.100 5060 126
 called-party-number to-field
 register e164
!
!
! Tones
!
!
!
!
! SMTP sendmail configuration
!
sms-delivery
!
!
!
line console
!
line vty
!
mobile dev-restart-by-unreg 300
!
mobile 0/0
 gsm sms-language utf8
!
mobile 0/1
 gsm sms-language utf8
!
end

sip.cfg

[addpac] 
username=addpac 
type=friend 
insecure=port,invite 
context=incoming
dtmfmode=auto 
qualify=yes 
host=192.168.1.198 
disallow=all 
allow=gsm ; GSM consumes far less bandwidth than ulaw
allow=ulaw
allow=alaw
nat=no
canreinvite=yes

[881] 
type=friend 
context=incoming
dtmfmode=auto 
host=dynamic

[882] 
type=friend 
context=incoming
dtmfmode=auto
host=dynamic

[gsm1]
username=gsm1
secret=gsm1pass
type=friend
context=outbound-local
dtmfmode=rfc2833
host=dynamic
deny=0.0.0.0/0.0.0.0
permit=192.168.1.198/255.255.255.255

[gsm2]
username=gsm2  
secret=gsm2pass
type=friend
context=outbound-local
dtmfmode=rfc2833
host=dynamic
deny=0.0.0.0/0.0.0.0
permit=192.168.1.198/255.255.255.255


[gs715](!) ; <== обратите внимание, восклицательный знак
; взят в круглые скобки. Это признак шаблона.
type=friend
context=phones
host=dynamic
disallow=all
allow=ulaw
dtmfmode=rfc2833
secret=qwerty

[xlite](!)
; Turn off silence suppression in X-Lite ("Transmit Silence"=YES)!
; Note that Xlite sends NAT keep-alive packets, so qualify=yes is not needed
"Transmit Silence"=YES
type=friend
;regexten=1234                   ; When they register, create extension 1234
context=phones
host=dynamic                    ; This device needs to register
secret=qwerty
directmedia=no                  ; Typically set to NO if behind NAT
disallow=all
allow=gsm                       ; GSM consumes far less bandwidth than ulaw
allow=ulaw
allow=alaw

[101](gs715)
callerid = "Secretary" <101> 
callgroup=1
pickupgroup=1

[103](gs715)
callerid = "User 103" <103> 
callgroup=1
pickupgroup=1

Extension.cfg

[globals]

[general]

autofallthrough=yes

[incoming]

exten => 881,1,Dial(SIP/101)
exten => 881,n,Hangup()

exten => 882,1,Dial(SIP/101)
exten => 882,n,Hangup()

include => employees
include => phones

[outbound-local]

exten => _8XXXXXXXXXX,1,Dial(SIP/addpac/${EXTEN},30)

exten => _8XXXXXXXXXX,n,HangUp()

[outbound-global]

exten => _9XXXXXXXXXXX,1,Dial(SIP/addpac/+${EXTEN:1},40)

exten => _9XXXXXXXXXXX,n,HangUp()

exten => _9XXXXXXXXXXXX,1,Dial(SIP/addpac/+${EXTEN:1},40)

exten => _9XXXXXXXXXXXX,n,HangUp()

exten => 910,1,Dial(SIP/gsm2/+79261111111,40) ; Проверка GSM1 пира

exten => 910,HangUp()

exten => 911,1,Dial(SIP/gsm2/+79261111111,40) ; Проверка GSM2 пира - не звонит!!
звонит всё равно через первый GSM1 !!

exten => 911,HangUp()

exten => 912,1,Dial(SIP/gsm2/+79261111111,40) ; Проверка общего addpack пира - не звонит, если первый GSM1 занят!!!
exten => 912,HangUp()

[phones]
include => outbound-local
include => outbound-global
include => employees


[employees]

exten => _1XX,1,Dial(SIP/${EXTEN})
exten => _2XX,1,Dial(SIP/${EXTEN})
exten => _3XX,1,Dial(SIP/${EXTEN})
exten => _4XX,1,Dial(SIP/${EXTEN})
exten => _5XX,1,Dial(SIP/${EXTEN})
exten => _6XX,1,Dial(SIP/${EXTEN})
exten => _7XX,1,Dial(SIP/${EXTEN})

exten => 307,1,Dial(SIP/addpac/${EXTEN},20)
exten => 307,n,HangUp()  

exten => 308,1,Dial(SIP/addpac/${EXTEN},20)
exten => 308,n,HangUp()

Проект компании "АТС Дизайн"
Asterisk® и Digium® являются зарегистрированными торговыми марками компании Digium, Inc., США.
IP АТС Asterisk распространяется под лицензией GNU GPL.