The Voicent C++ IVR module contains the following functions:
CallIvr(const char* phoneno, const char* appname, BOOL selfdelete = false)
CallIvr('123-4567', 'reminderApp',1)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.
CallStatus(const char* reqId, cMapStringToString& responses)
CString status = CallStatus("11234035434", responses)
if (responses["AttendMeeting"] == "1") { ... }
---------------
File Voicent.h:
---------------
class Voicent
{
public:
...
// Call Request. Return reqId of this call record on the gateway
CString CallIvr(
const char* phoneno, // phone number
const char* appname, // deployed IVR
application name
BOOL selfDelete = false); // delete call record after call
made
// Get call status
CString CallStatus(const char*
reqId, // Call record reqId
CMapStringToString& responses);
...
};
-----------------
File voicent.cpp:
-----------------
...
CString Voicent::CallIvr(const
char* phoneno, const char* appname, BOOL selfDelete)
{
// call request url
CString urlstr = "/ocall/callreqHandler.jsp";
// setting the http post string
CString poststr;
poststr += "info=";
poststr += URLEncode(CString("Simple Text Call ") + phoneno);
poststr += "&phoneno=";
poststr += phoneno;
poststr += "&firstocc=10";
poststr += "&selfdelete=";
poststr += (selfDelete ? "1" : "0");
poststr += "&startapp=";
poststr += URLEncode(appname);
// Send Call Request
CString rcstr;
if (! PostToGateway(m_host, m_port, urlstr, poststr, rcstr))
return "";
return GetReqId(rcstr);
}
CString Voicent::CallStatus(const
char* reqId, CMapStringToString& responses)
{
// call status url
CString urlstr = "/ocall/callstatusHandler.jsp";
// setting the http post string
CString poststr = "reqid=";
poststr += URLEncode(reqId);
// Send Call Request
CString rcstr;
if (! PostToGateway(m_host, m_port, urlstr, poststr, rcstr))
return "";
return GetCallStatus(rcstr, responses);
}
...