Board logo

標題: PSTN incoming call to IVR [打印本頁]

作者: 角色    時間: 2010-8-30 14:46     標題: PSTN incoming call to IVR

本帖最後由 角色 於 2010-8-30 15:01 編輯

If a person calls the PSTN-1, extension 6001 will ring. If PSTN-2, the system will enter an ivr-1 routine.

YH

dahdi-channels.conf
  1. ; Autogenerated by /usr/sbin/dahdi_genconf on Sun Aug 29 15:00:16 2010
  2. ; If you edit this file and execute /usr/sbin/dahdi_genconf again,
  3. ; your manual changes will be LOST.
  4. ; Dahdi Channels Configurations (chan_dahdi.conf)
  5. ;
  6. ; This is not intended to be a complete chan_dahdi.conf. Rather, it is intended
  7. ; to be #include-d by /etc/chan_dahdi.conf that will include the global settings
  8. ;

  9. ; Span 1: WCTDM/4 "Wildcard TDM400P REV I Board 5" (MASTER)
  10. ;;; line="1 WCTDM/4/0 FXSKS  (In use) (SWEC: MG2)"
  11. signalling=fxs_ks
  12. callerid=asreceived
  13. group=0
  14. context=from-pstn-1
  15. channel => 1
  16. callerid=
  17. group=
  18. context=default

  19. ;;; line="2 WCTDM/4/1 FXSKS  (In use) (SWEC: MG2)"
  20. signalling=fxs_ks
  21. callerid=asreceived
  22. group=0
  23. context=from-pstn-2
  24. channel => 2
  25. callerid=
  26. group=
  27. context=default
複製代碼
extensions.conf
  1. [ivr-1]
  2. ;ivr-1
  3. exten => 1130,1,Answer
  4. exten => 1130,n,Wait(2)
  5. exten => 1130,n,Background(vm-enter-num-to-call)
  6. exten => 1130,n,WaitExten
  7. exten => 1130,n,Playback(vm-goodbye)
  8. exten => 1130,n,Hangup
  9. exten => i,1,Playback(pbx-invalid)
  10. exten => i,2,Goto(1130,1)
  11. exten => t,1,Playback(vm-goodbye)
  12. exten => t,2,n,Hangup


  13. [internal]

  14. include => ivr-1

  15. exten => 6001,1,Dial(SIP/6001,,r)
  16. exten => 6002,1,Dial(SIP/6002,,r)

  17. [from-pstn-1]
  18. exten => s,1,Dial(SIP/6001,,)

  19. [from-pstn-2]
  20. exten => s,1,Goto(internal,1130,1)
複製代碼

作者: ckleea    時間: 2010-9-8 09:20

回復 1# 角色


    Can you give me an example to go directly into voicemail for unanswer after 30 sec?
作者: 角色    時間: 2010-9-8 09:45

This is not belong to IVR system. I believe it is belong to the general voicemail setting for some extensions.

YH
作者: ckleea    時間: 2010-9-8 09:48

I mean to implement in 2 ways,
1. without going into IVR, just answering machine, go into voicemail after non-attendance for 30 sec
2. in the IVR, branch to voicemail after pressing certain keys to save the incoming message of caller.
作者: 角色    時間: 2010-9-8 09:55

本帖最後由 角色 於 2010-9-8 10:33 編輯

For the first question, you may use the following codes
  1. #
  2. [from-pstn-1]
  3. exten => s,1,Dial(SIP/6001,30,)
  4. exten => s,2,Voicemail (........) since I am not familiar with voicemail, I am not sorry that I am not able to provide the codes
複製代碼
For the second second, you make take a look at the Future of Telephony: Asterisk, you may find the answer.


YH
作者: bubblestar    時間: 2010-9-8 10:24

You may try this

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


u denotes unavailable
作者: bubblestar    時間: 2010-9-8 10:38

本帖最後由 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接的話,應該會沒有回應便收線 (當處理垃圾電話都好)
作者: ckleea    時間: 2010-9-8 12:15

Thanks, very useful
作者: lttliang    時間: 2010-9-8 12:56

本帖最後由 lttliang 於 2010-9-8 13:13 編輯

