Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- request_route {
- if ((($Rp == MY_WS_PORT || $Rp == MY_WSS_PORT)
- && !(proto == WS || proto == WSS))) {
- xlog("L_WARN", "SIP request received on $Rp\n");
- sl_send_reply("403", "Forbidden");
- exit;
- }
- # per request initial checks
- route(REQINIT);
- # NAT detection
- route(NATDETECT);
- # CANCEL processing
- if (is_method("CANCEL")) {
- if (t_check_trans()) {
- route(RELAY);
- }
- exit;
- }
- # handle requests within SIP dialogs
- route(WITHINDLG);
- ### only initial requests (no To tag)
- t_check_trans();
- if (!is_method("REGISTER|INVITE|ACK|BYE|CANCEL|PRACK|MESSAGE|INFO|UPDATE")) {
- sl_send_reply("405", "Method not allowed");
- exit;
- }
- # authentication
- route(AUTH);
- # record routing for dialog forming requests (in case they are routed)
- # - remove preloaded route headers
- remove_hf("Route");
- if (is_method("INVITE|SUBSCRIBE")){
- record_route();
- }
- # handle registrations
- route(REGISTRAR);
- if ($rU==$null) {
- # request with no Username in RURI
- sl_send_reply("484","Address Incomplete");
- exit;
- }
- if (!is_method("INVITE")) {
- route(RELAY);
- exit;
- }
- route(PSTN);
- route(LOCATION);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement