|
[VB.NET] | |
Function SayWithDigitEvent
(NotificationID As String, Text As String, LastDigits As String, MaxNumbers As int)
As
String |
|
NotificationID |
Notification ID |
Text |
Text to say |
LastDigits |
Specifies terminating digits. Valid values ['0'-'9', '#', '*'] |
MaxNumbers |
Specifies maximum amount of digits to gather. |
|
Digits that was pressed on the phoneset keypad |
VB.NET
Example |
Switch to language:
[C#] |
|
| 'Create personalizer object and Session object |
| Dim pers As New PersonalizerRef.Personalizer()
|
| Dim sess As New SessionRef.Session()
|
| Dim SessionID As
String = "" |
| Try |
| SessionID = pers.CreateSession("LogonName", "Password") |
| 'Create Phone notification object |
| Dim objPhone As New PhoneRef.Phone()
|
| Dim PhoneNotifID As
String = sess.CreatePhoneNotification(SessionID) |
| objPhone.Call(PhoneNotifID,"1-800-123-4567") |
| Dim resp As
String=objPhone.SayWithDigitEvent(PhoneNotifID, _ |
| "To play file press 0, otherwise press 9", "09",4) |
| If resp = "0" Then |
| resp = objPhone.PlayFileWithDigitEvent(PhoneNotifID, "Prompt.wav", "012", 4) |
| End If |
| objPhone.HangUp(PhoneNotifID) ' close connection |
| objPhone.Release(PhoneNotifID) |
| sess.Release(SessionID) |
| Catch e As Exception |
| 'Print exception message e.Message |
| sess.Release(SessionID) |
| End Try |