Now I need to proxy rtp beween my clients and my asterisk then tow at the public Net and this interfaces addede to dispatcher
And for at routes to asterisk do this:
route[TOASTERISK] {
ds_mark_dst("P");
if(!ds_select_dst("1", "4")) {
sl_send_reply("500", "Service Unavailable");
xlog("L_INFO","[$fU@$si:$sp]{$rm} No destinations available for $rd \n");
exit;
}
xlog("L_INFO","[$fU@$si:$sp]{$rm} From Outside World to Asterisk Box $du\n");
rtpproxy_manage("cawei");
route(FINAL_RELAY);
exit;
}
route[FROMASTERISK] {
if(ds_is_from_list("1")){
rtpproxy_manage("cawie");
xlog("L_INFO","[$fU@$si:$sp]{$rm} Call from Media-Server Cluster\n");
sql_pvquery("ca", "select received from location where username='$tU'","$var(res)");
xlog("L_INFO","SQL query return {$var(res)} for {$tU}\n");
$du=$var(res);
return 1;
}
return -1;
}
route[FINAL_RELAY]
{
if (!t_relay()) {
sl_reply_error();
}
}