Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!define WITH_LCR
- ...
- #!ifdef WITH_LCR
- loadmodule "lcr.so"
- #!endif
- ...
- # ----- lcr params -----
- modparam("lcr", "db_url", DBURL)
- modparam("lcr", "lcr_gw_table", "lcr_gw")
- modparam("lcr", "gw_name_column", "gw_name")
- modparam("lcr", "ip_addr_column", "ip_addr")
- modparam("lcr", "gw_uri_avp", "$avp(i:709)")
- modparam("lcr", "ruri_user_avp", "$avp(i:500)")
- modparam("lcr", "tag_avp", "$avp(lcr_tag)")
- modparam("lcr", "flags_avp", "$avp(i:712)")
- modparam("lcr", "lcr_id_avp", "$avp(s:lcr_id_avp)")
- modparam("lcr", "defunct_gw_avp", "$avp(s:defunct_gw_avp)")
- #!endif
- #routelcr
- route(LCR);
- route[LCR] {
- if (status=="200")
- {
- xlog("SCRIPT: SIP $rm from: $fu to: $ru - srcip: $si");
- xlog("L_ALERT", "LCR: Inside the LCR route\n");
- }
- if(method=="INVITE")
- {
- xlog("L_INFO", "got an invite");
- if(!load_gws(1, $rU, $var(caller_uri))) {
- xlog("L_ALERT", "Couldn't load gateways");
- sl_send_reply("500", "Server Internal Error - Cannot load gateways");
- exit;
- } else {
- xlog("L_INFO", "GW Selected '$avp(i:709)'\n");
- xlog("L_INFO", "Domain of destination: $dd\n");
- xlog("L_INFO", "To URI: $tu\n");
- }
- if(!next_gw()) {
- xlog("L_INFO", "Couldn't proceed to next gateway");
- sl_send_reply("503", "Service not available, no gateways found");
- exit;
- } else {
- xlog("L_INFO", "Calling the first matched gateway\n");
- xlog("L_INFO", "ruri_user_avp: '$avp(i:500)'\n");
- xlog("L_INFO", "To URI after next_gw: $tu\n");
- xlog("L_INFO", "Request URI: $rU\n");
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement