|
[C#] | |
String
WaitDigits
(String NotificationID, int Timeout, int MaxNumbers, String LastDigits)
|
|
NotificationID |
Notification ID |
Timeout |
Specifies maximum timeout value for digits gathering operation |
MaxNumbers |
Specifies maximum amount of digits to gather. |
LastDigits |
Specifies terminating digits. Valid values ['0'-'9', '#', '*'] |
|
Digits that was pressed on the phoneset keypad |
|
| //Create personalizer object and Session object |
| PersonalizerRef.Personalizer pers = new PersonalizerRef.Personalizer()
; |
| SessionRef.Session sess = new SessionRef.Session()
; |
| string SessionID = ""; |
| try{ |
| SessionID = pers.CreateSession("LogonName", "Password"); |
| //Create Phone notification object |
| PhoneRef.Phone objPhone = new PhoneRef.Phone()
; |
| string PhoneNotifID = sess.CreatePhoneNotification(SessionID); |
| objPhone.Call(PhoneNotifID,"1-800-123-4567"); |
| objPhone.Say(PhoneNotifID, "Can you hear this text? If yes press 0."); |
| string resp = objPhone.WaitDigits(PhoneNotifID,30,1,"#")
;
//Get response from user |
| objPhone.PlayDigits(PhoneNotifID,resp)
;
//playback user response |
| objPhone.HangUp(PhoneNotifID)
;
// close connection |
| objPhone.Release(PhoneNotifID); |
| sess.Release(SessionID); |
| } |
| catch(Exception e){ |
| //Print exception message e.Message |
| sess.Release(SessionID); |
| } |