[PATCH] X-Wap-Initiator-URI to test_ppg

Kalle Marjola <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Enpocket
Message-ID <[email protected]>
Attached (small) patch adds possibility to define X-Wap-Initiator-URI
when running test_ppg (use -I command line option). This initiator is
shown in limited handsets as sender 'From', either in message details or
in message list (instead of *unknown*)

-- 
 &Kalle Marjola ::: Development ::: Helsinki ::: Enpocket
initiator_patch.txt (text/plain, 2.9 KB)
? confdefs.h
? initiator_patch.txt
Index: doc/userguide/userguide.xml
===================================================================
RCS file: /home/cvs/gateway/doc/userguide/userguide.xml,v
retrieving revision 1.286
diff -u -r1.286 userguide.xml
--- doc/userguide/userguide.xml	28 Sep 2004 15:01:33 -0000	1.286
+++ doc/userguide/userguide.xml	5 Oct 2004 09:04:59 -0000
@@ -8299,6 +8299,14 @@
              Use <literal>string</literal> as a X-WAP-Application-Id
              header (You must supply whole header).
              </entry></row>
+
+             <row><entry><literal>-I</literal></entry>
+             <entry><emphasis>string</emphasis></entry>
+             <entry valign="bottom">
+             Use <literal>string</literal> as a X-WAP-Initiator-URI
+             header (You must supply whole header).
+             </entry></row>
+
              <row><entry><literal>-B</literal></entry>
              <entry><emphasis>boolean</emphasis></entry>
              <entry valign="bottom">
Index: test/test_ppg.c
===================================================================
RCS file: /home/cvs/gateway/test/test_ppg.c,v
retrieving revision 1.28
diff -u -r1.28 test_ppg.c
--- test/test_ppg.c	20 Jun 2004 18:11:57 -0000	1.28
+++ test/test_ppg.c	5 Oct 2004 09:04:59 -0000
@@ -101,6 +101,7 @@
 static Octstr *content_transfer_encoding = NULL;
 static Octstr *connection = NULL;
 static Octstr *delimiter = NULL;
+static Octstr *initiator_uri = NULL;
 
 enum { SSL_CONNECTION_OFF = 0,
        DEFAULT_NUMBER_OF_RELOGS = 2};
@@ -329,6 +330,11 @@
 
     octstr_destroy(mos);
 
+    /* add initiator... */
+    if (initiator_uri)
+	http_header_add(push_headers, "X-Wap-Initiator-URI",
+			octstr_get_cstr(initiator_uri));
+
     return push_headers;
 }
 
@@ -705,6 +711,9 @@
     info(0, "supply a message header as a plain string. For instance"); 
     info(0, "-s x-wap-application-id:mms.ua equals -a ua. Default is");
     info(0, "x-wap-application-id:mms.ua.");
+    info(0, "-I string");
+    info(0, "supply an initiator header as a plain string. For instance"); 
+    info(0, "-I x-wap-application-id:http://foo.bar equals -I http://foo.bar");
     info(0, "-S string");
     info(0, "supply an additional part header (for push content) as a string."); 
     info(0, "For instance, -S Content-Language: en. Default no additional part");
@@ -760,7 +769,7 @@
     gwlib_init();
     num_threads = 1;
 
-    while ((opt = getopt(argc, argv, "HhBbnEpv:qr:t:c:a:i:e:k:d:s:S:")) != EOF) {
+    while ((opt = getopt(argc, argv, "HhBbnEpv:qr:t:c:a:i:e:k:d:s:S:I:")) != EOF) {
         switch(opt) {
 	    case 'v':
 	        log_set_output_level(atoi(optarg));
@@ -886,7 +895,11 @@
                 add_preamble = 1;
             break;
 
-	    case '?':
+            case 'I':
+                initiator_uri = octstr_create(optarg);
+		break;
+
+	case '?':
 	    default:
 	        error(0, "TEST_PPG: Invalid option %c", opt);
             help();
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.