I am using 'at2'. 

My last test consisted of patching smsc_at2.c with this smsc_at2.path
(thanks Stephane):

--- gateway/gw/smsc/smsc_at2.c  2002-08-08 20:44:38.000000000 +0300
+++ gateway/gw/smsc/smsc_at2.c  2002-08-11 14:18:19.000000000 +0300
@@ -241,6 +241,7 @@
 {
     int count;
     int s = 0;
+    int write_count = 0;
     Octstr *linestr = NULL;
 
     linestr = octstr_format("%s\r", line);
@@ -248,7 +249,15 @@
     debug("bb.smsc.at2", 0, "AT2[%s]: --> %s^M",
octstr_get_cstr(privdata->name), line);
 
     count = octstr_len(linestr);
-    s = write(privdata->fd, octstr_get_cstr(linestr), count);
+    while (1) {
+       errno = 0;
+       s = write(privdata->fd, octstr_get_cstr(linestr), count);
+       if (s < 0 && errno == EAGAIN && write_count < RETRY_SEND) {
+           gwthread_sleep(1);
+           ++write_count;
+       } else
+           break;
+    };
     O_DESTROY(linestr);
     if (s < 0) {
         debug("bb.smsc.at2", 0, "AT2[%s]: write failed with errno %d", 
@@ -266,9 +275,18 @@
 {
     int s;
     char *ctrlz = "\032" ;
-
+    int write_count = 0;
+    
     debug("bb.smsc.at2", 0, "AT2[%s]: --> ^Z",
octstr_get_cstr(privdata->name));
-    s = write(privdata->fd, ctrlz, 1);
+    while (1) {
+       errno = 0;
+       s = write(privdata->fd, ctrlz, 1);
+       if (s < 0 && errno == EAGAIN && write_count < RETRY_SEND) {
+           gwthread_sleep(1);
+           ++write_count;
+       } else
+           break;
+    };
     if (s < 0) {
         debug("bb.smsc.at2", 0, "AT2[%s]: write failed with errno %d", 
               octstr_get_cstr(privdata->name), errno);


Both patched kannel-1.2.0 and last snapshot kannel send long messages,
however I only receive correctly the first characters of message and the
character '@' repeteadly until the end of sms.

Here is a smsbox log excerpt:

INFO: smsbox: Get HTTP request </cgi-bin/sendsms> from <192.168.0.25>
INFO: sendsms used by <tester>
INFO: sendsms sender:<tester:xxxx> (192.168.0.25) to:<xxxx> msg:<The
design of many software applications emerges as a vital image in the
minds of its designers. With luck and skill it may achieve a state>
DEBUG: message length 139, sending 1 messages
DEBU: Status: 202 Answer: <Sent.>

And here the sms I receive in my nokia 8210:

<The design of many software applications emerges as a
6@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@>

Regards,
R. Luque

-----Mensaje original-----
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
En nombre de Oded Arbel
Enviado el: lunes, 26 de agosto de 2002 13:01
Para: Rafael Luque Leiva; [EMAIL PROTECTED]
Asunto: RE: kannel errno 11



> -----Original Message-----
> From: Rafael Luque Leiva [mailto:[EMAIL PROTECTED]]

> I can send very short messages, but when I try more than 40 bytes the
> message sent fails, and kannel logs:
> 
> 'Write failed with errno 11'

are you using AT or AT2 ? can we have some logs, please ?



Reply via email to