ppg push - incorrect pap result?
"Bas A. Schulte" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi all,
I'm using Openwave's WAP push library to push messages to Kannel's ppg,
however, it doesn't work too well. One thing is that the library tells
me the response from the PPG is wrong. I am looking at the XML response
generated by Kannel (cvs version) which looks like this:
<?xml version="1.0"?>
<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 1.0//EN"
"http://www.wapforum.org/DTD/pap_1.0.dtd">
<pap>
<push-response push-id="1" sender-name="bas-laptop.localdomain;
WAP/1.3 (Kannel/cvs-20030307)" reply-time="2003-03-19T14:53:11Z"
sender-address="/wappush">
</push-response>
<response-result code ="1001" desc="The request has been accepted for
processing"></response-result>
</pap>
I compared this to the output of another PPG and looked at the PAP spec
(WAP-247-PAP-20010429-a.pdf). As far as I can tell, it looks like the
document returned by Kannel is not correct: the 'response-result'
element is a child of 'pap', which is not ok according to the spec. It
should be a child of the 'push-response' element. That would look like
this:
<?xml version="1.0"?>
<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 1.0//EN"
"http://www.wapforum.org/DTD/pap_1.0.dtd">
<pap>
<push-response push-id="1" sender-name="bas-laptop.localdomain;
WAP/1.3 (Kannel/cvs-20030307)" reply-time="2003-03-19T14:53:11Z"
sender-address="/wappush">
<response-result code ="1001" desc="The request has been accepted
for processing"></response-result>
</push-response>
</pap>
I just modified gw/wap_push_ppg.c to format the XML like this and now it
works with the Openwave push library.
Can anyone "in the know" comment on this?
Below find the patch,
regards,
Bas.
Index: wap_push_ppg.c
===================================================================
RCS file: /home/cvs/gateway/gw/wap_push_ppg.c,v
retrieving revision 1.51
diff -c -r1.51 wap_push_ppg.c
*** wap_push_ppg.c 15 Feb 2003 01:09:29 -0000 1.51
--- wap_push_ppg.c 19 Mar 2003 15:20:24 -0000
***************
*** 2937,2943 ****
}
octstr_format_append(reply_body, "%s", ">"
- "</push-response>"
"<response-result code =\"");
octstr_format_append(reply_body, "%d", e->u.Push_Response.code);
octstr_format_append(reply_body, "%s", "\"");
--- 2937,2942 ----
***************
*** 2950,2955 ****
--- 2949,2955 ----
octstr_format_append(reply_body, "%s", ">"
"</response-result>"
+ "</push-response>"
"</pap>");
octstr_destroy(url);
***************
*** 3003,3009 ****
octstr_format_append(reply_body, "%s", "\"");
octstr_format_append(reply_body, "%s", ">"
- "</push-response>"
"<response-result code =\"");
octstr_format_append(reply_body, "%d", code);
octstr_format_append(reply_body, "%s", "\"");
--- 3003,3008 ----
***************
*** 3014,3019 ****
--- 3013,3019 ----
octstr_format_append(reply_body, "%s", ">"
"</response-result>"
+ "</push-response>"
"</pap>");
debug("wap.push.ppg", 0, "PPG: tell_fatal_error: %s",
octstr_get_cstr(dos));