Hi all,
I have written a script to allow checking voicemail on remote PBX’s using Dundi. Play with it. Pound on it, improve it and post your results here.
[from-internal-custom]
;Check remote voicemail using Dundi Trunk.
;Place this code in extensions_custom.conf under [from-internal-custom]
;
; You must set up an outbound route in FreePBX with the match pattern
;*98XXXX that uses only your Dundi Trunk. Change the number of “X’s” to fit
;your your needs.
;
; You must have an inbound context in extensions_custom.conf for the
;Dundi inbound on all of the machines that allows advertising of _*98XXXX
;such as
;[dundi-priv-customers]
; If you are an ITSP or Reseller, list your customers here. (dundi priority 100)
; exten => _*98XXXX,1,goto(from-internal,${EXTEN},1)
;
; change the *98XXXX to match the extension sequence on that machine
; such as _*9821XX if all of the extensions are 4 digits and start with 21.
; Replace 54 in line 2 of both sections with the numbering sequence
;used on your local server. If all of your extensions on this
;machine start with 23, change it to 23 in both places
;
; Theory of Operation
;You dial *98 or *98XXXX. This section intercepts that before it gets to
;app-dialvm. If the sequence of extensions on your machine matches, it
;sends the call to app-dialvm on the local machine as the extension is
;local. If there is no match, it sends it out the Dundi trunk to check
;the cloud. If the match fails in the cloud, you get all circuits are busy.
;
exten => *98,1,Answer()
exten => *98,n(top),Set(Seq=54)
exten => *98,n,Set(Length=${LEN(${Seq})})
exten => *98,n,Wait(1)
exten => *98,n,Read(ex|vm-login|||2|2)
exten => *98,n,GotoIf($["${ex:0:${Length}}" = “${Seq}”]?app-dialvm,*98${ex},1)
exten => *98,n,Goto(outbound-allroutes,*98${ex},1)
exten => *98,n,hangup()
exten => _*98x.,1,Answer()
exten => _*98x.,n,Set(Seq=54)
exten => _*98x.,n,Set(Length=${LEN(${Seq})})
exten => _*98x.,n,GotoIf($[${EXTEN:3:${Length}} = ${Seq}]?app-dialvm,${EXTEN},1)
exten => _*98x.,n,goto(outbound-allroutes,${EXTEN},1)
exten => _*98x.,n.goto(from-internal,*98,1)
exten => _*98x.,n,hangup()