OH1 TR064 CallType valid or not?

I had a look through the posts I could find…

I am running OH1 v1.8.3 and the TR064 binding 1.9.0 – is this a valid configuration?

The rule I am working with looks like this:

// ----- 170303 MaxG: fBox incoming call name resolution
rule "fbox_PhoneLine is ringing"
    // fbox_Ringing is a switch item which switches to ON if an incoming call is detected
    // https://community.openhab.org/t/fritzbox-tr064-binding-creation-of-esh-event-failed/10064/14
    // callType no longer exists
    Item fbox_Ringing changed from OFF to ON 
    logInfo("fbox_Ringing.rule", "Generating caller name message...")
    // fbox_Incoming call receives numbers/name of incoming call
    // callerNumber is external number OR resolved name if no phonebook entry exists
    val CallType inCall = fbox_IncomingCallResolved.state as CallType
    //val inCall        = fbox_IncomingCallResolved.state as StringListType
    logInfo("fbox_Ringing.rule", "inCall: {}", inCall)

    //val callerNumber0 = inCall.getValue(0)
    val callerNumber0 = inCall.destNum
    logInfo("fbox_Ringing.rule", "callerNumber0: {}", callerNumber0)

    val tmpCallNum0   = callerNumber0.toString as String
    logInfo("fbox_Ringing.rule", "tmpCallNum0: {}", tmpCallNum0)
    postUpdate(fbox_LastInCall0, tmpCallNum0)

//    val callerNumber1 = inCall.getValue(1)
//    logInfo("fbox_Ringing.rule", "callerNumber1: {}", callerNumber1)

//    val tmpCallNum1   = callerNumber1.toString as String
//    logInfo("fbox_Ringing.rule", "tmpCallNum1: {}", tmpCallNum1)

//    postUpdate(fbox_LastInCall1, tmpCallNum1)

The rule does not work either way, be it CallType or StringListType
… producing the follwing log entry:

2017-03-03 16:49:23 - fbox_Ringing state updated to ON
2017-03-03 16:49:23 - fbox_IncomingCallResolved state updated to 0754246505##Name n                                                                          ot found for 0411511002
2017-03-03 16:49:23 - fbox_IncomingCall state updated to 0754246505##0411511002
2017-03-03 16:49:29 - fbox_Ringing state updated to OFF
2017-03-03 16:49:29 - fbox_IncomingCallResolved state updated to ##
2017-03-03 16:49:29 - fbox_IncomingCall state updated to ##
2017-03-03 16:49:29 - fbox_OutgoingCall state updated to ##
2017-03-03 16:49:29 - fbox_Ringing_Out state updated to OFF

2017-03-03 16:49:23.296 [INFO ] [o.o.b.f.i.FritzboxTr064Binding] - Trying to resolve number 0411511002 to name comparing 7 characters
2017-03-03 16:49:23.506 [INFO ] [model.script.fbox_Ringing.rule] - Generating caller name message...
2017-03-03 16:49:23.807 [ERROR] [o.o.c.s.ScriptExecutionThread ] - Error during the execution of rule 'fbox_PhoneLine is ringing': Cannot cast org.openhab.library.tel.types.CallType to void

Also, my hope was that I would see the incoming call number, however, this is not the case.
My sitemap shows the numbers, but the call ends the numbers are cone.

Since I tried both versions, CallType and StringListType, and get the same result, I wonder:
a) is CallType still valid or not?
b) what causes the error?


Text   item=fbox_Ringing
Text   item=fbox_Ringing_Out
Text   item=fbox_IncomingCall
Text   item=fbox_OutgoingCall
Text   item=fbox_IncomingCallResolved
Text   item=fbox_MissedCalls
Text   item=fbox_LastInCall0
Text   item=fbox_LastInCall1


Switch  fbox_Ringing			"Phone ringing in [%s]"			(gFritzBox)	{fritzboxtr064="callmonitor_ringing"}
Switch  fbox_Ringing_Out		"Phone ringing out [%s]"		(gFritzBox)	{fritzboxtr064="callmonitor_outgoing"}
Call    fbox_IncomingCall		"Incoming call: [%1$s to %2$s]"		(gFritzBox)	{fritzboxtr064="callmonitor_ringing"} 
Call    fbox_OutgoingCall		"Outgoing call: [%1$s to %2$s]"		(gFritzBox)	{fritzboxtr064="callmonitor_outgoing"}
Call    fbox_IncomingCallResolved	"Incoming call: [%1$s to %2$s]"		(gFritzBox)	{fritzboxtr064="callmonitor_ringing:resolveName"}
Number  fbox_MissedCalls		"Missed Calls (last 2 days) [%s]"	(gFritzBox)	{fritzboxtr064="missedCallsInDays:2"}
String  fbox_LastInCall0		"CallerNumber0 [%s]"			(gFritzBox)
String  fbox_LastInCall1		"CallerNumber1 [%s]"			(gFritzBox)

A side issue: the name exists in the pone book, but cannot be resolved…

Any hints appreciated.

Cannot cast org.openhab.library.tel.types.CallType to void

This is because

logInfo("fbox_Ringing.rule", "inCall: {}", inCall)

I don’t know if converting .toString would work either, because CallType is something like an array.

Yes, this must be it; after I got rid off it, this error went away.

I dumped my initial solution in favour for this (working) code.