cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
13248
Views
6
Helpful
16
Replies

How to send a text to IP Phone using JTAPI?

jksharma4
Level 1
Level 1

I have been searching this site but I could not find a link which explains how to send a simple text message to IP Phone? What are the pre requites?

Thanks

16 Replies 16

amoherek
Cisco Employee
Cisco Employee

Hi Jayakumar,

The CiscoIPPhoneText XML object displays ordinary 8-bit ASCII text on the phone display.(see https://developer.cisco.com/web/ipps). This isn't SMS. Instead what you are sending is XML to the IP Phone. If you want JTAPI to send this XML to the phone you will need to use sendData() method.

Thanks,

Adrienne

I am using CISCO IPPS and sending a message using CiscoIPPhoneText but i am getting connection timeout. I am using http://" + phoneIP + ":port/CGI/Execute and sending the above object in the post. I don't find any senddata in IPSS. Can you please give some guidace or point me to correct location of the documentation?

Thx

Hi Jayakumar,

STEP 1:

First verify the CiscoIPPhoneText you are pushing to the phone works. You will need to associate the device to an end user before pushing the XML to the phone.

Use this HTML to push the XML to the phone via a form post. Make sure you replace the IP Address in this example with the IP Address of your phone.

<HTML>

<BODY>

<FORM action="http://192.168.168.185/CGI/Execute" Method="POST">

<TEXTAREA NAME="XML" style="width:500px;height:300px">

<CiscoIPPhoneText>

<Title>Title</Title>

<Text>Text</Text>

<SoftKeyItem>

<Name>Exit</Name>

<URL>Init:Services</URL>

<Position>1</Position>

</SoftKeyItem>

</CiscoIPPhoneText>

</TEXTAREA>

<BR>

<input type="submit" value="POST">

</FORM>

</BODY>

</HTML>

After clicking on the POST button, you will be asked for the end user's credentials. After entering them, you should see a successful response in XML.

STEP 2:

To use JTAPI to send the XML to the phone instead of a form post, use the sendData() method, and insert the XML into the request:

<CiscoIPPhoneText>

<Title>Title</Title>

<Text>Text</Text>

<SoftKeyItem>

<Name>Exit</Name>

<URL>Init:Services</URL>

<Position>1</Position>

</SoftKeyItem>

</CiscoIPPhoneText>

Thanks,

Adrienne

Adrienne,

Thanks for you post above!  Very good information.  Would you have the HTML code to send it to multiple phones?

Thanks,

Mike Cloud

Adrienne,

Thank you very much ad this is very useful, I will try.

Thanks

I could not find documentation on sendData, could you please help?

Thx

Hi Jayakumar,

I forgot to mention that you can download the sample app to push text to the phone on the downloads page - JTAPI XSI Device Data Pass Through Sample Application.zip

To understand the JTAPI methods, I highly recommend downloading the JavaDocs Interface Specs on the download page here - https://developer.cisco.com/site/collaboration/call-control/jtapi/documentation/

sendData(String) has been deprecated, and has been replaced by sendData(byte[]).

Here's information about sendData(byte[]) taken from the JavaDocs:

sendData

byte[] sendData(byte[] terminalData)

throws javax.telephony.InvalidStateException, javax.telephony.MethodNotSupportedException

Sends data to the phone. The CiscoTerminal must be in the CiscoTerminal.IN_SERVICE state, and its Provider must be in the Provider.IN_SERVICE state. Applications can push the XSI object in the byte format to the phone with this interface. If the phone receives the data, this method returns successfully. Applications may only send 2000 bytes of data with this interface. Requests carrying excess data get rejected.

Thanks for all the information. I am getting provider is null error when I try to execute my program and I am passing destination IP address, user name and password.

provider = peer.getProvider ( providerString );

Am I missing any configuration?

Thx

You need to follow below steps to connect with CUCM CTI Manager-

1)Create application user with "Standard CTI Enabled" groups assigned to this user. More groups may require as per your app needs.

2)Assign devices which u want to monitor & control

Then write code as below to connect with CUCM-

try

         {

            conditionInService = new Condition ();

            String providerString =createProviderString();

            JtapiPeer peer = JtapiPeerFactory.getJtapiPeer ( null );

            provider = peer.getProvider (providerString );

            provider.addObserver (this);

            conditionInService.waitTrue();

            try

            {

                ((CiscoProvider)provider).registerFeature(CiscoProvFeatureID.TERMINAL_REGISTER_UNREGISTER_EVENT_NOTIFY);

            } catch (InvalidStateException ec)

            {

                objLoger.error("createProvider","[registerFeature Execption-1="+ec.getMessage()+"]");

            }

            conditionInService.waitTrue ();

catch(Exception e)

        {

            objLoger.error("createProvider","[Execption-3="+e+"]");

}

Make sure that u r providing IP address of CTI Manager which is currently active.

Also check ur enterprise firewall is not blocking the request.

Regards,

Umesh

Hi Adrienne

Do you know how this could be sent to multiple phones?

Thanks

Each phone is represented by a Cisco Terminal object. You can enumerate all the terminals from Provider and use the API on all terminals.

You need to go through the JTAPI 1.2 spec and Cisco JTAPI developer guide to get an understanding on JTAPI call model and its API.

I'am able to push XML using HTML Post. And its working for me. As per the requirement i need to display same text on multiple phones of same type [about 200 phones]. Is there any way to do that? Any help is appreciated, as it is difficult to do one by one.

Thanks

See Mohan's response above.  You need to enumerate all the terminals and send the text in a loop to each of them.  There's no "send text to all these phones" method.

"Each phone is represented by a Cisco Terminal object. You can enumerate all the terminals from Provider and use the API on all terminals.  You need to go through the JTAPI 1.2 spec and Cisco JTAPI developer guide to get an understanding on JTAPI call model and its API."