Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37734992
en ru br
ALT Linux repos
5.0: 1.11-alt2.041028
4.1: 1.11-alt1.041028
4.0: 1.11-alt0.041028
3.0: 1.10-alt9

Other repositories
Upstream:1.10

Group :: System/Libraries
RPM: gsmlib

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: gsmsendsms.patch
Download


--- gsmlib-1.11/apps/gsmsendsms.cc.orig	2002-10-03 12:54:28 +0300
+++ gsmlib-1.11/apps/gsmsendsms.cc	2007-01-22 13:19:21 +0200
@@ -103,6 +103,7 @@
     Ref<GsmAt> at;
     string initString = DEFAULT_INIT_STRING;
     bool swHandshake = false;
+    bool swUnicode = false;
     bool requestStatusReport = false;
     // service centre address (set on command line)
     string serviceCentreAddress;
@@ -112,7 +113,7 @@
 
     int opt;
     int dummy;
-    while((opt = getopt_long(argc, argv, "c:C:I:d:b:thvXr", longOpts, &dummy))
+    while((opt = getopt_long(argc, argv, "c:C:I:d:b:thvXru", longOpts, &dummy))
           != -1)
       switch (opt)
       {
@@ -125,6 +126,9 @@
       case 'X':
         swHandshake = true;
         break;
+      case 'u':
+        swUnicode = true;
+        break;
       case 'I':
         initString = optarg;
         break;
@@ -164,6 +168,7 @@
              << _("  -t, --test        convert text to GSM alphabet and "
                   "vice\n"
                   "                    versa, no SMS message is sent") << endl
+             << _("  -u                means that sended string encoded in UNICODE") << endl
              << _("  -v, --version     prints version and exits")
              << endl
              << _("  -X, --xonxoff     switch on software handshake") << endl
@@ -215,6 +220,7 @@
 
     // get text
     string text;
+    char *p;
     if (optind + 1 == argc)
     {                           // read from stdin
       char s[1000];
@@ -224,8 +230,10 @@
         throw GsmException(_("text is larger than 160 characters"),
                            ParameterError);
     }
-    else
+    else {
       text = argv[optind + 1];
+      p = argv[optind + 1];
+    }
 
     if (test)
       cout << gsmToLatin1(latin1ToGsm(text)) << endl;
@@ -242,6 +250,40 @@
       submitSMS->setStatusReportRequest(requestStatusReport);
       Address destAddr(phoneNumber);
       submitSMS->setDestinationAddress(destAddr);
+      
+      // arc++
+
+      char utxt[10000];
+      char s_enc[3];
+      char s_c[3];
+      if(swUnicode) {
+          submitSMS->setDataCodingScheme(DataCodingScheme(DCS_SIXTEEN_BIT_ALPHABET));
+          int i;
+          for(i=0; i<text.length()/4; i++) {
+            s_enc[0] = *p;        
+            s_enc[1] = *(p+1);        
+            s_enc[2] = '\0';        
+
+//            if(s_enc[0]=='0' && s_enc[1]=='0') s_enc[1]='4';
+
+            s_c[0] = *(p+2);        
+            s_c[1] = *(p+3);        
+            s_c[2] = '\0';
+
+            int res;
+            sscanf(s_enc, "%x", &res);
+            utxt[i*2] = res;
+            sscanf(s_c, "%x", &res);
+            utxt[i*2+1] = res;
+            p += 4;
+          }
+          utxt[i*2] = '\0';
+          text = string(utxt, i*2);
+      }
+
+      // arc--
+       
+      
       if (concatenatedMessageId == -1)
         m->sendSMSs(submitSMS, text, true);
       else
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin