Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2017
558
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. route[CR] {
  2.  
  3.  
  4. if(!cr_route("default", "default", "$rU", "$rU", "call_id")){
  5. sl_send_reply("403", "Not allowed");
  6. } else {
  7. # In case of failure, re-route the request
  8. t_on_failure("1");
  9. # Relay the request to the gateway
  10. }
  11.  
  12. #set CallerID suitables for PSTN instead of 3-digit internal number
  13. if($rd=="1.2.182.78" || $rd=="sbc.myself.com" || $rd=="1.2.176.246" || $rd=="mediant.myself.com")
  14. uac_replace_from("sip:[email protected]");
  15.  
  16. t_relay();
  17. exit;
  18. }
  19.  
  20. failure_route[1] {
  21. revert_uri();
  22. # In case of failure, send it to an alternative route:
  23. if (t_check_status("40[18]|5[0-9][0-9]")) {
  24. #choose route domain 1 of the default carrier
  25. if(!cr_route("m200", "fallback", "$rU", "$rU", "call_id")){
  26. t_reply("403", "Not allowed");
  27. } else {
  28. t_on_failure("2");
  29.  
  30. t_relay();
  31. exit;
  32. }
  33. }
  34. exit;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement