Resources.B2bConfigExample History

Hide minor edits - Show changes to markup

April 24, 2013, at 05:42 PM by 109.99.235.212 -
Changed lines 1-5 from:

<-Back


Download

# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10: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
=8
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
"xlog.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", 2)

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") && ($fU=="bob") &&   /* only for Invite messages from bob*/
         
!(src_ip == "10.10.10.10" && src_port ==5060)) /* skip Invite messages generated by the B2BUA*/
 
{
   
# DO NOT call t_newtran() on this request -> it will result in the transaction never being deleted
    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
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");
 
};

  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;
}
to:

(:redirect Documentation/Tutorials-B2BUAConfigExample quiet=1:)

April 07, 2011, at 04:19 PM by anca_vamanu -
Changed line 5 from:
# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10: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
=8
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
"xlog.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", 2)

modparam
("tm", "pass_provisional_replies", 1)

modparam
("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
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") && ($fU=="bob") &&   /* only for Invite messages from bob*/
         
!(src_ip == "10.10.10.10" && src_port ==5060)) /* skip Invite messages generated by the B2BUA*/
 
{
   
# DO NOT call t_newtran() on this request -> it will result in the transaction never being deleted
    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
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");
 
};

  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;
}
to:
# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10: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
=8
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
"xlog.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", 2)

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") && ($fU=="bob") &&   /* only for Invite messages from bob*/
         
!(src_ip == "10.10.10.10" && src_port ==5060)) /* skip Invite messages generated by the B2BUA*/
 
{
   
# DO NOT call t_newtran() on this request -> it will result in the transaction never being deleted
    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
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");
 
};

  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;
}
April 07, 2011, at 04:15 PM by anca_vamanu -
April 07, 2011, at 04:15 PM by anca_vamanu -
Changed line 5 from:
# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10: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
=8
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
"xlog.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", 2)

modparam
("tm", "pass_provisional_replies", 1)

modparam
("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
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") && ($fU=="bob") &&   /* only for Invite messages from bob*/
         
!(src_ip == "10.10.10.10" && src_port ==5060)) /* skip Invite messages generated by the server*/
 
{
   
# DO NOT call t_newtran() on this request -> it will result in the transaction never being deleted
    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
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");
 
};

  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;
}
to:
# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10: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
=8
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
"xlog.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", 2)

modparam
("tm", "pass_provisional_replies", 1)

modparam
("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
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") && ($fU=="bob") &&   /* only for Invite messages from bob*/
         
!(src_ip == "10.10.10.10" && src_port ==5060)) /* skip Invite messages generated by the B2BUA*/
 
{
   
# DO NOT call t_newtran() on this request -> it will result in the transaction never being deleted
    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
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");
 
};

  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;
}
November 04, 2010, at 12:01 PM by anca_vamanu -
Changed lines 3-4 from:
# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10: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
=8
disable_tcp
=yes
log_facility
=LOG_LOCAL7
# for more info: opensips -h

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

mpath
="/usr/local/opensips/lib/modules/"

loadmodule
"db_mysql.so"
loadmodule
"xlog.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", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam
("usrloc", "db_mode", 2)

modparam
("tm", "pass_provisional_replies", 1)

modparam
("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
modparam
("b2b_logic", "script_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_script.xml")
modparam
("b2b_logic", "extern_scenario", "/home/anca/work/opensips/modules/b2b_logic/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") && ($fU=="bob") &&   /* only for Invite messages from bob*/
         
!(src_ip == "10.10.10.10" && src_port ==5060)) /* skip Invite messages generated by the server*/
 
{
   
# DO NOT call t_newtran() on this request -> it will result in the transaction never being deleted
    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
exit;
 
};

 
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");
 
};

  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;
}
to:

Download

# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10: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
=8
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
"xlog.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", 2)

modparam
("tm", "pass_provisional_replies", 1)

modparam
("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
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") && ($fU=="bob") &&   /* only for Invite messages from bob*/
         
!(src_ip == "10.10.10.10" && src_port ==5060)) /* skip Invite messages generated by the server*/
 
