Advertisement
Guest User

kamailio.cfg

a guest
Oct 7th, 2015
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1.  
  2. #!define WITH_LCR
  3. ...
  4.  
  5. #!ifdef WITH_LCR
  6. loadmodule "lcr.so"
  7. #!endif
  8. ...
  9.  
  10. # ----- lcr params -----
  11. modparam("lcr", "db_url", DBURL)
  12. modparam("lcr", "lcr_gw_table", "lcr_gw")
  13. modparam("lcr", "gw_name_column", "gw_name")
  14. modparam("lcr", "ip_addr_column", "ip_addr")
  15. modparam("lcr", "gw_uri_avp", "$avp(i:709)")
  16. modparam("lcr", "ruri_user_avp", "$avp(i:500)")
  17. modparam("lcr", "tag_avp", "$avp(lcr_tag)")
  18. modparam("lcr", "flags_avp", "$avp(i:712)")
  19. modparam("lcr", "lcr_id_avp", "$avp(s:lcr_id_avp)")
  20. modparam("lcr", "defunct_gw_avp", "$avp(s:defunct_gw_avp)")
  21. #!endif
  22.  
  23.  
  24. #routelcr
  25. route(LCR);
  26.  
  27.  
  28. route[LCR] {
  29. if (status=="200")
  30. {
  31. xlog("SCRIPT: SIP $rm from: $fu to: $ru - srcip: $si");
  32. xlog("L_ALERT", "LCR: Inside the LCR route\n");
  33. }
  34.  
  35. if(method=="INVITE")
  36. {
  37. xlog("L_INFO", "got an invite");
  38. if(!load_gws(1, $rU, $var(caller_uri))) {
  39. xlog("L_ALERT", "Couldn't load gateways");
  40. sl_send_reply("500", "Server Internal Error - Cannot load gateways");
  41. exit;
  42. } else {
  43. xlog("L_INFO", "GW Selected '$avp(i:709)'\n");
  44. xlog("L_INFO", "Domain of destination: $dd\n");
  45. xlog("L_INFO", "To URI: $tu\n");
  46. }
  47.  
  48. if(!next_gw()) {
  49. xlog("L_INFO", "Couldn't proceed to next gateway");
  50. sl_send_reply("503", "Service not available, no gateways found");
  51. exit;
  52. } else {
  53. xlog("L_INFO", "Calling the first matched gateway\n");
  54. xlog("L_INFO", "ruri_user_avp: '$avp(i:500)'\n");
  55. xlog("L_INFO", "To URI after next_gw: $tu\n");
  56. xlog("L_INFO", "Request URI: $rU\n");
  57.  
  58. }
  59.  
  60. };
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement