modparam("dialplan", "db_url", "mysql://DB_USER:DB_PASS@DB_HOST/kamailio")
modparam("dialplan", "attrs_pvar", "$var(dispatcher_id)")
modparam("dialplan", "fetch_rows", 100)
...
route[DISPATCH] {
dp_match("1", "$ru");
xlog("[DISPATCH] '$ru' was translated to '$var(dispatcher_id)'\n");
xlog("[DISPATCH] avp(dsdstid): $avp(dsdstid)\n");
if(!ds_select_dst("$var(dispatcher_id)", "9"))
{
send_reply("404", "No destination");
exit;
}
xlog("L_DBG", "--- SCRIPT: going to <$ru> via <$du>\n");
t_on_failure("RTF_DISPATCH”);
append_to_reply("Contact: <sip:$du>\r\n");
sl_send_reply("300","Multiple Choices");
exit;
}
Hello,
On 04.03.20 04:44, Joli Martinez wrote:
> Hello,
>
> We have several SIP domains coming into our SBC. I need to build a
> Kamailio box that will 302 the call to the appropriate server based on
> the domain. If the call does not come in with a recognized domain I
> would like for it to 404 the call. Not sure how to do this. Can
> someone point me in the right direction?
the complete solution and complexity can be a matter of scalability and
security needs, but for redirect itself is about sending a
sl_send_reply(...) after using append_to_reply(). If relevant data is
stored in database, sqlops is the module that can help to fetch the
matching records.
Cheers,
Daniel
--
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - March 9-11, 2020, Berlin - www.asipto.com
Kamailio World Conference - April 27-29, 2020, in Berlin -- www.kamailioworld.com
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users