Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- route[CR] {
- if(!cr_route("default", "default", "$rU", "$rU", "call_id")){
- sl_send_reply("403", "Not allowed");
- } else {
- # In case of failure, re-route the request
- t_on_failure("1");
- # Relay the request to the gateway
- }
- #set CallerID suitables for PSTN instead of 3-digit internal number
- if($rd=="1.2.182.78" || $rd=="sbc.myself.com" || $rd=="1.2.176.246" || $rd=="mediant.myself.com")
- uac_replace_from("sip:[email protected]");
- t_relay();
- exit;
- }
- failure_route[1] {
- revert_uri();
- # In case of failure, send it to an alternative route:
- if (t_check_status("40[18]|5[0-9][0-9]")) {
- #choose route domain 1 of the default carrier
- if(!cr_route("m200", "fallback", "$rU", "$rU", "call_id")){
- t_reply("403", "Not allowed");
- } else {
- t_on_failure("2");
- t_relay();
- exit;
- }
- }
- exit;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement