gitbock / fritzboxtr064

Binding for openHAB for communicating with AVM FritzBox
16 stars 12 forks source link

Name not found for #12

Closed IT-Berater closed 8 years ago

IT-Berater commented 8 years ago

Hi,

in my rule

rule "ringin"
 when
    Item fboxRinging changed from OFF to ON 
 then
        val CallType incCall = fboxIncomingCall.state as CallType
        var callerName = incCall.destNum 

        val CallType incCallResolve =   fboxIncomingCallResolved.state as CallType
    var callerNameResolve = incCallResolve.destNum

         logInfo("Telefon Anruf von ", "Nr. " + callerName + " -- "  +  callerNameResolve )  
end

i always get Name not found for. What is wrong? Everything else is ok and runs great.

I test Version v1.0.1 and v1.0 on openHAB 1.8.1 with FB 7490, Java 1.8, Debian.

Please help, i need Name from Caller without DB

Greetings Thomas

gitbock commented 8 years ago

Hi, enable debug logging as described here and watch the log file while a phone call is incoming.

IT-Berater commented 8 years ago

This ist my log, its ok!

21:35:28.937 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:244  ] - Parsing response using SOAP value parser in Item map
21:35:28.940 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:599  ] - Parsing FritzBox response for maconline
21:35:29.056 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:628  ] - parsed as 1
21:35:29.130 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:209  ] - Raw SOAP Request to be sent to FritzBox: 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body>
<u:GetCallList xmlns:u="urn:dslforum-org:service:X_AVM-DE_OnTel:1"><NewDays>1</NewDays></u:GetCallList></SOAP-ENV:Body></SOAP-ENV:Envelope>
21:35:29.540 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:225  ] - Raw SOAP Response from FritzBox: <?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetCallListResponse xmlns:u="urn:dslforum-org:service:X_AVM-DE_OnTel:1">
<NewCallListURL>https://9.9.9.9:49443/calllist.lua?sid=XXXXafe4f6b8XXXX</NewCallListURL>
</u:GetCallListResponse>
</s:Body>
</s:Envelope>
21:35:29.643 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:244  ] - Parsing response using SOAP value parser in Item map
21:35:29.659 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:755  ] - Parsing FritzBox response for call list: <?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetCallListResponse xmlns:u="urn:dslforum-org:service:X_AVM-DE_OnTel:1">
<NewCallListURL>https://9.9.9.9:49443/calllist.lua?sid=XXXXafe4f6bXXXX</NewCallListURL>
</u:GetCallListResponse>
</s:Body>
</s:Envelope>
21:35:29.754 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:781  ] - Downloading call list using url https://9.9.9.9:49443/calllist.lua?sid=XXXXafe4f6b8XXXX&days=1
21:35:30.561 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:783  ] - Parsing xml message call list info <?xml version="1.0" encoding="UTF-8"?>
<root>
    <!-- days:1 -->
    <!-- max:999 -->
    <!-- id:nil -->
    <!-- timestamp:nil -->
    <!-- calls:400 -->
    <timestamp>1381852149</timestamp>
      <!-- calls:400 -->
    <timestamp>1381852149</timestamp>
    <Call>
        <Id>6018</Id>
        <Type>3</Type>
        <Called>0511000000</Called>
        <Caller>SIP: 000000</Caller>
        <CallerNumber>999999</CallerNumber>
        <Name/>
        <Numbertype>sip</Numbertype>
        <Device>Stube SL999 </Device>
        <Port>0</Port>
        <Date>15.03.16 19:37</Date>
        <Duration>0:01</Duration>
        <Count/>
        <Path/>
    </Call>
    <Call>
        <Id>6017</Id>
        <Type>3</Type>
gitbock commented 8 years ago

the xml looks odd. Need to compare this to my log file. Also your log does not show the download and parsing of the phone book, but only for the call list. Your problem seems to be related to the phone book download.