{
   
# DO NOT call t_newtran() on this request -> it will result in the transaction never being deleted
    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
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");
 
};

  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;
}
June 24, 2010, at 12:43 PM by anca_vamanu -
Changed line 4 from:
# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10: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
=8
disable_tcp
=yes
log_facility
=LOG_LOCAL7
# for more info: opensips -h

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

mpath
="/usr/local/opensips/lib/modules/"

loadmodule
"db_mysql.so"
loadmodule
"xlog.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", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam
("usrloc", "db_mode", 2)

modparam
("tm", "pass_provisional_replies", 1)

modparam
("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
modparam
("b2b_logic", "script_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_script.xml")
modparam
("b2b_logic", "extern_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_extern.xml")

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") && ($fU=="bob") &&   /* only for Invite messages from bob*/
         
!(src_ip == "10.10.10.10" && src_port ==5060)) /* skip Invite messages generated by the server*/
 
{
   
# DO NOT call t_newtran() on this request -> it will result in the transaction never being deleted
    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
exit;
 
};

 
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");
 
};

  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;
}
to:
# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10: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
=8
disable_tcp
=yes
log_facility
=LOG_LOCAL7
# for more info: opensips -h

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

mpath
="/usr/local/opensips/lib/modules/"

loadmodule
"db_mysql.so"
loadmodule
"xlog.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", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam
("usrloc", "db_mode", 2)

modparam
("tm", "pass_provisional_replies", 1)

modparam
("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
modparam
("b2b_logic", "script_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_script.xml")
modparam
("b2b_logic", "extern_scenario", "/home/anca/work/opensips/modules/b2b_logic/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") && ($fU=="bob") &&   /* only for Invite messages from bob*/
         
!(src_ip == "10.10.10.10" && src_port ==5060)) /* skip Invite messages generated by the server*/
 
{
   
# DO NOT call t_newtran() on this request -> it will result in the transaction never being deleted
    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
exit;
 
};

 
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");
 
};

  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;
}
June 22, 2010, at 04:31 PM by anca_vamanu -
Changed line 4 from:
# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10: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
=8
disable_tcp
=yes
log_facility
=LOG_LOCAL7
# for more info: opensips -h

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

mpath
="/usr/local/opensips/lib/modules/"

loadmodule
"db_mysql.so"
loadmodule
"xlog.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", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam
("usrloc", "db_mode", 2)

modparam
("tm", "pass_provisional_replies", 1)

modparam
("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
modparam
("b2b_logic", "script_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_script.xml")
modparam
("b2b_logic", "extern_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_extern.xml")

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") && ($fU=="bob") &&   /* only for Invite messages from bob*/
         
!(src_ip == "10.10.10.10" && src_port ==5060)) /* skip Invite messages generated by the server*/
 
{
   


    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
exit;
 
};

 
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");
 
};

  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;
}
to:
# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10: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
=8
disable_tcp
=yes
log_facility
=LOG_LOCAL7
# for more info: opensips -h

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

mpath
="/usr/local/opensips/lib/modules/"

loadmodule
"db_mysql.so"
loadmodule
"xlog.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", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam
("usrloc", "db_mode", 2)

modparam
("tm", "pass_provisional_replies", 1)

modparam
("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
modparam
("b2b_logic", "script_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_script.xml")
modparam
("b2b_logic", "extern_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_extern.xml")

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") && ($fU=="bob") &&   /* only for Invite messages from bob*/
         
!(src_ip == "10.10.10.10" && src_port ==5060)) /* skip Invite messages generated by the server*/
 
{
   
# DO NOT call t_newtran() on this request -> it will result in the transaction never being deleted
    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
exit;
 
};

 
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");
 
};

  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;
}
June 22, 2010, at 04:27 PM by anca_vamanu -
Changed line 4 from:
# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10: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
=8
disable_tcp
=yes
log_facility
=LOG_LOCAL7
# for more info: opensips -h

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

mpath
="/usr/local/opensips/lib/modules/"

loadmodule
"db_mysql.so"
loadmodule
"xlog.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", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam
("usrloc", "db_mode", 2)

modparam
("tm", "pass_provisional_replies", 1)

modparam
("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
modparam
("b2b_logic", "script_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_script.xml")
modparam
("b2b_logic", "extern_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_extern.xml")

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") && ($fU=="bob") &&     /* only for Invite messages from bob*/
         
!(src_ip == "10.10.10.10" && src_port ==5060)) /* skip Invite messages generated by the server*/
 
