Re: [PATCH] dlr_mem.c & dlr_sdb.c check for dst
"Robert Galach" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
>> > 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. >> >> > 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