The Voicent Tcl/Tk IVR module contains the following functions:
callIvr phoneno appname selfdelete gateway
set reqId [callIvr "123-4567" "reminderApp", "0"]Make a call to phone number '123-4567' and use 'reminderApp' on the gateway for call interaction. You can use CallStatus to get the call status and responses, or use CallRemove to remove the call record.
callStatusResponse reqId responses gateway
set status = [callStatus "11234035434" responses]
package require http
......
proc callIvr
{ phoneno appname selfdelete {gateway "http://localhost:8155"} } {
set url "$gateway/ocall/callreqHandler.jsp"
set plist [list info "simple text call" \
phoneno $phoneno \
firstocc 10 \
startapp $appname \
selfdelete $selfdelete]
set param [eval ::http::formatQuery $plist]
set token [::http::geturl $url -query $param]
set rcstr [::http::data $token]
::http::cleanup $token
return [getReqId $rcstr]
}
proc callStatus
{reqId responses {gateway "http://localhost:8155"}} {
set url "$gateway/ocall/callstatusHandler.jsp"
set plist [list reqid $reqId]
set param [eval ::http::formatQuery $plist]
set token [::http::geturl $url -query $param]
set rcstr [::http::data $token]
::http::cleanup $token
// the responses is the 9th field
// the status is the 3rd field
return ""
}