ota_compiler.c patch

"Nikos Balkanas" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <00ce01c9e873$5e194fd0$02b2a8c0@tardis>
Hi,

Actually i was mistakenly looking at the wrong place. wap-provisioningdoc 
has being supported all along. However, an incompletely tested feature at 
some point had an undesirable side effect.

Let me know also if you would prefer text to take as value the name of an 
xml file, instead of a huge urlencoded string. this would align it more with 
the documentation. I know I do.

I have no way of testing the code, except running it through the debugger, 
so please test it and let me know how it goes.

BR,
Nikos

----- Original Message ----- 
From: "Nikos Balkanas" <[email protected]>
To: "Julien Buratto" <[email protected]>
Cc: <[email protected]>; <[email protected]>; "Pai Peng" 
<[email protected]>
Sent: Monday, June 08, 2009 11:03 AM
Subject: Re: sendota problems


> Oops! Forgot to ask.
>
> Can't you use a characteristic-list xml document to do your job? Kannel 
> fully supports those!
>
> BR,
> Nikos
> ----- Original Message ----- 
> From: "Nikos Balkanas" <[email protected]>
> To: "Julien Buratto" <[email protected]>
> Cc: <[email protected]>; <[email protected]>; "Pai Peng" 
> <[email protected]>
> Sent: Monday, June 08, 2009 6:11 AM
> Subject: Re: sendota problems
>
>
>> Hi Julien,
>>
>> I looked it up and it is not trivial.
>>
>> As it stands kannel supports only the Nokia OTA characteristic-list 
>> specs. It doesn't support the wap-provisioningdoc specs. As such a 
>> complete reworking of the ota-compiler would be needed to accomodate it.
>>
>> Since I am lacking ota development/testing environment, and is only of 
>> marginal interest to me, I am sorry but I cannot pursue it further. What 
>> I can do is, to make a patch, so that kannel prints an error when it 
>> detects such a document and drops it.
>>
>> BR,
>> Nikos
>> ----- Original Message ----- 
>> From: "Nikos Balkanas" <[email protected]>
>> To: "Julien Buratto" <[email protected]>
>> Cc: <[email protected]>; <[email protected]>
>> Sent: Saturday, June 06, 2009 9:19 AM
>> Subject: Re: sendota problems
>>
>>
>>> Not, unfortunately. I was going crazy all this time at work, but I just 
>>> finished. I will look at it over this weekend.
>>>
>>> BR,
>>> Nikos
>>> ----- Original Message ----- 
>>> From: "Julien Buratto" <[email protected]>
>>> To: "Nikos Balkanas" <[email protected]>
>>> Cc: <[email protected]>; <[email protected]>
>>> Sent: Thursday, May 28, 2009 3:16 PM
>>> Subject: Re: sendota problems
>>>
>>>
>>> Hi Nikos, where you able to fix the issue ?
>>>
>>> 2009/3/17 Nikos Balkanas <[email protected]>:
>>>> Hi,
>>>>
>>>> There seems to be an incombatibility between kannel's wbxml and 
>>>> Nokia's. I
>>>> intend to fix it, but in a month or so. In the meantime you might want 
>>>> to
>>>> compile the message manually, as described by Pai Peng.
>>>>
>>>> BR,
>>>> Nikos
>>>> ----- Original Message ----- From: "Tomas Verbaitis" 
>>>> <[email protected]>
>>>> To: <[email protected]>
>>>> Sent: Monday, March 16, 2009 1:24 PM
>>>> Subject: sendota problems
>>>>
>>>>
>>>> Hello,
>>>>
>>>> I want to configure synchronization for Nokia 6070 mobile phone. My
>>>> program generates this XML provisioning document:
>>>>
>>>> <?xml version="1.0"?>
>>>> <!DOCTYPE wap-provisioningdoc PUBLIC "-//WAPFORUM//DTD PROV 1.0//EN"
>>>> "http://www.wapforum.org/DTD/prov.dtd">
>>>> <wap-provisioningdoc>
>>>> <characteristic type="BOOTSTRAP">
>>>> <parm name="NAME" value="SKLADDEVEL"/>
>>>> </characteristic>
>>>> <characteristic type="APPLICATION">
>>>> <parm name="APPID" value="w5"/>
>>>> <parm name="TO-NAPID" value="INTERNET" />
>>>> <parm name="NAME" value="SKLADDEVEL"/>
>>>> <parm name="ADDR" value="http://megalogika.stp.lt/funambol/ds"/>
>>>> <characteristic type="RESOURCE">
>>>> <parm name="URI" value="card"/>
>>>> <parm name="NAME" value="Contacts DB"/>
>>>> <parm name="AACCEPT" value="text/x-vcard"/>
>>>> </characteristic>
>>>> <characteristic type="RESOURCE">
>>>> <parm name="URI" value="cal"/>
>>>> <parm name="NAME" value="Calendar"/>
>>>> <parm name="AACCEPT" value="text/x-vcalendar"/>
>>>> </characteristic>
>>>> <characteristic type="RESOURCE">
>>>> <parm name="URI" value="notes"/>
>>>> <parm name="NAME" value="Notes"/>
>>>> <parm name="AACCEPT" value="text/plain"/>
>>>> </characteristic>
>>>> <characteristic type="APPAUTH">
>>>> <parm name="AAUTHNAME" value="funUsrVe"/>
>>>> <parm name="AAUTHSECRET" value="funPassVe"/>
>>>> </characteristic>
>>>> </characteristic>
>>>> </wap-provisioningdoc>"
>>>>
>>>> When i send it via Kannel's /sendota, via this request:
>>>>
>>>> /cgi-bin/sendota?password=######&username=######&type=oma-settings&sec=USERPIN&pin=1234&to=%2B37069953201&text=%3C%3Fxml+version%3D%221.0%22%3F%3E%0A%3C%21DOCTYPE+wap-provisioningdoc+PUBLIC+%22-%2F%2FWAPFORUM%2F%2FDTD+PROV+1.0%2F%2FEN%22%0A%22http%3A%2F%2Fwww.wapforum.org%2FDTD%2Fprov.dtd%22%3E%0A%3Cwap-provisioningdoc%3E%0A%3Ccharacteristic+type%3D%22BOOTSTRAP%22%3E%0A%3Cparm+name%3D%22NAME%22+value%3D%22SKLADDEVEL%22%2F%3E%0A%3C%2Fcharacteristic%3E%0A%3Ccharacteristic+type%3D%22APPLICATION%22%3E%0A%3Cparm+name%3D%22APPID%22+value%3D%22w5%22%2F%3E%0A%3Cparm+name%3D%22TO-NAPID%22+value%3D%22INTERNET%22+%2F%3E%0A%3Cparm+name%3D%22NAME%22+value%3D%22SKLADDEVEL%22%2F%3E%0A%3Cparm+name%3D%22ADDR%22+value%3D%22http%3A%2F%2Fmegalogika.stp.lt%2Ffunambol%2Fds%22%2F%3E%0A%3Ccharacteristic+type
 %3D%22RESOURCE%22%3E%0A%3Cparm+name%3D%22URI%22+value%3D%22card%22%2F%3E%0A%3Cparm+name%3D%22NAME%22+value%3D%22Contacts+DB%22%2F%3E%0A%3Cparm+name%3D%22AACCEPT%22+value%3D%22text%2Fx-vcard%22%2F