你地用APL  时间长左  唔会忘记以前set左D咩吗?  我用GUI 有半个月或者一个月唔去 睇  都会忘记自己set左D咩系asterisk里
作者: 角色    時間: 2010-9-8 13:35

用GUI,根本做不到你特别想要的功能。GUI给你有什么,你只能只能用什么。

角色
作者: ckleea    時間: 2010-9-8 13:50

簡單來說,GUI介面方便管理,但有需要的話,就要用 ssh 修改個別 config files 去完成所需的工作。

現時我用GUI and astreisk 1.6.2.x,基本上可以改個別 config files,但係會加入不少空白的 space,如果用SSH,就可以做得整齊和順暢D。
作者: lttliang    時間: 2010-9-8 14:42

用GUI,根本做不到你特别想要的功能。GUI给你有什么,你只能只能用什么。

角色 ...
角色 發表於 2010-9-8 13:35



    我唔系话GUI可唔可以加自己想要的功能,我只系话如果 用APL加的野,过段时间要改时,唔会记不起一些野吗?因为我用GUI改的野 时间耐 左  都会有D唔记得  都要慢慢 睇先记返起来    而APL冇一个界面  全是字符  点样可以很清晰的知道之前做左咩功能  要修必时  可以一眼就知改边处
作者: 角色    時間: 2010-9-8 14:43

这个你要自己做log book,去记录你以前做的的事。

角色
作者: bubblestar    時間: 2010-9-8 14:53

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

例如:


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

如此類推。但係在圖形介面便比較難做到相類似的效果了。
作者: lttliang    時間: 2010-9-8 14:55

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

例如:


[from-pstn-1]
exten => s,1,Dial(SI ...
bubblestar 發表於 2010-9-8 14:53



    这是个不错的方法  
    退休之后  学APL
作者: ckleea    時間: 2010-9-8 16:28

Both notebook and remarks are good practice. But the problem for me is that we add, delete and edit the scripts. After a while, I forget what have been done.
作者: ckleea    時間: 2010-10-24 21:53

回復 1# 角色


    Would like to ask about second stage dialing, the example allows to go to inside extensions. But how about dealing with next stage of dialing example go for outside call or IDD via VOIP?

I always got invalid extension.
作者: 角色    時間: 2010-10-24 22:37

I believe that some of extensions are not seen within the context of your ivr.

YH
作者: bubblestar    時間: 2010-10-24 22:37

本帖最後由 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
作者: ckleea    時間: 2010-10-25 06:07

Thanks, bubblestar. I always have the assumption that when passing to another extensions, I can get hold of the dialplan as well. Will try.
作者: ckleea    時間: 2010-10-25 06:08

本帖最後由 ckleea 於 2010-10-25 07:29 編輯

Thanks, bubblestar. I always have the assumption that when passing to another extensions, I can get hold of the dialplan as well. Will try.


Follow up:
It works very well. Next, is to work out a better configuration and do a more detailed IVR. Perhaps to include password protected.
作者: bubblestar    時間: 2010-10-25 09:53

本帖最後由 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
作者: ckleea    時間: 2010-10-25 10:06

Excellent, you help me a lot.
謝謝 Bubblestar 兄。

Security is the major issue for us to work on.

My next task is to migrate some of the scripts to the switchfin driven IP01. I will then put it in UK for another 落腳點。
作者: ckleea    時間: 2010-10-25 16:50

One more question: If I allow to dial IDD or go via gizmo to US, how can I extend the duration of waitexten long enough to capture all the input? I can be able to input 9 digits but when I input 01747XXXXXXX, the script accepts only 01 and then fails.
作者: bubblestar    時間: 2010-10-25 17:30

本帖最後由 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)
作者: ckleea    時間: 2010-10-25 17:34

本帖最後由 ckleea 於 2010-10-25 20:46 編輯

回復 25# bubblestar

It tries this but still captures the first 2 digits.
Anyway, I think I need to go through all my dialplan scripts to check.

Updated:
Almost done. mobile phone -> 2b -> asterisk server -> IVR -> gizmo -> asterisk extensions ring
Correct called ID




歡迎光臨 電訊茶室 (http://telecom-cafe.com/forum/) Powered by Discuz! 7.2