RE: kannel 1.2.1 crashes then dlr in use
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello!
It's fantastic!
then i set
dlrmsg->sms.msgdata = octstr_create(""); without any checkin
(i think emimsg->fields[E50_AMSG] not defined in 51 type ACK/NAK messages)
all work now.
admittedly, emimsg->fields[E50_AMSG] not initialize previously and may
point to incorrect place.
not NULL but undefined.
p.s. may be somebody check this part code and fix it.
with best wishes
German Aksenov
phone: (095)258-7258 ext. 7836
"Oded Arbel"
<[email protected] To: <[email protected]>, <[email protected]>
> cc:
Subject: RE: kannel 1.2.1 crashes then dlr in use
10.11.2002 10:27
> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Today i set up some check code into smsc_emi2.c:
>
> --- smsc_emi2.orig Wed Sep 4 21:08:52 2002
> +++ smsc_emi2.c Sun Nov 10 10:00:12 2002
> @@ -976,7 +976,11 @@ static int emi2_handle_smscreq (SMSCConn
> * Recode the msg structure with the given msgdata.
> * Note: the DLR URL is delivered in msg->sms.dlr_url
> already.
> */
> - dlrmsg->sms.msgdata =
> octstr_duplicate(emimsg->fields[E50_AMSG]);
> + dlrmsg->sms.msgdata =
> octstr_duplicate(emimsg->fields[E50_AMSG]);
> + if (dlrmsg->sms.msgdata == NULL) {
> + dlrmsg->sms.msgdata =
> octstr_create("");
> + info(0, "EMI2[%s]: msgdata is NULL",
> octstr_get_cstr(privdata->name));
> + }
> octstr_hex_to_binary(dlrmsg->sms.msgdata);
You can do it far easier with
dlrmsg->sms.msgdata = emimsg->fields[E50_AMSG] != NULL ?
octstr_duplicate(emimsg->fields[E50_AMSG]) : octstr_create("");
and allow the compile to do some more optimizations if it likes to. you
don't really need to log the fact that the message is empty : it gets
sufficiently logged at other places.
--
Oded Arbel
m-Wise mobile solutions
[email protected]
+972-9-9581711 (116)
+972-67-340014
::..
If you sell diamonds, you cannot expect to have many customers.
But a diamond is a diamond even if there are no customers.
-- Swami Prabhupada