返回列表 發帖
You may try this

[from-pstn-1]
exten => s,1,Dial(SIP/6001,30)       
exten => s,2,VoiceMail(6001,u)


u denotes unavailable

TOP

本帖最後由 bubblestar 於 2010-9-8 10:40 編輯

如果唔想為每一條內線都設定相同的CODE,可以試下咁樣。

sip.conf

[globals]
RINGTIME=30

[internal]
; If nobody picks up within 30 seconds, the call is sent to voicemail
; If the extension is busy, the call is sent to voicemail
exten => _6[0-3]XX,1,Set(TARGETNO=${EXTEN})
exten => _6[0-3]XX,n,Dial(SIP/${EXTEN},${RINGTIME})
; routes the call to the status priority (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
exten => _6[0-3]XX,n,Goto(s-${DIALSTATUS},1)
; person at extension "is unavailable" message        
exten => s-NOANSWER,1,VoiceMail(${TARGETNO},u)
; person at extension "is busy" message       
exten => s-BUSY,1,VoiceMail(${TARGETNO},b)
; to be safe, clean up the call after an answer by hanging up           
exten => s-ANSWER,1,Hangup()
; handle any unhandled status the same way we handle NOANSWER               
exten => _s-.,1,Goto(s-NOANSWER,1)                  

我在QNAP NAS 都有用呢套用法。

_6[0-3]XX 代表打入到 這些內線,才會用以上的處理方法去做。如果上面最後一句不加入,那麼不是給_6[0-3]XX接的話,應該會沒有回應便收線 (當處理垃圾電話都好)

TOP

如果驚唔記得,可以係每段設定前後加上一些敍述,方便記憶。

例如:


[from-pstn-1]
exten => s,1,Dial(SIP/6001,30)        ;  從外面接入的電話,轉往內線6001,會晌30秒。
exten => s,2,VoiceMail(6001,u)        ;  30秒沒有人接聽的話,便自動接往內線6001的留言信箱。

如此類推。但係在圖形介面便比較難做到相類似的效果了。

TOP

本帖最後由 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

TOP

本帖最後由 bubblestar 於 2010-10-25 10:00 編輯

Good to hear that it works for you.  Always put your own dialplan using the include => XXX which can create different kinds of combination that suits your own needs.

Regarding the inclusion of password (for IDD protection or avoid being abused), you may insert just one line in the first place as below:


[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,Authenticate(8888,,4)
exten => _5.,n,Dial(DAHDI/g0/${EXTEN:1},,r)
exten => _5.,n,Congestion

or

[viaPSTN]
; use designated PSTN line 1 to dial out IDD or outside line
exten => _5.,1,Authenticate(8888,,4)
exten => _5.,n,Dial(DAHDI/1/${EXTEN:1},,r)
exten => _5.,n,Congestion

I think some other more effective, secure and better method can do the same.  If anyone of you can provide your settings, please be generous to share.

Many thanks

TOP

本帖最後由 bubblestar 於 2010-10-25 17:34 編輯

回復 24# ckleea


   
Just go back to YH's [ivr-1] section in extensions.conf and put the time allowed, say 8 seconds, in WaitExten() as below:

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(8)
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

** Seconds can be passed with fractions of a second. (eg: 1.5 = 1.5 seconds)

TOP

返回列表