Re: [PATCH] DLR

Nisan Bloch <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
At 10:01 PM 7/10/02 +0200, Andreas Fink wrote:
>>Hi All
>>
>>A small patch to the dlr code.
>>In a situation of highload, we get duplicate ts columns  in the dlr.dlr 
>>table for a particular smsc. The  Mysql dlr_find code, did not take the 
>>destination into account in its query. Patch makes the SQL in dlr_find 
>>search on smsc, ts, destination rather than just smsc,ts
>>
>>Nisan
>
>
>this wont work if the submitted number doesnt match the number the SMSC is 
>giving back. Example: I send to +4179245733 which is my phone number in 
>international format. The EMI driver will make 004179245733 out of it but 
>the report will show 079245733 as the reported number because that's the 
>national format.
>
>I was thinking of changing that and storing the timestamp as given back by 
>the EMI ACK which would always match but then I have to update the record 
>in memory/in database so I have to keep track the record number with the 
>submitted sequence number. Not that easy as it sounded.


..eek.. didnt realise that with EMI.. With SMPP it isnt a problem, as one 
has unique message ids, our modified http driver we gen our own unique 
ids..   Do you think a closest right most match on the destination would 
work,  say 80% of the chars from the right match, along with the ts and 
smsc_id?


>>--- cvs/gateway/gw/dlr.c        Tue Apr  9 15:09:03 2002
>>+++ ./dlr.c     Tue Jul  9 11:13:58 2002
>>@@ -413,11 +413,13 @@
>>      MYSQL_RES *result;
>>      MYSQL_ROW row;
>>
>>-    sql = octstr_format("SELECT %s, %s, %s FROM %s WHERE %s='%s' AND 
>>%s='%s';",
>>+    sql = octstr_format("SELECT %s, %s, %s FROM %s WHERE %s='%s' AND %s='%s'
>>+                                                AND %s='%s';",
>>                          octstr_get_cstr(field_mask), 
>> octstr_get_cstr(field_serv),
>>                          octstr_get_cstr(field_url), octstr_get_cstr(table),
>>                          octstr_get_cstr(field_smsc),
>>-                        smsc, octstr_get_cstr(field_ts), ts);
>>+                        smsc, octstr_get_cstr(field_ts), ts,
>>+ octstr_get_cstr(field_dst), dst);
>>
>>      mutex_lock(dlr_mutex);
>
>
>--
>
>Andreas Fink
>Fink-Consulting
>
>------------------------------------------------------------------
>Tel: +41-61-6932730 Fax: +41-61-6932729  Mobile: +41-79-2457333
>Address: A. Fink, Schwarzwaldallee 16, 4058 Basel, Switzerland
>E-Mail:  [email protected]  Homepage: http://www.finkconsulting.com
>------------------------------------------------------------------
>Something urgent? Try http://www.smsrelay.com/ Nickname afink


Nisan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.