{
   


    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
exit;
 
};

 
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");
 
};

  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;
}
to:
# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10: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
=8
disable_tcp
=yes
log_facility
=LOG_LOCAL7
# for more info: opensips -h

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

mpath
="/usr/local/opensips/lib/modules/"

loadmodule
"db_mysql.so"
loadmodule
"xlog.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", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam
("usrloc", "db_mode", 2)

modparam
("tm", "pass_provisional_replies", 1)

modparam
("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
modparam
("b2b_logic", "script_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_script.xml")
modparam
("b2b_logic", "extern_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_extern.xml")

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") && ($fU=="bob") &&   /* only for Invite messages from bob*/
         
!(src_ip == "10.10.10.10" && src_port ==5060)) /* skip Invite messages generated by the server*/
 
{
   


    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
exit;
 
};

 
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");
 
};

  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;
}
June 22, 2010, at 04:26 PM by anca_vamanu -
Changed line 4 from:
# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10: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
=8
disable_tcp
=yes
log_facility
=LOG_LOCAL7
# for more info: opensips -h

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

mpath
="/usr/local/opensips/lib/modules/"

loadmodule
"db_mysql.so"
loadmodule
"xlog.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", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam
("usrloc", "db_mode", 2)

modparam
("tm", "pass_provisional_replies", 1)

modparam
("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
modparam
("b2b_logic", "script_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_script.xml")
modparam
("b2b_logic", "extern_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_extern.xml")

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") && ($fU=="bob") &&     /* only for Invite messages from bob*/
         
!(src_ip == "10.10.10.10" && src_port ==5060)) /* skip Invite messages generated by the server*/
 
{
   
if (! t_newtran())
   
{
      sl_reply_error
();
     
exit;
   
};

    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
exit;
 
};

 
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");
 
};

  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;
}
to:
# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10: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
=8
disable_tcp
=yes
log_facility
=LOG_LOCAL7
# for more info: opensips -h

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

mpath
="/usr/local/opensips/lib/modules/"

loadmodule
"db_mysql.so"
loadmodule
"xlog.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", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam
("usrloc", "db_mode", 2)

modparam
("tm", "pass_provisional_replies", 1)

modparam
("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
modparam
("b2b_logic", "script_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_script.xml")
modparam
("b2b_logic", "extern_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_extern.xml")

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") && ($fU=="bob") &&     /* only for Invite messages from bob*/
         
!(src_ip == "10.10.10.10" && src_port ==5060)) /* skip Invite messages generated by the server*/
 
{
   


    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
exit;
 
};

 
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");
 
};

  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;
}
January 11, 2010, at 03:37 PM by anca_vamanu -
Changed line 4 from:
# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10: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
=8
disable_tcp
=yes
log_facility
=LOG_LOCAL7
# for more info: opensips -h

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

mpath
="/usr/local/opensips/lib/modules/"

loadmodule
"db_mysql.so"
loadmodule
"xlog.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", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam
("usrloc", "db_mode", 2)

modparam
("tm", "pass_provisional_replies", 1)

modparam
("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
modparam
("b2b_logic", "script_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_script.xml")
modparam
("b2b_logic", "extern_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_extern.xml")

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") && ($fU=="bob") &&     /* only for Invite messages from bob*/
         
!(src_ip == 10.10.10.10 && src_port ==5060)) /* skip Invite messages generated by the server*/
 
{
   
if (! t_newtran())
   
{
      sl_reply_error
();
     
exit;
   
};

    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
exit;
 
};

 
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");
 
};

  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;
}
to:
# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10: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
=8
disable_tcp
=yes
log_facility
=LOG_LOCAL7
# for more info: opensips -h

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

mpath
="/usr/local/opensips/lib/modules/"

loadmodule
"db_mysql.so"
loadmodule
"xlog.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", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam
("usrloc", "db_mode", 2)

modparam
("tm", "pass_provisional_replies", 1)

modparam
("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
modparam
("b2b_logic", "script_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_script.xml")
modparam
("b2b_logic", "extern_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_extern.xml")

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") && ($fU=="bob") &&     /* only for Invite messages from bob*/
         
!(src_ip == "10.10.10.10" && src_port ==5060)) /* skip Invite messages generated by the server*/
 
