Re: Wap Push Java Code
Walikum AsSalam Monim: Here is my configuration for wappush group = wapbox bearerbox-host = localhost log-file = /var/log/kannel/wapbox.log log-level = 0 syslog-level = none group = ppg ppg-url = /wappush ppg-port = 8080 concurrent-pushes = 100 users = 1024 ppg-allow-ip = 127.0.0.1 trusted-pi = true service-name = ppg1 I don't see any change or point that makes a difference here Regards, Ishtiaq Ahmed Monim Benaiad wrote: Asalam Alaikom Ishtiaq: the message is being delivered in two segments Maybe it's a configuration issue, because I've tested this with many types of ME , even with Chinese brands and it works the wap push message successfully received and recognized by the ME. here my configuration regarding ppg and wap box: group = wapbox bearerbox-host = localhost log-file= /var/log/wapbox.log log-level = 1 syslog-level= none group = ppg ppg-url = /wappush ppg-port = 55012 concurrent-pushes = 100 users = 1024 ppg-allow-ip = 127.0.0.1;192.168.0.* trusted-pi= true service-name = ppg1 group = wap-push-user wap-push-user = wappush ppg-username= foo ppg-password= bar allow-ip= 127.0.0.1;192.168.0.* Regards. On Tue, Mar 3, 2009 at 7:33 AM, Ishtiaq Ahmed ishtiaq.ah...@ooober.com mailto:ishtiaq.ah...@ooober.com wrote: Hi Monim, We have tried the method you wrote... but its the same issue.. the message is being delivered in two segments... Following are the wappush logs.. 2009-03-03 10:23:34 [17163] [11] DEBUG: HTTP: Creating HTTPClient for `172.21.21.21'. 2009-03-03 10:23:34 [17163] [11] DEBUG: HTTP: Created HTTPClient area 0x32a9170. 2009-03-03 10:23:34 [17163] [14] WARNING: Your ppg core configuration allow all ips 2009-03-03 10:23:34 [17163] [14] INFO: PPG: Accept request /wappush from 172.21.21.21 2009-03-03 10:23:34 [17163] [14] DEBUG: PPG: http_read_thread: pap multipart accepted 2009-03-03 10:23:34 [17163] [14] INFO: client address was +923028560819, accepted 2009-03-03 10:23:34 [17163] [14] DEBUG: PAP COMPILER: doing semantic analysis for address type a phone number 2009-03-03 10:23:34 [17163] [14] DEBUG: using defaults instead of anys 2009-03-03 10:23:34 [17163] [14] DEBUG: PPG: http_read_thread: pap control entity compiled ok 2009-03-03 10:23:34 [17163] [14] DEBUG: PPG: transform_message: push message content and headers valid 2009-03-03 10:23:34 [17163] [14] DEBUG: PPG: push machine 1 created 2009-03-03 10:23:34 [17163] [14] DEBUG: PPG: store_push_data: push machine 1 appended to unit push list 2009-03-03 10:23:34 [17163] [14] DEBUG: PPG: send_push_response: telling pi 2009-03-03 10:23:34 [17163] [14] DEBUG: HTTP: Resetting HTTPClient for `172.21.21.21'. 2009-03-03 10:23:34 [17163] [14] INFO: PPG: handle_push_message: push message accepted for processing 2009-03-03 10:23:34 [17163] [14] DEBUG: PPG: OTA request for unit push 2009-03-03 10:23:34 [17163] [9] DEBUG: OTA: event arrived 2009-03-03 10:23:34 [17163] [14] INFO: PPG: unconfirmed push delivered to OTA 2009-03-03 10:23:34 [17163] [14] DEBUG: PPG: destroying push machine 1 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP (UNIT): event arrived 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP_UNIT: Connectionless push accepted 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `application/vnd.wap.sic', WSP 1.2 to 0x002e. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `Cache-Control', WSP 1.3 to 0x003d. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `Pragma', WSP 1.3 to 0x001f. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `User-Agent', WSP 1.3 to 0x0029. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `Accept', WSP 1.3 to 0x. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `text/html', WSP 1.2 to 0x0002. 2009-03-03 10:23:34 [17163] [9] DEBUG: OTA: made connectionless session service request 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `image/gif', WSP 1.2 to 0x001d. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `image/jpeg', WSP 1.2 to 0x001e. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `*', WSP 1.2 to 0x. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `q', WSP 1.2 to 0x. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `*/*', WSP 1.2 to 0x. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `q', WSP 1.2 to 0x. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `Content-Length', WSP 1.3 to 0x000d. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `Content-Type', WSP 1.3 to 0x0011. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `Encoding-Version', WSP 1.3 to 0x0043. 2009-03-03 10:23:34 [17163] [2] DEBUG: WDP (wapbox):
Re: Wap Push Java Code
Hi Monim, We have tried the method you wrote... but its the same issue.. the message is being delivered in two segments... Following are the wappush logs.. 2009-03-03 10:23:34 [17163] [11] DEBUG: HTTP: Creating HTTPClient for `172.21.21.21'. 2009-03-03 10:23:34 [17163] [11] DEBUG: HTTP: Created HTTPClient area 0x32a9170. 2009-03-03 10:23:34 [17163] [14] WARNING: Your ppg core configuration allow all ips 2009-03-03 10:23:34 [17163] [14] INFO: PPG: Accept request /wappush from 172.21.21.21 2009-03-03 10:23:34 [17163] [14] DEBUG: PPG: http_read_thread: pap multipart accepted 2009-03-03 10:23:34 [17163] [14] INFO: client address was +923028560819, accepted 2009-03-03 10:23:34 [17163] [14] DEBUG: PAP COMPILER: doing semantic analysis for address type a phone number 2009-03-03 10:23:34 [17163] [14] DEBUG: using defaults instead of anys 2009-03-03 10:23:34 [17163] [14] DEBUG: PPG: http_read_thread: pap control entity compiled ok 2009-03-03 10:23:34 [17163] [14] DEBUG: PPG: transform_message: push message content and headers valid 2009-03-03 10:23:34 [17163] [14] DEBUG: PPG: push machine 1 created 2009-03-03 10:23:34 [17163] [14] DEBUG: PPG: store_push_data: push machine 1 appended to unit push list 2009-03-03 10:23:34 [17163] [14] DEBUG: PPG: send_push_response: telling pi 2009-03-03 10:23:34 [17163] [14] DEBUG: HTTP: Resetting HTTPClient for `172.21.21.21'. 2009-03-03 10:23:34 [17163] [14] INFO: PPG: handle_push_message: push message accepted for processing 2009-03-03 10:23:34 [17163] [14] DEBUG: PPG: OTA request for unit push 2009-03-03 10:23:34 [17163] [9] DEBUG: OTA: event arrived 2009-03-03 10:23:34 [17163] [14] INFO: PPG: unconfirmed push delivered to OTA 2009-03-03 10:23:34 [17163] [14] DEBUG: PPG: destroying push machine 1 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP (UNIT): event arrived 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP_UNIT: Connectionless push accepted 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `application/vnd.wap.sic', WSP 1.2 to 0x002e. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `Cache-Control', WSP 1.3 to 0x003d. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `Pragma', WSP 1.3 to 0x001f. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `User-Agent', WSP 1.3 to 0x0029. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `Accept', WSP 1.3 to 0x. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `text/html', WSP 1.2 to 0x0002. 2009-03-03 10:23:34 [17163] [9] DEBUG: OTA: made connectionless session service request 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `image/gif', WSP 1.2 to 0x001d. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `image/jpeg', WSP 1.2 to 0x001e. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `*', WSP 1.2 to 0x. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `q', WSP 1.2 to 0x. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `*/*', WSP 1.2 to 0x. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `q', WSP 1.2 to 0x. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `Content-Length', WSP 1.3 to 0x000d. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `Content-Type', WSP 1.3 to 0x0011. 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP: Mapping `Encoding-Version', WSP 1.3 to 0x0043. 2009-03-03 10:23:34 [17163] [2] DEBUG: WDP (wapbox): delivering 2 segments to bearerbox 2009-03-03 10:23:34 [17163] [2] DEBUG: WSP (UNIT): delivering to wdp 2009-03-03 10:23:34 [17163] [0] WARNING: Received other message than wdp/admin, ignoring! 2009-03-03 10:23:34 [17163] [0] WARNING: Received other message than wdp/admin, ignoring! Regards, Ishtiaq Ahmed Monim Benaiad wrote: Dear Ishtiaq Ahmed, Sorry for my late response, I wrote a method to do the job: Note:- you have to change: encoding=\ISO-8859-6\ in the buffer code. Start of method/ public String sendWapPush(String target,String downloadURL,String downloadDetail) { try { StringBuffer buffer = new StringBuffer(); String vMessageID = + Math.random(); String message = ; String host = 127.0.0.1;//kannel host String port = 55012;//ppg port String url = http://; + host + : + port + /wappush; buffer.append(--asdlfkjiurwgasf\r\n).append(Content-Type: application/xml\r\n\r\n).append(?xml version=\1.0\?\r\n).append(!DOCTYPE pap PUBLIC \-//WAPFORUM//DTD PAP//EN\\r\n).append(\http://www.wapforum.org/DTD/pap_1.0.dtd\;\r\n).append(pap\r\n).append(push-message push-id=\).append(vMessageID.trim()).append(\\r\n deliver-before-timestamp=\2010-06-18T06:13:00Z\\r\n).append(deliver-after-timestamp=\2008-06-17T06:45:00Z\ ).append(progress-notes-requested=\true\\r\n).append(address address-value=\WAPPUSH=).append(target).append(/TYPE=PLMN\/\r\n).append(quality-of-service delivery-method=\unconfirmed\\r\nnetwork-required=\true\\r\n network=\GSM\\r\nbearer-required=\true\\r\nbearer=\SMS\\r\n
Re: Wap Push Java Code
Dear Ishtiaq Ahmed, Sorry for my late response, I wrote a method to do the job: Note:- you have to change: encoding=\ISO-8859-6\ in the buffer code. Start of method/ public String sendWapPush(String target,String downloadURL,String downloadDetail) { try { StringBuffer buffer = new StringBuffer(); String vMessageID = + Math.random(); String message = ; String host = 127.0.0.1;//kannel host String port = 55012;//ppg port String url = http://; + host + : + port + /wappush; buffer.append(--asdlfkjiurwgasf\r\n).append(Content-Type: application/xml\r\n\r\n).append(?xml version=\1.0\?\r\n).append(!DOCTYPE pap PUBLIC \-//WAPFORUM//DTD PAP//EN\\r\n).append(\http://www.wapforum.org/DTD/pap_1.0.dtd\;\r\n).append(pap\r\n).append(push-message push-id=\).append(vMessageID.trim()).append(\\r\n deliver-before-timestamp=\2010-06-18T06:13:00Z\\r\n).append(deliver-after-timestamp=\2008-06-17T06:45:00Z\ ).append(progress-notes-requested=\true\\r\n).append(address address-value=\WAPPUSH=).append(target).append(/TYPE=PLMN\/\r\n).append(quality-of-service delivery-method=\unconfirmed\\r\nnetwork-required=\true\\r\n network=\GSM\\r\nbearer-required=\true\\r\nbearer=\SMS\\r\n priority=\high\/).append(/push-message\r\n).append(/pap\r\n\r\n).append(--asdlfkjiurwgasf\r\n).append(Content-Type: text/vnd.wap.si\r\n\r\n).append(?xml version=\1.0\ encoding=\ISO-8859-6\?\r\n).append(!DOCTYPE si PUBLIC \-//WAPFORUM//DTD SI 1.0//EN\\r\n).append(\ http://www.wapforum.org/DTD/si.dtd\;\r\n).append(si\r\n).append(indication action=\signal-high\ si-id=\).append(vMessageID).append(\ href=\).append(downloadURL).append(\).append(downloadDetail).append(/indication\r\n).append(/si\r\n).append(--asdlfkjiurwgasf--\r\n\r\n); message = buffer.toString(); target = url; String content = message; //public static String postData(String target, String content) throws Exception { //System.out.println(About to post\nURL: + target + content: + content); String responseD = ; URL urlc = new URL(target); URLConnection conn = urlc.openConnection(); // Set connection parameters. conn.setDoInput(true); conn.setDoOutput(true); conn.setUseCaches(false); conn.setRequestProperty(Content-Type, multipart/related; boundary=asdlfkjiurwgasf; type=application/xml); //conn.setRequestProperty(Authorization, Basic \foo:bar\); conn.setRequestProperty(X-Kannel-SMSC, smsc + smsc); conn.setRequestProperty(X-Kannel-From, smsc); conn.setRequestProperty(Content-Length, + content.length()); DataOutputStream outs = new DataOutputStream(conn.getOutputStream()); // Write out the bytes of the content string to the stream. outs.writeBytes(content); outs.flush(); // Read response from the input stream. BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream())); String temp; while ((temp = in.readLine()) != null) { responseD += temp + \n; } temp = null; outs.close(); in.close(); //System.out.println(Server response:\n + responseD + ); return responseD; } catch (Exception e) { e.printStackTrace(); return null; } } end of method On Thu, Feb 26, 2009 at 3:58 PM, Ishtiaq Ahmed ishtiaq.ah...@ooober.comwrote: Hi Fellows: Can someone help with the exact java code and minimum header set / PAP configuration / Content File... for sending the WAP Push through Kannel The problem with my code is that The message is being sent in two segments 2009-02-20 06:35:02 [23465] [2] DEBUG: WSP (UNIT): event arrived 2009-02-20 06:35:02 [23465] [2] DEBUG: WSP_UNIT: Connectionless push accepted 2009-02-20 06:35:02 [23465] [2] DEBUG: WSP: Mapping `application/vnd.wap.sic', WSP 1.2 to 0x002e. 2009-02-20 06:35:02 [23465] [2] ERROR: HTTP: Header does not contain a colon. BAD. 2009-02-20 06:35:02 [23465] [2] DEBUG: WSP: Mapping `X-Unknown', WSP 1.3 to 0x. 2009-02-20 06:35:02 [23465] [2] DEBUG: WSP: Mapping `Cache-Control', WSP 1.3 to 0x003d. 2009-02-20 06:35:02 [23465] [2] DEBUG: WSP: Mapping `Pragma', WSP 1.3 to 0x001f. 2009-02-20 06:35:02 [23465] [2] DEBUG: WSP: Mapping `User-Agent', WSP 1.3 to 0x0029. 2009-02-20 06:35:02 [23465] [2] DEBUG: WSP: Mapping `Accept', WSP 1.3 to 0x. 2009-02-20 06:35:02 [23465] [2] DEBUG: WSP: Mapping `text/html', WSP 1.2 to 0x0002. 2009-02-20 06:35:02 [23465] [2] DEBUG: WSP: Mapping `image/gif', WSP 1.2 to 0x001d. 2009-02-20 06:35:02 [23465] [2] DEBUG: WSP: Mapping `image/jpeg', WSP 1.2 to 0x001e. 2009-02-20 06:35:02 [23465] [2] DEBUG: WSP: Mapping `*', WSP 1.2 to