Hi Wayne,
I had a similar problem (also CDMA). It stemmed from the SMSC replying
with a message id in decimal not in hex (deliver_sm_resp format) hence
dlr report couldn't be found.
Check the patch below which I'm using (applied to cvs), it contains a
couple of other things that I needed to add/modify but the relevant bit
should be obvious ;-). I've yet to clean up for general use but would be
interested to know if this helps.
Cheers,
Alan
On Tue, 2002-07-30 at 19:36, Wayne Smithers wrote:
> We have a situation where someone using a CDMA handset ( which does not
> support delivery receipt ) sends in an sms and it does not get to smsbox.
>
> Bearer box outputs 'got DLR but could not find message or was not interested
> in it' and that's as far as it gets.
>
> Does anybody know what the code below is trying to do ? And what would need
> to occur to get in an error state ??
>
> smsc_smpp.c
>
> if (msgid != NULL) {
> Octstr *tmp;
> tmp = octstr_format("%ld",
> strtol(octstr_get_cstr(msgid), NULL, 10));
> dlrmsg = dlr_find(octstr_get_cstr(smpp->conn->id),
> octstr_get_cstr(tmp), /* smsc message
> id */
>
> octstr_get_cstr(pdu->u.deliver_sm.destination_addr), /* destination */
> dlrstat);
> octstr_destroy(tmp);
> }
> if (dlrmsg != NULL) {
> reply = octstr_duplicate(respstr);
> /* having a / in the text breaks it so lets replace it
> with a space */
> len = octstr_len(reply);
> for (idx = 0; idx < len; idx++)
> if (octstr_get_char(reply, idx) == '/')
> octstr_set_char(reply, idx, '.');
> octstr_append_char(reply, '/');
> octstr_insert(dlrmsg->sms.msgdata, reply, 0);
> octstr_destroy(reply);
> bb_smscconn_receive(smpp->conn, dlrmsg);
> } else {
> error(0,"SMPP[%s]: got DLR but could not find message or
> was not interested in it",
> octstr_get_cstr(smpp->conn->id));
> }
>
>
> regards
>
> Wayne Smithers
> 5th Finger
> [EMAIL PROTECTED]
> 91 Reservoir St
> Surry Hills 2010
> Sydney, Australia
> Ph: +61-2-9280-0300
> Mob: +61-409-603511
> Fax: +612-9475-0367
>
>
--
Alan McNatty -- Catalyst IT Ltd -- http://www.catalyst.net.nz
Level 2, 150-154 Willis St, PO Box 11-053, Wellington, NZ
Mob: +64 21-312136, DDI: +64 4 9167203, Office: +64 4 4992267
... error accessing whit
Segmentation fault (core dumped)
Index: gw/smsc_smpp.c
===
RCS file: /home/cvs/gateway/gw/smsc_smpp.c,v
retrieving revision 1.76
diff -r1.76 smsc_smpp.c
22c22
<
---
>
54a55,56
> #define SMPP_SUBMIT_SM_RESP_FORMAT 16
> #define SMPP_DELIVER_SM_RESP_FORMAT 10
351d352
<
354c355
< } else {
---
> } else {
600,601c601,614
< /* got a deliver ack? */
< if ((pdu->u.deliver_sm.esm_class == 0x02 ||
---
>
> /* Based on SMPPv3.4 spec esm_class for deliver_sm is defined as ...
> *
> * Message Type (bits (5-2)
> *
> * xxxx (0x00) - Default Message Type
> * xx0001xx (0x01) - SM contains SMSC Delivery Receipt
> * xx0010xx (0x02) - SM contains SME Delivery Ack
> * xx0011xx (0x04) - reserverd
> *
> */
>
> if ((pdu->u.deliver_sm.esm_class == 0x01 ||
> pdu->u.deliver_sm.esm_class == 0x02 ||
644,645c657,667
< Octstr *tmp;
< tmp = octstr_format("%ld", strtol(octstr_get_cstr(msgid), NULL, 10));
---
> Octstr *tmp_id, *tmp_addr;
> tmp_id = octstr_format("%ld", strtol(octstr_get_cstr(msgid), NULL,
> SMPP_DELIVER_SM_RESP_FORMAT));
>
> /* XXX - check for broken SMSC that use source instead of destination */
>
> if ( octstr_compare(pdu->u.deliver_sm.destination_addr, octstr_imm("")) != 0 )
> tmp_addr = octstr_duplicate(pdu->u.deliver_sm.destination_addr);
> else
> tmp_addr = octstr_duplicate(pdu->u.deliver_sm.source_addr);
>
647,648c669,670
< octstr_get_cstr(tmp), /* smsc message id */
< octstr_get_cstr(pdu->u.deliver_sm.destination_addr), /* destination */
---
> octstr_get_cstr(tmp_id), /* smsc message id */
> octstr_get_cstr(tmp_addr), /* destination addr */
650c672,674
< octstr_destroy(tmp);
---
>
> octstr_destroy(tmp_id);
> octstr_destroy(tmp_addr);
761a786
>
763c788,790
<