Hello,
I'm testing Kamailio 5.x as a redirecting server based on calling number.
The calling numbers are stored on a DB and loaded in htable at runtime.
When the INVITE or REGISTER arrive Kamailio checks if there is a match
on $fU in htable (KEY_NAME) and if there is one, it replies with 302
adding the Contact HF with $fU@$sht(cli=>$fU)(with the domain part found
in KEY_VALUE):
append_to_reply("<Contact: sip:$fU@$sht(cli=>$fU)>\r\n");
If I use the full number as KEY_NAME it works as expected, but how can I
match on a prefix instead of the whole $fU?
For example, If I receive a call form 0655123456 I want to match it also
if I have the prefix 0655 in htable.
Do you have some advice to achieve this goal with htable or in a similar
way?
Thank you.
Best regards.
--
Antonio Reale
Show replies by date