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.

> 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));

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
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.