G
G
gadzhi152015-07-10 11:25:48
Asterisk
gadzhi15, 2015-07-10 11:25:48

AddPac glitch with trunks. What's wrong?

AddPac GS 1002. Two sim cards: megaphone and beeline. Connected to asterisk. In the outgoing dialplan setting, depending on the client number, the call must go from a megaphone (if the client has a megaphone number) and from a beeline (if the client has a beeline number). But everything happens the other way around: if the client has a Beeline number, then the call comes from a megaphone.
AddPac

script ntpdate default
 server ip time.nist.gov
 server ip time.windows.com
!
interface Loopback0
 ip address 127.0.0.1 255.0.0.0
!
interface FastEthernet0/0
 ip address 192.168.11.231 255.255.0.0
 ip nat outside
 speed auto
 no qos-control
!
interface FastEthernet0/1
 no ip address
 ip nat outside
 shutdown
 speed auto
 no qos-control
!
ip route 0.0.0.0 0.0.0.0 192.168.11.221
!
!
!
!
http server
!
logging command
logging event 4-warning
logging on
!
!
!
!
! VoIP configuration.
!
!
! Voice service voip configuration.
!
voice service voip
 protocol sip
 dtmf-relay rfc-2833
 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 7928....................
 ring detect-timeout 70
 dial-tone-generate
 caller-id enable
 caller-id type etsi
!
!
! GSM
voice-port 0/1
 connection plar 7964..............
 ring detect-timeout 70
 dial-tone-generate
 caller-id enable
 caller-id type etsi
!
!
!
!
! service port group configuration.
!
!
!
! Pots peer configuration.
!
dial-peer voice 0 pots
 destination-pattern 00T
 port 0/0
 call-waiting
 user-name 79285610070
 user-password sip-secret
 translate-outgoing called-number 0
!
dial-peer voice 1 pots
 destination-pattern 01T
 port 0/1
 call-waiting
 user-name 79640070707
 user-password sip-secret2
 translate-outgoing called-number 1
 preference 2
!
!
!
! Voip peer configuration.
!
dial-peer voice 2000 voip
 destination-pattern T
 session target sip-server
 session protocol sip
 voice-class codec 1
 no vad
 dtmf-relay rtp-2833
 description asterisk
!
!
!
dial-peer call-hold h
dial-peer call-transfer h
!
!
!
gatekeeper
!
!
! Gateway configuration.
!
gateway
 h323-id voip.192.168.11.221
 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
!
voice class codec 1
 codec preference 1 g711alaw
 codec preference 2 g711ulaw
 codec preference 3 g729
!
!
!
! Translation Rule configuration.
!
translation-rule 0
 rule 0      007T                     8T
!
translation-rule 1
 rule 0      017T                     8T
!
!
!
! SIP UA configuration.
!
sip-ua
 user-register
 sip-username addpac
 sip-password sip-secret
 sip-server 192.168.11.221 5060 1
 called-party-number to-field
 remote-party-id
 session-refresh update
 register e164
!
!
! Tones
!
!
! SMS delivery configuration
!
sms-delivery
!
!
!
!
voip-interface ip FastEthernet0/0
!
line console
!
line vty
!
mobile dev-restart-by-unreg 300
mobile dev-restart-by-unknown-error
mobile cell-monitor 30
!
mobile 0/0
 gsm sms-language utf8
!
mobile 0/1
 gsm sms-language utf8
!

Asterisk
[dial_to_megafon] ; контекст исходящих звонков на мегафон
exten => _[7,8]92.,1,NoOP("Звоним на мегафоновский номер ${EXTEN} с номера ${CALLERID(num)}")
exten => _[7,8]92.,n,Dial(SIP/79285610070/007${EXTEN:1:10},30,mtT)


[dial_to_beeline] ; контекст исходящих звонков на билайн
exten => _[7,8]96.,1,NoOP("Звоним на билайновский номер ${EXTEN} с номера ${CALLERID(num)}")
exten => _[7,8]96.,n,Dial(SIP/79640070707/017${EXTEN:1:10},30,mtT)

What is the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2015-07-10
@rostel

Rewrite the translation rules like this:

! 
translation-rule 0 
 rule 0      00...........F           8%04%05%06%07%08%09%10%11%12%13  
! 
translation-rule 1 
 rule 0      01...........F           8%04%05%06%07%08%09%10%11%12%13  
!

and on ports
en
conf t
dial-peer voice 0 pots  
destination-pattern 007..........F
huntstop
dial-peer voice 1 pots
destination-pattern 017..........F
huntstop
no preference

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question