{
   
if (! t_newtran())
   
{
      sl_reply_error
();
     
exit;
   
};

    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
exit;
 
};

 
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");
 
};

  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;
}
July 23, 2009, at 12:47 PM by bogdan -
Changed line 4 from:
# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10:5060
# alias=OSER_REALM
#port=OSER_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
=8
disable_tcp
=yes
log_facility
=LOG_LOCAL7
# for more info: openser -h

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

mpath
="/usr/local/opensips/lib/modules/"

loadmodule
"db_mysql.so"
loadmodule
"xlog.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", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam
("usrloc", "db_mode", 2)

modparam
("tm", "pass_provisional_replies", 1)

modparam
("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
modparam
("b2b_logic", "script_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_script.xml")
modparam
("b2b_logic", "extern_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_extern.xml")

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") && ($fU=="bob") &&     /* only for Invite messages from bob*/
         
!(src_ip == 10.10.10.10 && src_port ==5060)) /* skip Invite messages generated by the server*/
 
{
   
if (! t_newtran())
   
{
      sl_reply_error
();
     
exit;
   
};

    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
exit;
 
};

 
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");
 
};

  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;
}
to:
# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10: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
=8
disable_tcp
=yes
log_facility
=LOG_LOCAL7
# for more info: opensips -h

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

mpath
="/usr/local/opensips/lib/modules/"

loadmodule
"db_mysql.so"
loadmodule
"xlog.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", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam
("usrloc", "db_mode", 2)

modparam
("tm", "pass_provisional_replies", 1)

modparam
("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
modparam
("b2b_logic", "script_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_script.xml")
modparam
("b2b_logic", "extern_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_extern.xml")

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") && ($fU=="bob") &&     /* only for Invite messages from bob*/
         
!(src_ip == 10.10.10.10 && src_port ==5060)) /* skip Invite messages generated by the server*/
 
{
   
if (! t_newtran())
   
{
      sl_reply_error
();
     
exit;
   
};

    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
exit;
 
};

 
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");
 
};

  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;
}
July 22, 2009, at 03:59 PM by anca_vamanu -
Changed line 1 from:

Resources -> Documentation -> Tutorials-> B2BUA Tutorial->B2BUA OpenSIPS configuration file example

to:
July 22, 2009, at 03:54 PM by anca_vamanu -
Changed lines 4-137 from:
# $Id: opensips-b2b.cfg $

# Debugging mode:
debug=3
memlog= 6
fork=yes
auto_aliases=no
log_stderror=yes

disable_dns_blacklist=yes

listen=10.10.10.10:5060
# alias=OSER_REALM
#port=OSER_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=8
disable_tcp=yes
log_facility=LOG_LOCAL7
# for more info: openser -h

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

mpath="/usr/local/opensips/lib/modules/"

loadmodule "db_mysql.so"
loadmodule "xlog.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", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam("usrloc", "db_mode", 2)

modparam("tm", "pass_provisional_replies", 1)

modparam("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
modparam("b2b_logic", "script_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_script.xml")
modparam("b2b_logic", "extern_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_extern.xml")

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") && ($fU=="bob") &&     /* only for Invite messages from bob*/
        	!(src_ip == 10.10.10.10 && src_port ==5060)) /* skip Invite messages generated by the server*/
	{
		if (! t_newtran())
		{
			sl_reply_error();
			exit;
		};

		b2b_init_request("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
		exit;
	};

	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"); 
	};

	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;
}
to:
# $Id: opensips-b2b.cfg $

# Debugging mode:
debug
=3
memlog
= 6
fork
=yes
auto_aliases
=no
log_stderror
=yes

disable_dns_blacklist
=yes

listen
=10.10.10.10:5060
# alias=OSER_REALM
#port=OSER_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
=8
disable_tcp
=yes
log_facility
=LOG_LOCAL7
# for more info: openser -h

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

mpath
="/usr/local/opensips/lib/modules/"

loadmodule
"db_mysql.so"
loadmodule
"xlog.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", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam
("usrloc", "db_mode", 2)

modparam
("tm", "pass_provisional_replies", 1)

