Hello
In my case I have to send sms with sender numer covered with
alphanumeric characters e.g. 44100100100 with TEST_SENDER.
I've created a patch for this (see at the end).
Now I have problem with long messages and concatanation. When I send
message over 160 chars I non readable sms.
Could you help me with tracing bug? My smsc proviader send me feedback
that my udh header should be aligned with 7 septets, but to be honest I
do not know where alignment is taking place.
Than you a lot for your time and support.
diff -ur kannel-1.4.3/gw/smsc/smsc_oisd.c
kannel-1.4.3-sisms/gw/smsc/smsc_oisd.c
--- kannel-1.4.3/gw/smsc/smsc_oisd.c 2009-01-12 17:46:50.000000000 +0100
+++ kannel-1.4.3-sisms/gw/smsc/smsc_oisd.c 2010-07-14
10:42:57.000000000 +0200
@@ -524,17 +524,21 @@
return NULL;
}
+ /* patch, part 1 */
+ /*
if (!parm_valid_address(msg->sms.sender)) {
warning(0, "OISD[%s]: non-digits in originating phone number
'%s', discarded",
octstr_get_cstr(conn->id),
octstr_get_cstr(msg->sms.sender));
return NULL;
}
+ */
packet = packet_create(SUBMIT_SM, BOGUS_SEQUENCE);
gw_assert(octstr_check_range(msg->sms.receiver, 0,
octstr_len(msg->sms.receiver),
isphonedigit));
+
/* MSISDN length */
octstr_append_char(packet->data,
(unsigned char) octstr_len(msg->sms.receiver));
@@ -554,20 +558,46 @@
/* Priority 0=high, 1=normal */
octstr_append_char(packet->data, 1);
+
+ /* patch, part 2 */
+ /*
gw_assert(octstr_check_range(msg->sms.sender, 0,
octstr_len(msg->sms.sender),
isphonedigit));
+ */
/* Originating address length */
octstr_append_char(packet->data,
(unsigned char) (octstr_len(msg->sms.sender) + 2));
+ /* patch, part 3 */
/* XXX: GSM operator dependent ? */
/* TON */
- octstr_append_char(packet->data, 0x42);
-
+ /* octstr_append_char(packet->data, 0x42); */
/* NPI */
- octstr_append_char(packet->data, 0x44);
+ /* octstr_append_char(packet->data, 0x44); */
+ if (parm_valid_address(msg->sms.sender)) {
+ if (octstr_len(msg->sms.sender)<10) {
+ /* short code */
+ /* TON */
+ octstr_append_char(packet->data, 0x42);
+ /* NPI */
+ octstr_append_char(packet->data, 0x44);
+ } else {
+ /* international address */
+ /* TON */
+ octstr_append_char(packet->data, 0x39);
+ /* NPI */
+ octstr_append_char(packet->data, 0x31);
+ }
+ } else {
+ /* Invalid name -> probably alphanumeric */
+ /* TON */
+ octstr_append_char(packet->data, 0x44);
+ /* NPI */
+ octstr_append_char(packet->data, 0x30);
+ }
+
/* Originating address */
octstr_append(packet->data, msg->sms.sender);