SER example forking

SER Example: message forking

Example script showing both types of forking; incoming message is forked in parallel to 'nobody' and 'parallel', if no positive reply appears with final_response timer, nonsense is retried (serial forking); than, destination 'foo' is given last chance

  #
  # $Id: onr.cfg,v 1.8 2003/06/03 03:18:12 jiri Exp $
  #

  # ------------------ module loading ----------------------------------

  loadmodule "modules/sl/sl.so"
  loadmodule "modules/tm/tm.so"

  # ----------------- setting module-specific parameters ---------------

  # -- tm params --
  # set time for which ser will be waiting for a final response;
  # fr_inv_timer sets value for INVITE transactions, fr_timer
  # for all others
  modparam("tm", "fr_inv_timer", 15 )
  modparam("tm", "fr_timer", 10 )

  # -------------------------  request routing logic -------------------

  # main routing logic

  route{
        # for testing purposes, simply okay all REGISTERs
        if (method=="REGISTER") {
                log("REGISTER");
                sl_send_reply("200", "ok");
                break;
        };
        # try these two destinations first in parallel; the second
        # destination is targeted to sink port -- that will make ser
        # wait until timer hits
        seturi("sip:nobody@iptel.org");
        append_branch("sip:parallel@iptel.org:9");
        # if we do not get a positive reply, continue at ~np~reply_route[1]~/np~
        t_on_failure("1");
        # forward the request to all destinations in destination set now
        t_relay();
  }

  ~np~failure_route[1]~/np~ {
        # forwarding failed -- try again at another destination
        append_branch("sip:nonsense@iptel.org");
        log(1,"first redirection\n");
        # if this alternative destination fails too, proceed to ~np~reply_route[2]~/np~
        t_on_failure("2");
        t_relay();
  }

  failure_route[2] {
        # try out the last resort destination
        append_branch("sip:foo@iptel.org");
        log(1, "second redirection\n");
        # we no more call t_on_negative here; if this destination
        # fails too, transaction will complete
        t_relay();
  }


SER Example: message forking

Example script showing both types of forking; incoming message is forked in parallel to 'nobody' and 'parallel', if no positive reply appears with final_response timer, nonsense is retried (serial forking); than, destination 'foo' is given last chance

  #
  # $Id: onr.cfg,v 1.8 2003/06/03 03:18:12 jiri Exp $
  #

  # ------------------ module loading ----------------------------------

  loadmodule "modules/sl/sl.so"
  loadmodule "modules/tm/tm.so"

  # ----------------- setting module-specific parameters ---------------

  # -- tm params --
  # set time for which ser will be waiting for a final response;
  # fr_inv_timer sets value for INVITE transactions, fr_timer
  # for all others
  modparam("tm", "fr_inv_timer", 15 )
  modparam("tm", "fr_timer", 10 )

  # -------------------------  request routing logic -------------------

  # main routing logic

  route{
        # for testing purposes, simply okay all REGISTERs
        if (method=="REGISTER") {
                log("REGISTER");
                sl_send_reply("200", "ok");
                break;
        };
        # try these two destinations first in parallel; the second
        # destination is targeted to sink port -- that will make ser
        # wait until timer hits
        seturi("sip:nobody@iptel.org");
        append_branch("sip:parallel@iptel.org:9");
        # if we do not get a positive reply, continue at ~np~reply_route[1]~/np~
        t_on_failure("1");
        # forward the request to all destinations in destination set now
        t_relay();
  }

  ~np~failure_route[1]~/np~ {
        # forwarding failed -- try again at another destination
        append_branch("sip:nonsense@iptel.org");
        log(1,"first redirection\n");
        # if this alternative destination fails too, proceed to ~np~reply_route[2]~/np~
        t_on_failure("2");
        t_relay();
  }

  failure_route[2] {
        # try out the last resort destination
        append_branch("sip:foo@iptel.org");
        log(1, "second redirection\n");
        # we no more call t_on_negative here; if this destination
        # fails too, transaction will complete
        t_relay();
  }


Created by: oej, Last modification: Mon 14 of May, 2012 (21:28 UTC) by admin
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+