>>>> %3E%0A%3C%2Fcharacteristic%3E%0A%3Ccharacteristic+type%3D%22RESOURCE%22%3E%0A%3Cparm+name%3D%22URI%22+value%3D%22cal%22%2F%3E%0A%3Cparm+name%3D%22NAME%22+value%3D%22Calendar%22%2F%3E%0A%3Cparm+name%3D%22AACCEPT%22+value%3D%22text%2Fx-vcalendar%22%2F%3E%0A%3C%2Fcharacteristic%3E%0A%3Ccharacteristic+type%3D%22RESOURCE%22%3E%0A%3Cparm+name%3D%22URI%22+value%3D%22notes%22%2F%3E%0A%3Cparm+name%3D%22NAME%22+value%3D%22Notes%22%2F%3E%0A%3Cparm+name%3D%22AACCEPT%22+value%3D%22text%2Fplain%22%2F%3E%0A%3C%2Fcharacteristic%3E%0A%3Ccharacteristic+type%3D%22APPAUTH%22%3E%0A%3Cparm+name%3D%22AAUTHNAME%22+value%3D%22funUsrVe%22%2F%3E%0A%3Cparm+name%3D%22AAUTHSECRET%22+value%3D%22funPassVe%22%2F%3E%0A%3C%2Fcharacteristic%3E%0A%3C%2Fcharacteristic%3E%0A%3C%2Fwap-provisioningdoc%3E
>>>>
>>>> it generates a single sms message:
>>>>
>>>> 0051000B9173x0xxxxxxFx0004A7870605040B840B8401062F1F2DB69181923738424536353833373946364436324435394544374431323831443536454141423541343346353500030B6A0045C65003424F4F54535452415000018705034E414D45000603534B4C4144444556454C000101C650034150504C49434154494F4E0001870503415050494400060377350001870503544F
>>>>
>>>> which is successfully delivered to the handset which then claims that 
>>>> it
>>>> is 'Unable to save settings. Setttings discarded.'
>>>>
>>>> I tried this via GET request and POST request as well (not XML post,
>>>> though, because I could not find anything concerning OMA CP in the
>>>> examples provided in Kannel user guide).
>>>>
>>>> Meanwhile, NowSMS generates 3 messages:
>>>>
>>>> 0051000B917xx0xxxxxxFx0004A78C0B05040B8423F0000305030105062F1F2DB69181924144304542424539423642323245443636433746433236353435373437433036373243394243454300030B6A0C54657374310074657374310045C6560187070683000101C6000155018736000006037735000187220603494E5445524E455400018707068300018700013400000603687474703A2F2F6D
>>>>
>>>> 0051000B9173x0xxxxxxFx004A77D0B05040B8423F0000305030320444200018700012E00000603746578742F782D7663616C656E646172000101C600015901873A000006032E2F6E6F7465730001870706034E6F74657320444200018700012E00000603746578742F706C61696E000101C600015701873100000683060187000132000006830601010101
>>>>
>>>> 0051000B9173x0xxxxxxFx0004A78C0B05040B8423F000030503026567616C6F67696B612E7374702E6C742F66756E616D626F6C2F64730001C600015901873A000006032E2F636F6E7461637473000187070603436F6E746163747320444200018700012E00000603746578742F782D7663617264000101C600015901873A000006032E2F63616C656E64617200018707060343616C656E646172
>>>>
>>>> which are successfully delivered to the phone and recognized by it as a
>>>> valid and working synchronization settings. Funnily enough, these three
>>>> messages are routed via the same kannel.
>>>>
>>>> Therefore my questions are:
>>>> * is Kannel wrongly transforming my request into OMA settings 
>>>> provisioning
>>>> message?
>>>> * if so, is it because of my error or because of a bug in Kannel?
>>>>
>>>> any other advice?
>>>> --
>>>> Tomas "Verbaitis" Verbaitis ** http://megalogika.lt
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> -- 
>>> Julien Buratto
>>
>
ota_compiler.diff (application/octet-stream, 1.4 KB)
Index: gw/ota_compiler.c
===================================================================
RCS file: /home/cvs/gateway/gw/ota_compiler.c,v
retrieving revision 1.17
diff -a -u -r1.17 ota_compiler.c
--- gw/ota_compiler.c	12 Jan 2009 16:46:57 -0000	1.17
+++ gw/ota_compiler.c	8 Jun 2009 19:42:48 -0000
@@ -234,9 +234,8 @@
  */
 
 static ota_3table_t oma_ota_attributes[] = {
-    { "VERSION", "INLINE", 0x45 },  
     { "VERSION", "1.0", 0x46 },
-    { "TYPE", "INLINE", 0x50 },
+    { "VERSION", "INLINE", 0x45 },
     { "TYPE", "PXLOGICAL", 0x51 },
     { "TYPE", "PXPHYSICAL", 0x52 },
     { "TYPE", "PORT", 0x53 },
@@ -259,7 +258,7 @@
     { "TYPE", "EAP", 0x5C, 1 },
     { "TYPE", "CERT", 0x5D, 1 },
     { "TYPE", "WEPKEY", 0x5E, 1 },
-    { "NAME", "INLINE", 0x5 },
+    { "TYPE", "INLINE", 0x50 },
     { "NAME", "NAME", 0x7 },
     { "NAME", "NAP-ADDRESS", 0x8 },
     { "NAME", "NAP-ADDRTYPE", 0x9 },
@@ -378,7 +377,7 @@
     { "NAME", "EDIT-SET", 0x71, 1 },
     { "NAME", "VIEW-SET", 0x72, 1 },
     { "NAME", "FORW-SET", 0x73, 1 },
-    { "VALUE", "INLINE", 0x6 },     
+    { "NAME", "INLINE", 0x5 },
     { "VALUE", "IPV4", 0x85 },
     { "VALUE", "IPV6", 0x86 },
     { "VALUE", "E164", 0x87 },
@@ -445,6 +444,7 @@
     { "VALUE", "DIGEST", 0x93, 1 },
     { "VALUE", "AAA", 0xE0 },
     { "VALUE", "HA", 0xE1 },
+    { "VALUE", "INLINE", 0x6 },
 };
 
 #define OMA_VALUE_TAG 0x06
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.