Re: [PATCH] dlr_mem.c & dlr_sdb.c check for dst
Alexander Malysh <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Organization | Centrium GmbH |
| Message-ID | <[email protected]> |
On Friday 02 April 2004 11:49, Robert Galach wrote: > > 1) how want you guess a unified prefix in dlr_find when user has not > > supplied > > > unified prefix in the config file? (and that means user intervention). > > There is a way: normalize number to internal format in dlr_add also, before > insert to database. > (it could be even stripping prefix like in Alex magic) > I think that if there is a way to avoid "like" especially with '%' at the > beginning, it should be done. -1, because you will loss a original destination in the DB. > > > 2) we should do this magic only because we want to find our dlr entry in > > the > > > DB, after this we have destination number equal supplied by user (see > > dlr_find:398) > > The magic Alex proposed: > > > int strip = (octstr_len(dst) > 10 ? octstr_len(dst) - 10 : > > > (octstr_len(dst) > 7 ? octstr_len(dst) - 7 : 0)); > why it doesn't work for you? please explain. how long are the mobile numbers with prefix in your country? > wouldn't work for me, this one would be ok: > > int strip = (octstr_len(dst) > 9 ? octstr_len(dst) - 9 : > (octstr_len(dst) > 7 ? octstr_len(dst) - 7 : 0)); > > will it work for everyone? > > I would rather vote for internal dst normalization, to avoid 'like' > operator. > > Regards > Robert -- Best regards / Mit besten Grüßen aus Düsseldorf Dipl.-Ing. Alexander Malysh ___________________________________________ Centrium GmbH Vogelsanger Weg 80 40470 Düsseldorf Fon: +49 (0211) 74 84 51 80 Fax: +49 (0211) 277 49 109 email: [email protected] web: www.centrium.de msn: [email protected] icq: 98063111 ___________________________________________ Please avoid sending me Word, Excel or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html