kannel cfg.c.patch

Anton Osennikov <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi!

First, thank you for great work on Kannel project.

We use kannel to send SMS via two-channel GSM terminal, namely ALLVoIP
AV3402, allowing access to AT command interface via TCP connection.

There's a problem: the device requires to enter not only login and 
password to access AT commands interface, but also one additional 
command, "module1" to access first channel, and "module2" for second one.

The simplest solution I found is to additionally allow "\r" and "\n" 
C-escapes in kannel config files. This allows to embed command into 
device password, for example:

smsc-password = "12345\r\nmodule1"

A patch is attached.

--
Best regards, Anton Osennikov.
cfg.c.patch (text/plain, 486 B)
--- gwlib/cfg.c	2014-10-03 18:32:38.000000000 +0600
+++ /var/tmp/kannel-patch//cfg.c	2014-10-03 18:32:26.000000000 +0600
@@ -358,6 +358,14 @@
     	    case '"':
 	    	octstr_append_char(value, c);
 	    	break;
+            
+            case 'r':
+                octstr_append_char(value, '\r');
+                break;
+
+            case 'n':
+                octstr_append_char(value, '\n');
+                break;
 		
     	    default:
 	    	octstr_append_char(value, '\\');
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.