Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- loadmodule "ndb_redis.so"
- loadmodule "topos.so"
- loadmodule "topos_redis.so"
- modparam("ndb_redis", "server", "name=localsrv;addr=127.0.0.1;port=6379;db=1")
- modparam("topos", "storage", "redis")
- modparam("topos_redis", "serverid", "localsrv")
- /* Main SIP request routing logic
- * - processing of any incoming SIP request starts with this route
- * - note: this is the same as route { ... } */
- request_route {
- /* 8< cut parts basically same as default 8< */
- # handle requests within SIP dialogs
- route(WITHINDLG);
- ### only initial requests (no To tag)
- dlg_manage();
- # record routing for dialog forming requests (in case they are routed)
- # - remove preloaded route headers
- remove_hf("Route");
- record_route();
- # account only INVITEs
- if (is_method("INVITE")) {
- #setflag(FLT_ACC); # do accounting
- add_path();
- }
- /* 8< cut parts basically same as default 8< */
- # reply fast 100 on register
- if (is_method("REGISTER"))
- sl_send_reply("100","Trying");
- route(RELAY);
- exit;
- }
- # Handle requests within SIP dialogs
- route[WITHINDLG] {
- if (!has_totag()) return;
- # sequential request withing a dialog should
- # take the path determined by record-routing
- if (loose_route()) {
- route(DLGURI);
- if ( is_method("ACK") ) {
- # ACK is forwarded statelessly
- route(NATMANAGE);
- } else if ( is_method("NOTIFY") ) {
- # Add Record-Route for in-dialog NOTIFY as per RFC 6665.
- record_route();
- }
- route(RELAY);
- exit;
- }
- if (is_method("SUBSCRIBE") && uri == myself) {
- # in-dialog subscribe requests
- sl_send_reply("404", "No voicemail service");
- exit;
- }
- if ( is_method("ACK") ) {
- if ( t_check_trans() ) {
- # no loose-route, but stateful ACK;
- # must be an ACK after a 487
- # or e.g. 404 from upstream server
- route(RELAY);
- exit;
- } else {
- # ACK without matching transaction ... ignore and discard
- exit;
- }
- }
- sl_send_reply("404","Not here");
- exit;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement