Developers: IVR, SMS, CRM, Dialers

Visual Basic IVR Interface

The Voicent Visual Basic IVR module contains the following functions:

Call IVR

Synopsis - CallIvr

String CallIvr(ByVal phoneno As String, ByVal appname As String, ByVal selfdelete As Boolean)

Description - CallIvr

Make a phone call to the specified number and use the IVR application to interact and control the phone call.
Parameters
phoneno - The phone number to call.
appname - The name of the deployed IVR application.
selfdelete - Ask the gateway to automatically delete the call request after the call is made if it is set to '1'.

Returns
reqId - The return value is the call request id.

Example - CallIvr

Dim reqId As string = 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.

Call Status

Synopsis - CallStatus

String CallStatus(ByVal reqId As String, ByRef responses As)

Description - CallStatus

Make a phone call to the specificed number and use the IVR application to interact and control the phone call.
Check the call status of the call with <reqId>. If the call is made, the return value is 'Call Made', or if the call is failed, the return value is 'Call Failed', or if the call will retry, the return value is "Call will Retry", and for any other status, the return value is " " (empty string).

Please note that you can have multiple IVR elements that collect responses.

Example - CallStatus

Dim status As String = CallStatus("11234035434", responses)

Source Code

----------------
File Voicent.vb:
----------------
Imports System
Imports System.Net
Imports System.IO

Public Class
Voicent

  ...

  Public Function
CallIvr(ByVal phoneno As String, ByVal appname As String, ByVal selfdelete As Boolean)
    Dim urlstr As String = "/ocall/callreqHandler.jsp"

    ' setting the http post string
    Dim poststr As String = "info=Simple Text Call " + phoneno

    poststr += "&phoneno=" + phoneno
    poststr += "&firstocc=10"
    poststr += "&selfdelete="
    If (selfdelete) Then
      poststr += "1"
    Else
      poststr += "0"
    End If

    poststr += "&startapp=" + appname

    ' Send Call Request
    Dim rcstr As String = PostToGateway(urlstr, poststr)
    Return GetRequestID(rcstr)
  End Function

  Public Function
CallStatus(ByVal reqID, ByRef responses)
    ' call status url
    Dim urlstr As String = "/ocall/callstatusHandler.jsp"

    Dim poststr As String
    poststr = "reqid=" + reqID

    ' Send Call Request
    Dim rcstr As String = PostToGateway(urlstr, poststr)

    ' the responses is the 9th field
    ' the call status is the 3rd field
    ...
  End Function

  ...

End Class