| 本帖最後由 bubblestar 於 2010-10-24 22:59 編輯 
 回復 17# ckleea
 
 Using YH's example for further illustration as below.  You may add another context in extensions.conf to enhance the usage.  Assume that you are going to use or dial PSTN===> VoIP ===> PSTN.  This implementation must be used subject to the availability of 2 PSTN lines.
 
 dahdi-channels.conf
 
 ; Autogenerated by /usr/sbin/dahdi_genconf on Sun Aug 29 15:00:16 2010
 ; 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/4 "Wildcard TDM400P REV I Board 5" (MASTER)
 ;;; line="1 WCTDM/4/0 FXSKS  (In use) (SWEC: MG2)"
 signalling=fxs_ks
 callerid=asreceived
 group=0
 context=from-pstn-1
 channel => 1
 callerid=
 group=
 context=default
 
 ;;; line="2 WCTDM/4/1 FXSKS  (In use) (SWEC: MG2)"
 signalling=fxs_ks
 callerid=asreceived
 group=0
 context=from-pstn-2
 channel => 2
 callerid=
 group=
 context=default
 
 
 extensions.conf
 
 [ivr-1];ivr-1
 
 exten => 1130,1,Answer
 exten => 1130,n,Wait(2)
 exten => 1130,n,Background(vm-enter-num-to-call)
 exten => 1130,n,WaitExten
 exten => 1130,n,Playback(vm-goodbye)
 exten => 1130,n,Hangup
 exten => i,1,Playback(pbx-invalid)
 exten => i,2,Goto(1130,1)
 exten => t,1,Playback(vm-goodbye)
 exten => t,2,n,Hangup
 
 
 [internal]
 
 include => ivr-1
 
 include => viaPSTN
 
 exten => 6001,1,Dial(SIP/6001,,r)
 exten => 6002,1,Dial(SIP/6002,,r)
 
 [from-pstn-1]
 exten => s,1,Dial(SIP/6001,,)
 
 [from-pstn-2]
 exten => s,1,Goto(internal,1130,1)
 
 [viaPSTN]
 ; use any first available PSTN line of Group 0 to dial out your IDD or outside line.  It will be more flexible if you have 2 or more PSTN lines.
 exten => _5.,1,Dial(DAHDI/g0/${EXTEN:1},,r)
 exten => _5.,2,Congestion
 
 or
 
 [viaPSTN]
 ; use designated PSTN line 1 to dial out IDD or outside line
 exten => _5.,1,Dial(DAHDI/1/${EXTEN:1},,r)
 exten => _5.,2,Congestion
 |