Iñaki Baz Castillo wrote:
Si en vez de eso defines cada usuario SIP en Asterisk en plan: [200] username = 200 host =KAMAILIO_IP qualify = no y usas dichos usuarios """"internos"""" en las colas (SIP/200) entonces ningún problema.
Estoy intentando esto mismo. Para que quede claro, de repente estoy buscando una alternativa al realtime entre Asterisk - Kamailio. Y me parece que esto puede funcionar...
Lo que quiero hacer es que los tel se registren en Kamailio para llamadas entre si (esto ya lo tengo hecho) y que para salir por la PSTN vayan al Asterisk, ademas del voicemail, y demas features, teniendo en cuenta que al manejar telefonos fuera de la LAN, necesito usar RTPPROXY. Es todo esto posible?
Mi configuracion actual es la siguiente:
route{ #--------------------------------------------------------# # SANITY #--------------------------------------------------------# if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); exit; }; if (msg:len >= 2048 ) { sl_send_reply("513", "Message too big"); exit; }; #--------------------------------------------------------#
#--------------------------------------------------------# # DETECCION DE NAT route(2); #--------------------------------------------------------#
#--------------------------------------------------------# if (!method=="REGISTER") record_route();
if (loose_route()) { append_hf("P-hint: rr-enforced\r\n"); route(1); };
if (!uri==myself) { append_hf("P-hint: outbound\r\n"); route(1); }; #--------------------------------------------------------# ]
#--------------------------------------------------------# #--------------------------------------------------------# if (uri==myself) { if (method=="REGISTER") {
if (isflagset(5)) { setbflag(6); # if you want OPTIONS natpings uncomment next # setbflag(7); }; save("location"); exit; };
if (!lookup("location")) { sl_send_reply("404", "Not Found"); exit; };
append_hf("P-hint: usrloc applied\r\n"); };
route(1); #--------------------------------------------------------# }
#--------------------------------------------------------# # RUTEOS #--------------------------------------------------------# route[1] { if (subst_uri('/(sip:.*);nat=yes/\1/')){ setbflag(6); };
if (isflagset(5)||isbflagset(6)) { route(3); }
if (!t_relay()) { sl_reply_error(); };
}
route[2]{ force_rport(); if (nat_uac_test("19")) { if (method=="REGISTER") { fix_nated_register(); } else { fix_nated_contact(); }; setflag(5); }; }
route[3] { if (is_method("BYE|CANCEL")) { unforce_rtp_proxy(); } else if (is_method("INVITE")){ force_rtp_proxy(); t_on_failure("1"); }; if (isflagset(5)) search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes'); t_on_reply("1"); }
#--------------------------------------------------------# # RUTEOS #--------------------------------------------------------# route[4] { if ($rU =~ "5[0-9]" && src_ip!=200.xx.xx.87){ ## Aca pregunto por el origen, para no crear un loop. log(1, "Forwarding to Asterisk \n"); rewritehostport("200.xx.xx.87:5060"); route(5); }; }
route[5] { if (!t_relay()) { sl_reply_error(); }; } #--------------------------------------------------------#
failure_route[1] { if (isbflagset(6) || isflagset(5)) { unforce_rtp_proxy(); } }
#--------------------------------------------------------#
onreply_route[1] { if ((isflagset(5) || isbflagset(6)) && status=~"(183)|(2[0-9][0-9])") { force_rtp_proxy(); } search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');
if (isbflagset(6)) { fix_nated_contact(); } exit; }
Quiero que al discar 5 se dirija al Asterisk para salir por la PSTN. La pregunta es, donde debo colocar correctamente el route para el INVITE hacia ASTERISK, estoy olvidando de algo? Teniendo en cuenta el RTPPROXY...
gracias!