cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
535
Views
5
Helpful
4
Replies

IP Phone disconnect detection

Hello , 

we are trying to detect if a Cisco TAPI device ( can be IP Phone , IP Communicator etc)  is disconnected from the network or powered off .  From Cisco TAPI we couldnt find an option to get an event in the case of such an incident.  We are not getting any events in the line call back also  if a network disconnect or power off is happening.   We also tried using the PHONECALLBACK function , but the initialize using phoneInitializeExA  is returning 0 devices although we have one IP communicator being registered in the CUCM.   Any help to resolve this issue is highly appreciated. 

 

Thanks and Regards

Abdul Rasheed

4 Replies 4

dstaudt
Cisco Employee
Cisco Employee

In general, any time a monitored device is no longer visible to CTI Manager (i.e. due to network disconnect or power off), the monitoring TAPI application will receive PHONE_STATE (PHONESTATE_SUSPEND) and/or LINE_LINEDEVSTATE (LINEDEVSTATE_OUTOFSERVICE) messages.  When the device re-registers, corresponding PHONE_STATE (PHONESTATE_RESUME) / LINE_LINEDEVSTATE
(LINEDEVSTATE_INSERVICE) messages will indicate monitoring/control can be resumed.

Thank you dstaudt .  Are these PHONE_STATE messages available in the line call back function initialized from lineInitializeEx API ?  i think LINEDEVSTATE events will be available in line call back function , but i was wondering if PHONE_STATE events will be reported in another call back function , can you please clarify ? .  Also we didnt recieve any LINEDEVSTATE events during the disconnection of the phone.  Will it take some time to get these events ?

 

Thanks

Rasheed

The PHONE stuff is a different callback, i.e. from implementing phoneInitializeEx - possibly not necessary since you're already using the LINE interface, unless there is other functionality in the PHONE area you need.

Looks like you will need to do lineSetStatusMessages with dwLineStates setting INSERVICE and OUTOFSERVICE in order to receive the events.
As these events are indirect - CTI Manager being the 'source of truth' for the device connectivity status - timing could be an issue depending on the device's signaling protocol (UDP may take longer to detect than TCP) and the nature of the de-registration, i.e. a graceful/TCP IP Communicator exit (instant) vs. removing the network cable from a UDP/SIP desk phone (could take 3 x heartbeat-interval to detect.)

Hi dstaudt, 

Thank you for your assistance.  We initialized the app using lineinitialize  , then opened each line with lineopen and then for each line we called the lineSetStatusMessages with dwLineStates  = LINEDEVSTATE_OUTOFSERVICE .  we tested it with one IP communicator and we have closed the IP communicator to see if the LINEDEVSTATE_OUTOFSERVICE is triggered in the line call back  but it is not happening.  Following is the code snippet where we are logging these messages if LINEDEVSTATE_OUTOFSERVICE is triggered. 

 

ase LINE_LINEDEVSTATE:
{
switch (dwParam1)
{
case LINEDEVSTATE_OUTOFSERVICE:
{
sprintf(logString,"*************LINEDEVSTATE_OUTOFSERVICE [%d]",dwDevice);
// OutputDebugString(logString);
cTapi->m_pLog->WriteLog(GENERAL_ERROR,logString);

}break;
case LINEDEVSTATE_INSERVICE:
{
sprintf(logString,"*************LINEDEVSTATE_INSERVICE [%d]",dwDevice);
// OutputDebugString(logString);
cTapi->m_pLog->WriteLog(GENERAL_ERROR,logString);

}break;
default:
{
sprintf(logString,"*************LINE_LINEDEVSTATE [%d]",dwDevice);
// OutputDebugString(logString);
cTapi->m_pLog->WriteLog(GENERAL_ERROR,logString);
}
break;
}
}break;

 

To include both  INSERVICE and OUTOFSERVICE in the dwlinestate parameter ,  we tried to do the logical OR .  But still it didnt work out.  

can you please let us know your suggestions. 

 

Thanks and Regards

Abdul Rasheed