返回列表 發帖

Some useful dialplans

To reload asterisk
  1. exten = 700,1,Playback(posix-restarting)
  2. exten = 700,2,Wait(1)
  3. exten = 700,3,System(/usr/sbin/asterisk -rx reload)
  4. exten = 700,4,Hangup
複製代碼
settings

To record a message
  1. exten = 310,1,Answer
  2. exten = 310,2,Wait(2)
  3. exten = 310,3,Record(asterisk-recording%d:gsm)
  4. exten = 310,4,Wait(2)
  5. exten = 310,5,Playback(${RECORDED_FILE})
  6. exten = 310,6,Wait(2)
  7. exten = 310,7,Hangup
複製代碼

看ckleea的东西,犹如看报纸的副刊(如果北方人的说话就如小品)一样。

谢谢ckleea。

角色

TOP

Just tried Asterisk reload using the keypad, it works and very convenient.  Thanks ckleea c-hing.  Well done!

TOP

回復 3# bubblestar

Please share yours as well.

TOP

Adding number to blacklist
  1. [blacklist-add]
  2. exten => *22,1,Answer
  3. same => n,Playback(enter-num-blacklist)
  4. same => n,Read(blacklist,then-press-pound,0,,2,10)
  5. same => n,SayDigits(${blacklist})
  6. same => n,Playback(if-correct-press&digits/2)
  7. same => n,Noop(Waiting for input)
  8. same => n,WaitExten(60,)
  9. same => n,Playback(sorry-youre-having-problems&goodbye)
  10. exten => 2,1,Set(DB(BLACKLIST/${blacklist})=1)
  11. same => n,Playback(num-was-successfully&added)
  12. same => n,Wait(1)
  13. same => n,Hangup
複製代碼
Removing number from blacklist
  1. [blacklist-rmv]
  2. exten => #22,1,Playback(entr-num-rmv-blklist)
  3. same => n,Read(blacklist,then-press-pound,0,,2,10)
  4. same => n,SayDigits(${blacklist})
  5. same => n,Playback(if-correct-press&digits/1)
  6. same => n,Noop(Waiting for input)
  7. same => n,WaitExten(60,)
  8. same => n,Playback(sorry-youre-having-problems&goodbye)
  9. exten => 1,1,DBdel(BLACKLIST/${blacklist})
  10. same => n,playback(removed)
  11. same => n,Hangup
複製代碼

TOP

The following script is to record the conversation in the OBi110 channel
  1. ;119 OBi110 OBiTalk
  2. [trunk-obi110-obitalk]
  3. exten => _119.,1,MixMonitor(${EXTEN:3}.wav,a)
  4. exten => _119.,n,Dial(SIP/**9${EXTEN:3}@1910,,)
  5. exten => _119.,n,Hangup()
複製代碼

TOP

本帖最後由 ckleea 於 2011-10-5 21:10 編輯

I use this dialplan to solve the problem of unable to detect DTMF in WaitExten application.

Now I can use this to answer PSTN to Asterisk, then properly read the DTMF keystrokes and proceed
  1. [ivr-0]
  2. exten => 1001,1,Answer
  3. exten => 1001,n,SIPDtmfMode(rfc2833)
  4. exten => 1001,n,Wait()
  5. exten => 1001,n,Background(thank-you-for-calling,m)
  6. exten => 1001,n,Background(vm-enter-num-to-call,m)
  7. exten => 1001,n,Read(Newext,,9)
  8. exten => 1001,n,GotoIf(${Newext:0:1} = 2,3,6?dlocal)
  9. exten => 1001,n,GotoIf(${Newext:0:1} = 9?dhk)
  10. exten => 1001,n,GotoIf(${Newext:0:1} = 0,4,5,7,8?derr)
  11. exten => 1001,n(dlocal),Dial(LOCAL/${Newext})
  12. exten => 1001,n(dhk),DIAL(SIP/**8133${Newext:1}@obitrunk)
  13. exten => 1001,n(derr),Goto(1001,1)
  14. ;exten => 1001,n,WaitExten()
  15. ;exten => 1001,n, Dial(LOCAL/${Newext})
  16. ;exten => 1001,n,Goto(1001,1)
  17. exten => 1001,n,Hangup
複製代碼

TOP

It seems that your code is different from mine.

YH

TOP

回復 8# 角色


    Still not complete. Something wrong. But it is approaching success.

TOP

code updated

TOP

My IVR
  1. ;################## PSTN Gateway ########################

  2. ;TW IVR
  3. exten => 1130,1,Answer
  4. ;exten => 1130,n,Wait(5)  ;for polly TW IVR
  5. exten => 1130,n,Wait(3)
  6. exten => 1130,n,Background(vm-enter-num-to-call)
  7. exten => 1130,n,WaitExten
  8. exten => 1130,n,Playback(vm-goodbye)
  9. exten => 1130,n,Hangup
  10. exten => i,1,Playback(pbx-invalid)
  11. exten => i,2,Goto(1130,1)
  12. exten => t,1,Playback(vm-goodbye)
  13. exten => t,2,n,Hangup
複製代碼

TOP

回復 10# ckleea

你的没有i,t这样的东西。

i: invalide 的时候执行
t: timeout的时候执行

角色

TOP

回復 12# 角色

I can tell you that my Waitexten cannot accept digit starting from 9

TOP

回復 6# 角色


   
Can I use this to record other Asterisk channels?

TOP

回復 14# bubblestar

Yes. Mximonitor can do

TOP

返回列表