modparam
("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
modparam
("b2b_logic", "script_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_script.xml")
modparam
("b2b_logic", "extern_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_extern.xml")

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") && ($fU=="bob") &&     /* only for Invite messages from bob*/
         
!(src_ip == 10.10.10.10 && src_port ==5060)) /* skip Invite messages generated by the server*/
 
{
   
if (! t_newtran())
   
{
      sl_reply_error
();
     
exit;
   
};

    b2b_init_request
("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
   
exit;
 
};

 
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");
 
};

  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;
}
July 22, 2009, at 03:33 PM by anca_vamanu -
Changed line 90 from:
	!(src_ip == 10.10.10.10 && src_port ==5060)) /* skip Invite messages generated by the server*/
to:
        	!(src_ip == 10.10.10.10 && src_port ==5060)) /* skip Invite messages generated by the server*/
Deleted lines 104-111:
		# if you have some interdomain connections via TLS
		#if(uri=~"@tls_domain1.net") {
		#	t_relay("tls:domain1.net");
		#	exit;
		#} else if(uri=~"@tls_domain2.net") {
		#	t_relay("tls:domain2.net");
		#	exit;
		#}
Deleted lines 111-116:
			# Uncomment this if you want to use digest authentication
			#if (!www_authorize("opensips.org", "subscriber")) {
			#	www_challenge("opensips.org", "0");
			#	exit;
			#};
July 22, 2009, at 03:29 PM by anca_vamanu -
Changed lines 4-6 from:

B2BUA OpenSIPS configuration file example

=cpp [=

to:

[@

Changed line 151 from:

=]

to:

@]

July 22, 2009, at 03:13 PM by anca_vamanu -
Changed lines 6-7 from:

[@# $Id: opensips-b2b.cfg $

to:

=cpp [=

  1. $Id: opensips-b2b.cfg $
Changed line 153 from:

@]

to:

=]

July 22, 2009, at 03:09 PM by anca_vamanu -
Added lines 1-152:

Resources -> Documentation -> Tutorials-> B2BUA Tutorial->B2BUA OpenSIPS configuration file example


B2BUA OpenSIPS configuration file example

# $Id: opensips-b2b.cfg $

# Debugging mode:
debug=3
memlog= 6
fork=yes
auto_aliases=no
log_stderror=yes

disable_dns_blacklist=yes

listen=10.10.10.10:5060
# alias=OSER_REALM
#port=OSER_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=8
disable_tcp=yes
log_facility=LOG_LOCAL7
# for more info: openser -h

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

mpath="/usr/local/opensips/lib/modules/"

loadmodule "db_mysql.so"
loadmodule "xlog.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", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam("usrloc", "db_mode", 2)

modparam("tm", "pass_provisional_replies", 1)

modparam("b2b_entities", "server_address", "sip:sa@10.10.10.10:5060")
modparam("b2b_logic", "script_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_script.xml")
modparam("b2b_logic", "extern_scenario", "/home/anca/work/opensips/modules/b2b_logic/scenario_extern.xml")

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") && ($fU=="bob") &&     /* only for Invite messages from bob*/
	!(src_ip == 10.10.10.10 && src_port ==5060)) /* skip Invite messages generated by the server*/
	{
		if (! t_newtran())
		{
			sl_reply_error();
			exit;
		};

		b2b_init_request("prepaid", "sip:320@opensips.org:5070", "sip:321@opensips.org:5070");
		exit;
	};

	if (!uri==myself) {
		# mark routing logic in request
		append_hf("P-hint: outbound\r\n"); 
		# if you have some interdomain connections via TLS
		#if(uri=~"@tls_domain1.net") {
		#	t_relay("tls:domain1.net");
		#	exit;
		#} else if(uri=~"@tls_domain2.net") {
		#	t_relay("tls:domain2.net");
		#	exit;
		#}
		route(1);
	};


	if (uri==myself) {

		if (method=="REGISTER") {

			# Uncomment this if you want to use digest authentication
			#if (!www_authorize("opensips.org", "subscriber")) {
			#	www_challenge("opensips.org", "0");
			#	exit;
			#};
			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"); 
	};

	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;
}

Page last modified on April 24, 2013, at 05:42 PM