IT-Berater commented 8 years ago

The phone book is load (i have 3 in Frizbox, how can change id?) and the entry is right, why no name?

22:16:43.025 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:251  ] - Received raw call string from fbox: 15.03.16 22:16:43;RING;0;015712345678;123456;SIP0;
22:16:43.034 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:130  ] - Successfully parsed Call Event: CallEvent [_timestamp=15.03.16 22:16:43, _callType=RING, _id=0, _externalNo=015712345678, _internalNo=123456, _connectionType=SIP0, _line=null]
22:16:43.042 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:307  ] - resolving name for number 015712345678
22:16:43.052 [INFO ] [o.o.b.f.i.FritzboxTr064Binding:68   ] - Trying to resolve number 015712345678 to name comparing 7 characters
22:16:43.163 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:364  ] - Dispatching call type RING to item fboxIncomingCall as 123456##015712345678
22:16:43.338 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:364  ] - Dispatching call type RING to item fboxIncomingCallResolved as 123456##Name not found for 015712345678
IT-Berater commented 8 years ago

Phonebook is loading:

22:14:28.589 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:628  ] - parsed as 1
22:14:28.667 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:164  ] - call monitor is not running. Configured items require call monitor -> Starting call monitor...
22:14:28.681 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:167  ] - Downloading phonebooks
22:14:28.749 [INFO ] [o.o.b.f.i.FritzboxTr064Binding:137  ] - Downloading phonebook ID 0
22:14:28.861 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:209  ] - Raw SOAP Request to be sent to FritzBox: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><u:GetPhonebook xmlns:u="urn:dslforum-org:service:X_AVM-DE_OnTel:1"><NewPhonebookID>0</NewPhonebookID></u:GetPhonebook></SOAP-ENV:Body></SOAP-ENV:Envelope>
22:14:32.411 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:225  ] - Raw SOAP Response from FritzBox: <?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetPhonebookResponse xmlns:u="urn:dslforum-org:service:X_AVM-DE_OnTel:1">
<NewPhonebookName>Telefonbuch</NewPhonebookName>
<NewPhonebookExtraID></NewPhonebookExtraID>
<NewPhonebookURL>https://9.9.9.9:49443/phonebook.lua?sid=XXXXafe4f6b8XXXX&amp;pbid=0</NewPhonebookURL>
</u:GetPhonebookResponse>
</s:Body>
</s:Envelope>
22:14:33.111 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:140  ] - Downloaded Phonebook:
22:14:34.063 [DEBUG] [o.o.b.f.i.FritzboxTr064Binding:57   ] - <contact>
<category>0</category>
<person>
<realName>Alle (Rundruf)</realName>
</person>
<uniqueid>3</uniqueid>
<telephony>
<services>
</services>
<!-- numbers:1-->
<number prio="1" quickdial="" type="intern" vanity="">**9</number>
<!-- idx:0 -->
<!-- ringtoneidx:nil -->
</telephony>
</contact>
IT-Berater commented 8 years ago

Did you already a solution?

gitbock commented 8 years ago

I can see no obvious error. The parsing and name resolution looks fine so far. Don't have an idea at the moment.

IT-Berater commented 8 years ago

I keep looking. Why comparing only 7 characters? Log: Trying to resolve number 015712345678 to name comparing 7 characters The number is in Phonebook 1. In frizbox i have 3 phonebook!

IT-Berater commented 8 years ago

Its look like that only the call list loaded and not the Phonebook.

IT-Berater commented 8 years ago

How can I change the Phonebook? Or ist the Phonebook to big (300 items)?

gitbock commented 8 years ago

Ah, this is the reason it's not working on your side: Only phonebook with ID 0 is currently supported. You may try to move the contact to the first phone book and retry.

IT-Berater commented 8 years ago

Super, yes that's its :-)

IT-Berater commented 8 years ago

Thanks!

IT-Berater commented 8 years ago

Maybe this feature can add later.