[OpenSIPS-Users] B2BUA/Top Hiding in 1.7 trunk

Ovidiu Sas osas at voipembedded.com
Thu Oct 27 20:39:30 CEST 2011


A db for b2b_logic module:
http://www.opensips.org/html/docs/modules/1.7.x/b2b_logic.html#id250132

On Thu, Oct 27, 2011 at 2:37 PM, ddgiants <ddgiants at gmail.com> wrote:
> Use a db for which piece? I use a db in my larger config in which opensips
> uses mysql to lookup source ip and carrier id, trunk group etc then hits a
> redirect server which then sends back a 300 multiple. I am having same issue
> with that and that uses db. That is what made me test with a generic version
> of b2b top hiding config. So maybe it's a particular piece of the messaging
> I need to use db? Below is my config I realize I never posted.
>
> # $Id: opensips-b2b.cfg $
>
> # Debugging mode:
> debug=3
> memlog= 6
> fork=yes
> auto_aliases=no
> log_stderror=no
>
> disable_dns_blacklist=yes
>
> listen=udp:192.168.1.116:5060
> # alias=OSIPS_REALM
> #port=OSIPS_PORT
>
>
> sip_warning=0
> #server_header="SRV_SIGNATURE"
> #user_agent_header="PP_USER_AGENT"
>
> #mhomed=yes
> #memlog=2
> check_via=no
> dns=off
> rev_dns=off
> children=1
> disable_tcp=yes
> log_facility=LOG_LOCAL7
> # for more info: opensips -h
>
> # ------------------ module loading ----------------------------------
>
> mpath="/usr/local/lib/opensips/modules/"
>
> #loadmodule "db_mysql.so"
> loadmodule "textops.so"
> loadmodule "maxfwd.so"
> loadmodule "rr.so"
> loadmodule "sl.so"
> loadmodule "tm.so"
> loadmodule "signaling.so"
> loadmodule "b2b_entities.so"
> loadmodule "b2b_logic.so"
> loadmodule "usrloc.so"
> loadmodule "registrar.so"
> loadmodule "mi_fifo.so"
>
>
> # ----------------- setting module-specific parameters ---------------
> modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")
>
>
> #modparam("usrloc|b2b_entities|b2b_logic", "db_url",
> "mysql://opensips:opensipsrw@localhost/opensips")
> modparam("usrloc", "db_mode", 0)
>
> modparam("tm", "pass_provisional_replies", 1)
>
> #modparam("b2b_logic", "script_scenario",
> "/usr/local/etc/opensips/scenario_script.xml")
> #modparam("b2b_logic", "extern_scenario",
> "/usr/local/etc/opensips/scenario_extern.xml")
> modparam("b2b_entities", "script_req_route", "b2b_request")
> modparam("b2b_entities", "script_reply_route", "b2b_reply")
>
> route[b2b_request] {
>  xlog("b2b_request ($ci)\n");
> }
>
>
> route[b2b_reply] {
>  xlog("b2b_reply ($ci)\n");
> }
>
>
> route {
>  if (!mf_process_maxfwd_header("10")) {
>    sl_send_reply("483","Too Many Hops");
>    exit;
>  };
>
>  if (msg:len >= 2380 ) {
>    sl_send_reply("513", "Message too big");
>    exit;
>  };
>
>  if (!method=="REGISTER")
>    record_route();
>
>  # subsequent messages withing a dialog should take the
>  # path determined by record-routing
>  if (loose_route()) {
>    # mark routing logic in request
>    append_hf("P-hint: rr-enforced\r\n");
>    route(1);
>  };
>
>  if(is_method("INVITE") && !(src_ip == "192.168.1.116" && src_port ==
> 5060)) {
>    # DO NOT call t_newtran() on this request -> it will result in the
> transaction never being deleted
>    b2b_init_request("top hiding");
>    exit; # do not forward this request, another one will be generated
>  };
>
>  if (!uri==myself) {
>    # mark routing logic in request
>    append_hf("P-hint: outbound\r\n");
>    route(1);
>  };
>
>
>  if (uri==myself) {
>
>    if (method=="REGISTER") {
>      save("location");
>      exit;
>    };
>
>    # native SIP destinations are handled using our USRLOC DB
>    #if (!lookup("location")) {
>    #  sl_send_reply("404", "Not Found");
>    #  exit;
>    #};
>    #append_hf("P-hint: usrloc applied\r\n");
>  };
>  $du = "sip:192.168.1.208";
>  route(1);
> }
>
>
> route[1] {
>  # send it out now; use stateful forwarding as it works reliably
>  # even for UDP2TCP
>
>  if (!t_relay()) {
>    sl_reply_error();
>  };
>  exit;
> }
>
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/B2BUA-Top-Hiding-in-1-7-trunk-tp6933831p6937550.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>



More information about the Users mailing list