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 12:31, 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. > > True, but DB is only store fore internal dlr purposes and they do not need > original destination, > if normalized is good enough. no, You have't got a point... We need original destination, because it will be copied into dlr message that going to the user back... So the user should always get "right" destination number back (means destination that was supplied by him). How want you normalize number if you have loss a original number? Just as example: sent: +49123456789 dlr-store: 123456789 dlr-find: WHERE dst='123456789' dlr-msg: ???? how to normalize ??? +49123456789 or +44123456789 > > >> > 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? > > From one of operators I've got 9-digit numbers in dlr (without leading 0), > so strip == octstr_len(dst) - 7. > These last 7 digits may not determine number in nearly > future because operator has numbers like, eg: 500111111 and 511111111 hmm, ok... then what's about: try split 10, then 9, then 7 ? -- 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