На Cisco делаем следующееvoice service voip
allow-connections h323 to h323
allow-connections h323 to sip
allow-connections sip to h323
allow-connections sip to sip
redirect ip2ip
sip
registrar server expires max 3600 min 3600
redirect contact order best-match
no call service stop
Делаем преобразование номера (убираем префикс 70)
translation-rule 70
Rule 0 700 0
Rule 1 701 1
Rule 2 702 2
Rule 3 703 3
Rule 4 704 4
Rule 5 705 5
Rule 6 706 6
Rule 7 707 7
Rule 8 708 8
Rule 9 709 9
Описываем куда будем отсылать звонки если наберем префикс 70
dial-peer voice 116 voip
corlist outgoing call-longdistance
destination-pattern 70...
progress_ind setup enable 3
translate-outgoing called 70
session protocol sipv2
session target ipv4:XXX.XXX.XXX.XXX:5060
session transport udp
dtmf-relay rtp-nte
codec g711ulaw
fax rate 9600
fax protocol pass-through g711alaw
clid substitute name
no vad
где XXX.XXX.XXX.XXX - Asterisk
sip-ua
authentication username <USER> password <password>
nat symmetric check-media-src
retry invite 3
retry response 3
retry bye 3
retry cancel 3
retry options 0
timers trying 1000
sip-server ipv4:xxx.xxx.xxx.xxx
где xxx.xxx.xxx.xxx - Asterisk, <USER> - авторизация на Asterisk-е, <password> - пароль на Asterisk-е
На Asterisk
<users.conf>
[DO2]
allow = ulaw
context = DID_DO2
dialformat = ${EXTEN:1}
hasexten = yes
hasiax = no
hassip = yes
host = yyy.yyy.yyy.yyy
port = 5060
registeriax = no
registersip = yes
secret = <pass>
trunkname = Custom - DO2
trunkstyle = customvoip
username = <user>
disallow = alaw,gsm,ilbc,g726,adpcm,speex,lpc10,g729
md5secret = <md5_pass>
insecure = port,invite
canreinvite = no
yyy.yyy.yyy.yyy - Cisco
<user> - пользователь
<pass> - пароль
<md5_pass> - пароль в MD5
<extensions.conf>
DO2 = SIP/DO2
[numberplan-custom-1]
plancomment = DialPlan1
include = default
comment = _2XXXX!,1,default,standard
include = default
exten = _02XXX,1,Macro(trunkdial,${DO2}/${EXTEN:2})
comment = _02XXX,1,DO2,standard
[DID_DO2]
include = default
include = default
include = default
[numberplan-custom-2]
include = default
plancomment = DialPlan2
exten = _2XXX!,1,Macro(trunkdial,${trunk_1}/${EXTEN:0})
comment = _2XXX!,1,d1,standard
рестартуем Астериск.
При наборе префикса 02 с Астериска будет производиться проброс на Cisco.
При наборе 70xxx со стороны Cisco проброс будет производиться на Asterisk.
Для упрощения конфигурирования, можно воспользоваться утилитой asterisk-gui
(/usr/ports/www/asterisk-gui для BSD like ports)
URL:
Обсуждается: http://www.opennet.me/tips/info/1456.shtml