Voicent Gateway Visual Basic Simple 
              Interface
              In addition to the basic Voicent Visual Basic Simple Interface class,               the extended API contains the following functions. 
              
              The extended Visual Basic interface source code is 
              included at the end of this section. 
               
              SYNOPSIS 
              
                - String                 CallIvr(ByVal phoneno As String, ByVal appname As 
                String, ByVal selfdelete As Boolean)
 
               
              DESCRIPTION 
              
                - Make a phone call to the specified number and use the IVR                 application to interact and control the phone call.
 
  
                - The options are:
 
                -  
                  
                    |  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' | 
                   
                 
                The return value is the call request id <reqId>.  
               
              EXAMPLE 
              
                - Dim reqId 
                As string = 
                CallText("123-4567", "reminderApp", 0)
 
  
                - Make a call to phone number '123-4567' and use 'reminderApp' 
                on the gateway for call interaction. You can  use  
                CallStatusResponse to get the call status and responses, or use  
                CallRemove to remove the call record.
 
                -  
 
                 
               
              SYNOPSIS 
              
                - String                 CallStatus(ByVal reqId As String, ByRef responses As )
 
               
              DESCRIPTION 
              
                - 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
                "".
 
                 
                Please note that an empty string is returned if the call is 
                still in progress. You'll need to wait and then poll the status 
                again. 
               
              EXAMPLE 
              
                - Dim status 
                As String = 
                CallStatus("11234035434", responses)
 
                -  
 
               
               
              
                
                ---------------- 
                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 
                 
 
                 |