cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
750
Views
3
Helpful
6
Replies

Is there a way to decline an incoming call using jtapi?

royp1
Level 1
Level 1

I have a JTAPI application which can deflect incoming call to another diallable destination using Connection.redirect(destination), but is there any method that will decline the incoming call - resulting in the call being diverted to Voice Mail (without knowing the VM pilot number)?

2 Accepted Solutions

Accepted Solutions

dstaudt
Cisco Employee
Cisco Employee

AFAIK not dynamically.  You can enable call-forwarding to voicemail, but that has to be done before the call.
However, your application can query the configured voicemail profile/pilot at the time of desired 'rejection' and redirect accordingly: https://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cucm/jtapi_dev/14_0_1/cucm_b_cisco-unified-jtapi-developers-guide-14/cucm_b_cisco-unified-jtapi-developers-guide-1251_chapter_010.html#CUCM_TP_V7645166_00

View solution in original post

royp1
Level 1
Level 1

Thanks, @dstaudt.

I came across the Connection.reject() method in the javadocs for CallControlTerminalConnection. However when applied to an incoming call (without answering it), I get InvalidStateException thrown - stating that preconditions are not met. Whereas in the same conditions Connection.redirect(destination) - works fine.

Not sure exactly what use-case is covered by the Connection.reject() method then?

On Cisco phones 88xx - when an incoming call is ringing we get 2 options - Answer and Decline on soft buttons. When i Select Decline, the call goes to voice mail. I would lile to know what TAPI/JTAPI method does the Decline button invoke from the physical phone device if it is not the reject() method? 
As a last resort I am inclined to use the sendData to execute CiscoIPPhone with the payload for Decline soft key over JTAPI connection.

 

 

View solution in original post

6 Replies 6

dstaudt
Cisco Employee
Cisco Employee

AFAIK not dynamically.  You can enable call-forwarding to voicemail, but that has to be done before the call.
However, your application can query the configured voicemail profile/pilot at the time of desired 'rejection' and redirect accordingly: https://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cucm/jtapi_dev/14_0_1/cucm_b_cisco-unified-jtapi-developers-guide-14/cucm_b_cisco-unified-jtapi-developers-guide-1251_chapter_010.html#CUCM_TP_V7645166_00

royp1
Level 1
Level 1

Thanks, @dstaudt.

I came across the Connection.reject() method in the javadocs for CallControlTerminalConnection. However when applied to an incoming call (without answering it), I get InvalidStateException thrown - stating that preconditions are not met. Whereas in the same conditions Connection.redirect(destination) - works fine.

Not sure exactly what use-case is covered by the Connection.reject() method then?

On Cisco phones 88xx - when an incoming call is ringing we get 2 options - Answer and Decline on soft buttons. When i Select Decline, the call goes to voice mail. I would lile to know what TAPI/JTAPI method does the Decline button invoke from the physical phone device if it is not the reject() method? 
As a last resort I am inclined to use the sendData to execute CiscoIPPhone with the payload for Decline soft key over JTAPI connection.

 

 

dstaudt
Cisco Employee
Cisco Employee

CallControlTerminalConnection.reject() is only valid if the call is in the CallControlTerminalConnection.OFFERED state; however Cisco IP Phones under CTI control are modeled as always automatically/immediately performing CallControlTerminalConnection.accept() on incoming calls, which moves the state to CallControlTerminalConnection.ALERTING - this causes any attempt to reject() to fail with invalid state.
(Note, accept()/reject() only come into play with application-controlled CTI Ports/CTI Route Points, which do not by default auto-accept().)

Thank you so much, @dstaudt for clarifying the use cases for the two methods and workings of CTI enabled IP phones.

I did notice the precondition as OFFERED, and call state immediately progressing to ALERTING in quick succession of JTAPI events without giving a chance to interact with the OFFERED event for the physical phone. I was however able to process the OFFERED event for CTI route points and CTI ports and get the caller and called party info.

It would be good to know what TAPI/JTAPI method does the Decline soft button on the phone invoke from the physical phone device when the incoming call is ringing (Call would be in ALERTING state - right?)

Best regards

dstaudt
Cisco Employee
Cisco Employee

AFAIK the Decline soft key initiates an Immediate Divert operation, which is implemented as a redirect to the voice mail pilot.  There is this note, which I think hints at my thoughts above on determining the VM number and redirecting there:

dstaudt_0-1695413812780.png

 

royp1
Level 1
Level 1

Thank you so much, David. That clarifies a lot of things for me.
I have already implemented redirect to voice mail pilot. (currently configurable) - but you are right I should query it and get it at run time in the future version. As an alternative i have also implemented sendData to "press" the Decline button on the Phone itself - which should do the same function - as you kindly explained in your last reply.

Yet to test as our Dev lab's Call Manager 12.5 has suddenly died
Will update here if successful or any issues - to complete the thread in case anyone else is interested.