В chan_dahdi.conf разруливал руками, может и криво )
Код: Выделить всё
[trunkgroups]
[channels]
language=ru
signalling=fxs_ks
switchtype = euroisdn
usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
echotraining=yes
echotraining=800
relaxdtmf=yes
rxgain=0.0
txgain=0.0
group=0
callgroup=1
pickupgroup=1
immediate=yes
busydetect=yes
busycount=3
faxdetect=yes
channel => 1-16
#include dahdi-channels.conf
#include chan_dahdi_additional.conf
[FROM_EXT]
context = line_in
signalling=fxs_ks
group = 1
channel => 1-16
usecallerid => yes
usecallingpres=yes
callwaitingcallerid=yes
hidecallerid => no
echocancel = yes
echocancelwhenbridged = no
[FROM_ITN]
context = line_out
signalling=fxo_ks
group = 1
channel => 17-32
usecallerid => yes
usecallingpres=yes
callwaitingcallerid=yes
hidecallerid => no
echocancel = yes
echocancelwhenbridged = no
Автогенерил конфиг dahdi_channels.conf
Код: Выделить всё
; Autogenerated by /usr/sbin/dahdi_genconf on Thu Oct 17 22:25:01 2013
; If you edit this file and execute /usr/sbin/dahdi_genconf again,
; your manual changes will be LOST.
; Dahdi Channels Configurations (chan_dahdi.conf)
;
; This is not intended to be a complete chan_dahdi.conf. Rather, it is intended
; to be #include-d by /etc/chan_dahdi.conf that will include the global settings
;
; Span 1: WCTDM/16 "YSTDM16xx REV E Board 17" (MASTER)
;;; line="1 WCTDM/16/0 FXSKS (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from_int_1
channel => 1
callerid=
group=
#context=default
;;; line="2 WCTDM/16/1 FXSKS (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from_int_2
channel => 2
callerid=
group=
#context=default
;;; line="3 WCTDM/16/2 FXSKS (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from_int_3
channel => 3
callerid=asreceived
group=
#context=default
;;; line="4 WCTDM/16/3 FXSKS (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from_int_4
channel => 4
callerid=
group=
#context=default
;;; line="5 WCTDM/16/4 FXSKS (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from_int_5
channel => 5
callerid=
group=
#context=default
;;; line="6 WCTDM/16/5 FXSKS (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from_int_6
channel => 6
callerid=
group=
#context=default
;;; line="7 WCTDM/16/6 FXSKS (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from_int_7
channel => 7
callerid=
group=
#context=default
;;; line="8 WCTDM/16/7 FXSKS (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from_int_8
channel => 8
callerid=
group=
#context=default
;;; line="9 WCTDM/16/8 FXSKS (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from_int_9
channel => 9
callerid=
group=
#context=default
;;; line="10 WCTDM/16/9 FXSKS (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from_int_10
channel => 10
callerid=
group=
#context=default
;;; line="11 WCTDM/16/10 FXSKS (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from_int_11
channel => 11
callerid=
group=
#context=default
;;; line="12 WCTDM/16/11 FXSKS (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from_int_12
channel => 12
callerid=
group=
#context=default
;;; line="13 WCTDM/16/12 FXSKS (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from_int_13
channel => 13
callerid=
group=
#context=default
;;; line="14 WCTDM/16/13 FXSKS (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from_int_14
channel => 14
callerid=
group=
#context=default
;;; line="15 WCTDM/16/14 FXSKS (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from_int_15
channel => 15
callerid=
group=
#context=default
;;; line="16 WCTDM/16/15 FXSKS (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from_int_16
channel => 16
callerid=
group=
#context=default
; Span 2: WCTDM/16 "YSTDM16xx REV E Board 17"
;;; line="17 WCTDM/16/0 FXOKS (SWEC: MG2)"
signalling=fxo_ks
callerid="Channel 27" <4017>
mailbox=4017
group=5
context=from_ext_1
channel => 17
callerid=
mailbox=
group=
#context=default
;;; line="18 WCTDM/16/1 FXOKS (SWEC: MG2)"
signalling=fxo_ks
callerid="Channel 27" <4018>
mailbox=4018
group=5
context=from_ext_2
channel => 18
callerid=
mailbox=
group=
#context=default
;;; line="19 WCTDM/16/2 FXOKS (SWEC: MG2)"
signalling=fxo_ks
callerid="Channel 27" <4019>
mailbox=4019
group=5
context=from_ext_3
channel => 19
callerid=asreceived
mailbox=
group=
#context=default
;;; line="20 WCTDM/16/3 FXOKS (SWEC: MG2)"
signalling=fxo_ks
callerid="Channel 27" <4020>
mailbox=4020
group=5
context=from_ext_4
channel => 20
callerid=
mailbox=
group=
#context=default
;;; line="21 WCTDM/16/4 FXOKS (SWEC: MG2)"
signalling=fxo_ks
callerid="Channel 27" <4021>
mailbox=4021
group=5
context=from_ext_5
channel => 21
callerid=
mailbox=
group=
#context=default
;;; line="22 WCTDM/16/5 FXOKS (SWEC: MG2)"
signalling=fxo_ks
callerid="Channel 27" <4022>
mailbox=4022
group=5
context=from_ext_6
channel => 22
callerid=
mailbox=
group=
#context=default
;;; line="23 WCTDM/16/6 FXOKS (SWEC: MG2)"
signalling=fxo_ks
callerid="Channel 27" <4023>
mailbox=4023
group=5
context=from_ext_7
channel => 23
callerid=
mailbox=
group=
#context=default
;;; line="24 WCTDM/16/7 FXOKS (SWEC: MG2)"
signalling=fxo_ks
callerid="Channel 27" <4024>
mailbox=4024
group=5
context=from_ext_8
channel => 24
callerid=
mailbox=
group=
#context=default
;;; line="25 WCTDM/16/8 FXOKS (SWEC: MG2)"
signalling=fxo_ks
callerid="Channel 25" <4025>
mailbox=4025
group=5
context=from_ext_9
channel => 25
callerid=
mailbox=
group=
#context=default
;;; line="26 WCTDM/16/9 FXOKS (SWEC: MG2)"
signalling=fxo_ks
callerid="Channel 26" <4026>
mailbox=4026
group=5
context=from_ext_10
channel => 26
callerid=
mailbox=
group=
#context=default
;;; line="27 WCTDM/16/10 FXOKS (SWEC: MG2)"
signalling=fxo_ks
callerid="Channel 27" <4027>
mailbox=4027
group=5
context=from_ext_11
channel => 27
callerid=
mailbox=
group=
#context=default
;;; line="28 WCTDM/16/11 FXOKS (SWEC: MG2)"
signalling=fxo_ks
callerid="Channel 28" <4028>
mailbox=4028
group=5
context=from_ext_12
channel => 28
callerid=
mailbox=
group=
#context=default
;;; line="29 WCTDM/16/12 FXOKS (SWEC: MG2)"
signalling=fxo_ks
callerid="Channel 29" <4029>
mailbox=4029
group=5
context=from_ext_13
channel => 29
callerid=
mailbox=
group=
#context=default
;;; line="30 WCTDM/16/13 FXOKS (SWEC: MG2)"
signalling=fxo_ks
callerid="Channel 30" <4030>
mailbox=4030
group=5
context=from_ext_14
channel => 30
callerid=
mailbox=
group=
#context=default
;;; line="31 WCTDM/16/14 FXOKS (SWEC: MG2)"
signalling=fxo_ks
callerid="Channel 31" <4031>
mailbox=4031
group=5
context=from_ext_15
channel => 31
callerid=
mailbox=
group=
#context=default
;;; line="32 WCTDM/16/15 FXOKS (SWEC: MG2)"
signalling=fxo_ks
callerid="Channel 32" <4032>
mailbox=4032
group=5
context=from_ext_16
channel => 32
callerid=
mailbox=
group=
#context=default
В extensions.conf все контексты прописаны. Работают так: 1(город) порт открывает 17(тда100) и обратно. Для других портов соответственно 2-18, 3-19 и т.д.
Входящие и исходящие работают, нужен только номер, который набирают пользователи.
Кусок extensions:
Код: Выделить всё
[from_ext_1]
exten => s,1,MYSQL(Connect connid localhost root WelcomeMysql asteriskcdrdb)
exten => s,2,MYSQL(Query resultid ${connid} INSERT INTO cdrhistory (`id`,`calldate`,`channel`,`callerid`,`uniqueid`,`dcontext`) VALUE ('','${CDR(start)}','${CDR(channel)}','${CALLERID(num)}','${UNIQUEID}','${CDR(dcontext)}'))
exten => s,3,MYSQL(Clear ${resultid})
exten => s,4,MYSQL(Disconnect ${connid})
exten => s,5,MixMonitor(/var/spool/asterisk/monitor/${UNIQUEID}.wav,,/var/spool/asterisk/converttomp3.sh ${UNIQUEID})
exten => s,6,Dial(DAHDI/1)
exten => s,n,HangUp
exten => s,n,StopMixMonitor()
[from_int_1]
exten => s,1,MYSQL(Connect connid localhost root WelcomeMysql asteriskcdrdb)
exten => s,2,MYSQL(Query resultid ${connid} INSERT INTO cdrhistory (`id`,`calldate`,`channel`,`callerid`,`uniqueid`,`dcontext`) VALUE ('','${CDR(start)}','${CDR(channel)}','${CALLERID(num)}','${UNIQUEID}','${CDR(dcontext)}'))
exten => s,3,MYSQL(Clear ${resultid})
exten => s,4,MYSQL(Disconnect ${connid})
exten => s,5,Dial(DAHDI/17)
exten => s,n,HangUp
...