[PATCH] SMS message center support for AT2 module.
"Oded Arbel" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi list. Sorry for the onslaught of patches ;-) I just want to get this out of the door. I needed to change the SMS message center setting of the SIM card, and really didn't feel like going into minicom and start to play with AT commands. so in a typical bout of "programmer-think", I hacked Kannel to do this for me... The change is minimal, tested and "Works For Me(tm)" on our wavecom test platform, but as usual - YMMV. Patch attached (this time, I swear :-) Oded Arbel m-Wise Inc. [email protected] -- "My ambition is handicapped by laziness." -- Bukowskis Alter Ego Henry Chinaski in "Factotum" <<smsc_at2.patch>>
smsc_at2.patch
(application/octet-stream, 1012 B)
--- gw/smsc_at2.c 10 Feb 2002 14:08:28 -0000 1.1.1.1.2.38
+++ gw/smsc_at2.c 13 Feb 2002 11:01:11 -0000 1.1.1.1.2.39
@@ -148,6 +153,7 @@
int phase2plus;
Octstr *validityperiod;
int alt_dcs;
+ Octstr *smscenter;
} PrivAT2data;
@@ -601,7 +608,16 @@
if(ret == -1) /* timeout */
return -1;
}
- }
+ }
+
+ // set the GSM SMS message center address if supplied
+ if (privdata->smscenter != NULL) {
+ char temp[500];
+ sprintf(temp,"AT+CSCA=%s",octstr_get_cstr(privdata->smscenter));
+ ret = at2_send_modem_command(privdata, temp, 0 , 0);
+ if (ret != 0)
+ return -1;
+ }
/* Set the modem to PDU mode and autodisplay of new messages */
ret = at2_send_modem_command(privdata, "AT+CMGF=0", 0, 0);
--- gwlib/cfg.def 10 Feb 2002 14:08:28 -0000 1.1.1.1.2.3
+++ gwlib/cfg.def 13 Feb 2002 11:12:18 -0000 1.1.1.1.2.4
@@ -183,6 +183,7 @@
OCTSTR(idle-timeout)
OCTSTR(no-sep)
OCTSTR(appname)
+ OCTSTR(sms-center)
)