Advertisement
covalschi

Wirhindlg route

Feb 24th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. route[WITHINDLG] {
  2. if (has_totag()) {
  3. # sequential request withing a dialog should
  4. # take the path determined by record-routing
  5. if (loose_route()) {
  6.  
  7. if ($du == "") {
  8. if (!handle_ruri_alias()) {
  9. xlog("L_ERR", "Bad alias <$ru>\n");
  10. sl_send_reply("400", "Bad Request");
  11. exit;
  12. }
  13. }
  14. # else
  15. # route(DLGURI);
  16.  
  17. xlog("==> duri=[$du]");
  18.  
  19. if ( is_method("ACK") ) {
  20. # ACK is forwarded statelessy
  21. route(NATMANAGE);
  22. }
  23. route(RELAY);
  24. } else {
  25. if ( is_method("ACK") ) {
  26. if ( t_check_trans() ) {
  27. # no loose-route, but stateful ACK;
  28. # must be an ACK after a 487
  29. # or e.g. 404 from upstream server
  30. route(RELAY);
  31. exit;
  32. } else {
  33. # ACK without matching transaction ... ignore and discard
  34. exit;
  35. }
  36. }
  37. sl_send_reply("404","Not here");
  38. }
  39. exit;
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement