1
Vote

No call events for newly created lines

description

Lines added after the initial ATAPI initialisation do not fire any call events, although the lines are controllable.

The fix for this issue is a code change in the wrapper to register the TapiManager event handlers immediately following creation of the new TAPILine in TapiManager.ProcessTapiMessage.

This is tested against CUCM 9.1 where lines are removed and added when mobility users log-out and log-in to handsets.
case TapiEvent.LINE_CREATE:
{
    var newLine = new TapiLine(this, msg.dwParam1.ToInt32());

    // Added event handler registration
    newLine.NewCall += HandleNewCall;
    newLine.CallStateChanged += HandleCallStateChanged;
    newLine.CallInfoChanged += HandleCallInfoChanged;
    newLine.AddressChanged += HandleAddressChanged;
    newLine.Changed += HandleLineChanged;
    newLine.Ringing += HandleLineRinging;
    // End of change

    lock (_lineArray)
    {
        _lineArray.Add(newLine);
    }
    if (LineAdded != null)
        LineAdded(this, new LineAddedEventArgs(newLine));
}
break;

comments