|
| [C#] | |
| String
SayWithDigitEvent
(String NotificationID, String Text, String LastDigits, int MaxNumbers)
|
|
| 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 |
|
| | //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"); |
| | string resp=objPhone.SayWithDigitEvent(PhoneNotifID, |
| | "To play file press 0, otherwise press 9", "09" ,4); |
| | if(resp == "0"){ |
| | resp = objPhone.PlayFileWithDigitEvent(PhoneNotifID, "Prompt.wav", "012", 4); |
| | } |
| | objPhone.HangUp(PhoneNotifID)
;
// close connection |
| | objPhone.Release(PhoneNotifID); |
| | sess.Release(SessionID); |
| | } |
| | catch(Exception e){ |
| | //Print exception message e.Message |
| | sess.Release(SessionID); |
| | } |