cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6221
Views
6
Helpful
11
Replies

How to send PIN when making a call using SendDigits?

aaronngan
Level 1
Level 1

I'm trying to pass a CiscoIPPhoneExecute XML object to my Cisco IP Phone, so far I have succeed to dial a local number. The problem comes when I dial an IDD number, and I cannot pass the PIN (DTMF) by using the SendDigits command. Following is part of my code:

This is working and the phone dials 12345678

<CiscoIPPhoneExecute> <ExecuteItem Priority="0" URL="Dial:12345678" /> </CiscoIPPhoneExecute>

This IDD call to Sydney does not work, the PIN cannot be passed through to the IP phone. The call is dead after a short wait for user to input PIN.

<CiscoIPPhoneExecute> <ExecuteItem Priority="0" URL="Dial:61404345678" /> <ExecuteItem Priority="0" URL="SendDigits:56789" /> </CiscoIPPhoneExecute>

Can anyone advice me on how to use the send digits command?

1 Accepted Solution

Accepted Solutions

Note the two CiscoINPhoneExecute objects should be sent in separate HTTP POST requests (not the same request).  Also best practice is to wait for the full response from the first request before sending the second - some phones may discard Execute requests which arrive simutlaneously.

View solution in original post

11 Replies 11

amoherek
Cisco Employee
Cisco Employee

Hi Aaron,

I've moved your post to the IP Phone Services sub-space.

Order of execution is not guaranteed, so ExecuteItems will likely not execute in the order in which they are listed in the CiscoIPPhoneExecute object. This may be the reason it is not working.

Try using separate CiscoIPPhoneExecute objects like this:

<CiscoIPPhoneExecute>

<ExecuteItem URL="Dial:918005551212:1:Cisco/Dialer"/>

</CiscoIPPhoneExecute>

<CiscoIPPhoneExecute>

<ExecuteItem URL="SendDigits:6185551212,,987654321,1234:1:Cisco/Dialer"/>

</CiscoIPPhoneExecute>

Thanks,

Adrienne

Hi Aaron,

If you are still seeing issues, please provide logs so we can troubleshoot further.

Thanks,

Adrienne

Hi Adrienne,

Thanks for your reply. After I use separate CiscoIPPhoneExecute objects, I receive a 400 Bad Request error. Here is the way I use separate objects:

My XML Object:

<CiscoIPPhoneExecute>

<ExecuteItem URL="Dial:70000000000000061478765432:1:Cisco/Dialer" />

</CiscoIPPhoneExecute>

<CiscoIPPhoneExecute>

<ExecuteItem URL="SendDigits:56789:1:Cisco/Dialer" />

</CiscoIPPhoneExecute>

Code in c#:

HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(string.Format("http://{0}/CGI/Execute", mIP));

NetworkCredential mNetworkCredential = new NetworkCredential(mAuthenUsername, mAuthenPassword);

string myPostData = "XML=" + myXMLObject;

byte[] myByteArray = Encoding.UTF8.GetBytes(myPostData);

webRequest.Method = "POST";

webRequest.ContentType = "application/x-www-form-urlencoded";

webRequest.ContentLength = myByteArray.Length;

webRequest.Credentials = mNetworkCredential;

using (Stream myRequestStream = webRequest.GetRequestStream())

{

     myRequestStream.Write(myByteArray, 0, myByteArray.Length);

}

Stream myResponseStream = ((HttpWebResponse)webRequest.GetResponse()).GetResponseStream();

XmlTextReader myXMLReader = new XmlTextReader(myResponseStream);

For your information, I am using firmware version 9.1, and model CP7911 / CP7942

May I have your further adivce, please?

Note the two CiscoINPhoneExecute objects should be sent in separate HTTP POST requests (not the same request).  Also best practice is to wait for the full response from the first request before sending the second - some phones may discard Execute requests which arrive simutlaneously.

Hi dstaudt,

Thank you for your advice. I amended the code to pass the two CiscoIPPhoneExecute objects separately. The first object has an execute item to "Dial" a number, the second object has an execute item to pass the PIN number by "SendDigits". I post the second object after I receive an XMLResponseItem for first object, and the response contains a status 0 ("Success").


My First XML Object

<CiscoIPPhoneExecute>

<ExecuteItem URL="Dial:70000000000000061478765432:1:Cisco/Dialer" />

</CiscoIPPhoneExecute>

My Second XML Object

<CiscoIPPhoneExecute>

<ExecuteItem URL="SendDigits:56789:1:Cisco/Dialer" />

</CiscoIPPhoneExecute>

I have successfully post the first XML object, however, for the second XML object I receive a HttpWebResponse with Status: 6, Data: No Active Call.

May I have your further adivce, please?

Are you sending the messages immediately, one after the other?  You may need to delay the second message an arbitrary amount of time (e.g. a second or two) to allow time for the call to proceed.

why not just dial with one or more pauses?

URL="Dial:6140434567,56789"

Hi mstover,

dstaudt's reply is correct for most situations. My case is a bit unusual because when user inputs the PIN, the IDD call has not been made. The IDD is made only when CUCM has checked the PIN is valid.

Using Dial with comma

As far as I observe, the CUCM does not ask for PIN before the call is completely dialed, therefore, using "Dial:6140434567,56789" would be equivalent to dial Dial:614043456756789, and the device will not recognize 56789 is the PIN.

Using SendDigits

The senddigits does not work on my case neither because the IDD call is not made before a correct PIN is received. As a result, I will receive "6: no active call" if I use senddigits.

My solution is just dial the number, and then let the user to key-in the PIN themselves.

Sorry, I misunderstood that you were working with the FAC/CMC feature of CUCM. The commas will work if you are interacting with an application external to CUCM. As you said, it won't work with FAC/CMC.

Yep...I also did not realize 'PIN' was referring to FAC/CMC.  In that case, your observations are correct, XSI will not be able to manage the FAC/CMC entry for the user.

I would note that the CTI interfaces (TAPI/JTAPI) do allow applications to programmatically make calls - including submitting FAC/CMC digits and other post-dial DTMF interactions - if you'd like to continue looking for a solution:

https://developer.cisco.com/site/collaboration/call-control/jtapi/overview/

https://developer.cisco.com/site/collaboration/call-control/tapi/overview/

Note, developing for TAPI/JTAPI is a somewhat more involved undertaking than using IP Phone Services, but the capabilities are correspondingly more powerful...

Thank you both. I'm picking up the terminologies and hopefully can describe my question more effectively. I also have a related issue at [CUCM] How to retrieve the IP Address of user's device?, I appreciate if you are advice me on that related issue as well.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: