<div><font face="tahoma,sans-serif">Hello, </font></div>
<div><font face="tahoma,sans-serif"></font> </div>
<div><font face="tahoma,sans-serif">Something is happening with my configuration, every time i restart opensips, opensips lost the registrations and i have to restart the phones....by the way, i configured the authentication and is not workink, for non-Register and Register OpenSIPS is not sending the 401 or 407...i don't now what is going on...a will paste here my configs, opensips.cfg and openctlrc</font></div>
<div><font face="tahoma,sans-serif"></font> </div>
<div><font size="4"><font face="tahoma,sans-serif"><strong>opensips.cfg</strong> </font></font></div>
<div><font face="tahoma,sans-serif"></font> </div>
<div><font face="tahoma,sans-serif">#<br># $Id: opensips.cfg 7027 2010-07-15 13:48:29Z razvancrainea $<br>#<br># OpenSIPS basic configuration script<br># by Anca Vamanu <</font><a href="mailto:anca@voice-system.ro"><font face="tahoma,sans-serif">anca@voice-system.ro</font></a><font face="tahoma,sans-serif">><br>
#<br># Please refer to the Core CookBook at:<br># </font><a href="http://www.opensips.org/index.php?n=Resources.DocsCookbooks"><font face="tahoma,sans-serif">http://www.opensips.org/index.php?n=Resources.DocsCookbooks</font></a><br>
<font face="tahoma,sans-serif"># for a explanation of possible statements, functions and parameters.<br>#</font></div>
<div><br><font face="tahoma,sans-serif">####### Global Parameters #########</font></div>
<div><font face="tahoma,sans-serif">debug=3 <br>log_stderror=no<br>log_facility=LOG_LOCAL0</font></div>
<div><font face="tahoma,sans-serif">fork=yes<br>children=4 #total number of UDP SIP worker processes per interface</font></div>
<div><font face="tahoma,sans-serif">/* uncomment the following lines to enable debugging */<br>#debug=6<br>#fork=no<br>#log_stderror=yes</font></div>
<div><font face="tahoma,sans-serif">server_header="Server: OpenSIPS SIP Proxy"</font></div>
<div><font face="tahoma,sans-serif">/* uncomment the next line to disable TCP (default on) */<br>disable_tcp=yes #total number of TCP SIP worker processes in total</font></div>
<div><font face="tahoma,sans-serif">/* uncomment the next line to enable the auto temporary blacklisting of <br> not available destinations (default disabled) */<br>#disable_dns_blacklist=no</font></div>
<div><font face="tahoma,sans-serif">/* uncomment the next line to enable IPv6 lookup after IPv4 dns <br> lookup failures (default disabled) */<br>#dns_try_ipv6=yes</font></div>
<div><font face="tahoma,sans-serif">/* uncomment the next line to disable the auto discovery of local aliases<br> based on revers DNS on IPs (default on) */<br>#auto_aliases=no</font></div>
<div><font face="tahoma,sans-serif">/* uncomment the following lines to enable TLS support (default off) */<br>#disable_tls = no<br>#listen = tls:your_IP:5061<br>#tls_verify_server = 1<br>#tls_verify_client = 1<br>#tls_require_client_certificate = 0<br>
#tls_method = TLSv1<br>#tls_certificate = "//etc/opensips/tls/user/user-cert.pem"<br>#tls_private_key = "//etc/opensips/tls/user/user-privkey.pem"<br>#tls_ca_list = "//etc/opensips/tls/user/user-calist.pem"</font></div>
<div><br><font face="tahoma,sans-serif">port=5060</font></div>
<div><font face="tahoma,sans-serif">/* uncomment and configure the following line if you want opensips to <br> bind on a specific interface/port/proto (default bind on all available) */<br>listen=udp:<a href="http://172.30.140.8:5060">172.30.140.8:5060</a></font></div>
<div><br><font face="tahoma,sans-serif">####### Modules Section ########</font></div>
<div><font face="tahoma,sans-serif">#set module path<br>mpath="//lib/opensips/modules/"</font></div>
<div><font face="tahoma,sans-serif">/* uncomment next line for MySQL DB support */<br>loadmodule "db_mysql.so"<br>loadmodule "signaling.so"<br>loadmodule "sl.so"<br>loadmodule "tm.so"<br>
loadmodule "rr.so"<br>loadmodule "maxfwd.so"<br>loadmodule "usrloc.so"<br>loadmodule "registrar.so"<br>loadmodule "textops.so"<br>loadmodule "mi_fifo.so"<br>loadmodule "uri.so"<br>
loadmodule "acc.so"<br>/* uncomment next lines for MySQL based authentication support <br> NOTE: a DB (like db_mysql) module must be also loaded */<br>loadmodule "auth.so"<br>loadmodule "auth_db.so"<br>
/* uncomment next line for aliases support<br> NOTE: a DB (like db_mysql) module must be also loaded */<br>#loadmodule "alias_db.so"<br>/* uncomment next line for multi-domain support<br> NOTE: a DB (like db_mysql) module must be also loaded<br>
NOTE: be sure and enable multi-domain support in all used modules<br> (see "multi-module params" section ) */<br>#loadmodule "domain.so"<br>/* uncomment the next two lines for presence server support<br>
NOTE: a DB (like db_mysql) module must be also loaded */<br>#loadmodule "presence.so"<br>#loadmodule "presence_xml.so"</font></div>
<div><br><font face="tahoma,sans-serif"># ----------------- setting module-specific parameters ---------------</font></div>
<div><br><font face="tahoma,sans-serif"># ----- mi_fifo params -----<br>modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")</font></div>
<div><br><font face="tahoma,sans-serif"># ----- rr params -----<br># add value to ;lr param to cope with most of the UAs<br>modparam("rr", "enable_full_lr", 1)<br># do not append from tag to the RR (no need for this script)<br>
modparam("rr", "append_fromtag", 0)</font></div>
<div><br><font face="tahoma,sans-serif"># ----- registrar params -----<br>/* uncomment the next line not to allow more than 10 contacts per AOR */<br>#modparam("registrar", "max_contacts", 10)</font></div>
<div><br><font face="tahoma,sans-serif"># ----- usrloc params -----<br>modparam("usrloc", "db_mode", 2) #All changes are made to memory and database synchronization is done in the timer<br>/* uncomment the following lines if you want to enable DB persistency<br>
for location entries */<br>modparam("usrloc", "db_url","mysql://opensips:opensipsro<@localhost/opensips")</font></div>
<div><br><font face="tahoma,sans-serif"># ----- uri params -----<br>modparam("uri", "use_uri_table", 0)</font></div>
<div><br><font face="tahoma,sans-serif"># ----- acc params -----<br>/* what sepcial events should be accounted ? */<br>modparam("acc", "early_media", 1)<br>modparam("acc", "report_ack", 1)<br>
modparam("acc", "report_cancels", 1)<br>/* by default ww do not adjust the direct of the sequential requests.<br> if you enable this parameter, be sure the enable "append_fromtag"<br> in "rr" module */<br>
modparam("acc", "detect_direction", 0)<br>/* account triggers (flags) */<br>modparam("acc", "failed_transaction_flag", 3)<br>modparam("acc", "log_flag", 1)<br>modparam("acc", "log_missed_flag", 2)<br>
/* uncomment the following lines to enable DB accounting also */<br>modparam("acc", "db_flag", 1)<br>modparam("acc", "db_missed_flag", 2)</font></div>
<div><br><font face="tahoma,sans-serif"># ----- auth_db params -----<br>/* uncomment the following lines if you want to enable the DB based<br> authentication */<br>modparam("auth_db", "calculate_ha1", yes)<br>
modparam("auth_db", "password_column", "password")<br>modparam("auth_db", "db_url","mysql://opensips:opensipsro<@localhost/opensips")<br>modparam("auth_db", "load_credentials", "")</font></div>
<div><br><font face="tahoma,sans-serif"># ----- alias_db params -----<br>/* uncomment the following lines if you want to enable the DB based<br> aliases */<br>#modparam("alias_db", "db_url",<br># "mysql://opensips:2705ag1<@localhost/opensips")</font></div>
<div><br><font face="tahoma,sans-serif"># ----- domain params -----<br>/* uncomment the following lines to enable multi-domain detection<br> support */<br>#modparam("domain", "db_url",<br># "mysql://opensips:opensipsrw@localhost/opensips")<br>
#modparam("domain", "db_mode", 1) # Use caching</font></div>
<div><br><font face="tahoma,sans-serif"># ----- multi-module params -----<br>/* uncomment the following line if you want to enable multi-domain support<br> in the modules (dafault off) */<br>#modparam("auth_db|usrloc|uri", "use_domain", 1)</font></div>
<div><br><font face="tahoma,sans-serif"># ----- presence params -----<br>/* uncomment the following lines if you want to enable presence */<br>#modparam("presence|presence_xml", "db_url",<br># "mysql://opensips:opensipsrw@localhost/opensips")<br>
#modparam("presence_xml", "force_active", 1)<br>#modparam("presence", "server_address", "sip:<a href="http://192.168.1.2:5060">192.168.1.2:5060</a>")</font></div>
<div><br><font face="tahoma,sans-serif">####### Routing Logic ########</font></div>
<div><br><font face="tahoma,sans-serif"># main request routing logic</font></div>
<div><font face="tahoma,sans-serif">route{</font></div>
<div><font face="tahoma,sans-serif"> if (!mf_process_maxfwd_header("10")) {<br> sl_send_reply("483","Too Many Hops");<br> exit;<br> }</font></div>
<div><font face="tahoma,sans-serif"> if (has_totag()) {<br> # sequential request withing a dialog should<br> # take the path determined by record-routing<br> if (loose_route()) {<br> if (is_method("BYE")) {<br>
setflag(1); # do accounting ...<br> setflag(3); # ... even if the transaction fails<br> } else if (is_method("INVITE")) {<br> # even if in most of the cases is useless, do RR for<br> # re-INVITEs alos, as some buggy clients do change route set<br>
# during the dialog.<br> record_route();<br> }<br> # route it out to whatever destination was set by loose_route()<br> # in $du (destination URI).<br> route(1);<br> } else {<br> /* uncomment the following lines if you want to enable presence */<br>
##if (is_method("SUBSCRIBE") && $rd == "your.server.ip.address") {<br> ## # in-dialog subscribe requests<br> ## route(2);<br> ## exit;<br> ##}<br> if ( is_method("ACK") ) {<br>
if ( t_check_trans() ) {<br> # non loose-route, but stateful ACK; must be an ACK after <br> # a 487 or e.g. 404 from upstream server<br> t_relay();<br> exit;<br> } else {<br> # ACK without matching transaction -><br>
# ignore and discard<br> exit;<br> }<br> }<br> sl_send_reply("404","Not here");<br> }<br> exit;<br> }</font></div>
<div><font face="tahoma,sans-serif"> #initial requests</font></div>
<div><font face="tahoma,sans-serif"> # CANCEL processing<br> if (is_method("CANCEL"))<br> {<br> if (t_check_trans())<br> t_relay();<br> exit;<br> }</font></div>
<div><font face="tahoma,sans-serif"> t_check_trans();</font></div>
<div><font face="tahoma,sans-serif"> # authenticate if from local subscriber (uncomment to enable auth)<br> # authenticate all initial non-REGISTER request that pretend to be<br> # generated by local subscriber (domain from FROM URI is local)<br>
if (!(method=="REGISTER") && from_uri==myself) /*no multidomain version*/<br> ##if (!(method=="REGISTER") && is_from_local()) /*multidomain version*/<br> {<br> if (!proxy_authorize("", "subscriber")) {<br>
proxy_challenge("", "0");<br> exit;<br> }<br> if (!db_check_from()) {<br> sl_send_reply("403","Forbidden auth ID");<br> exit;<br> }<br> ##<br> consume_credentials();<br>
## # caller authenticated<br> }</font></div>
<div><font face="tahoma,sans-serif"> # preloaded route checking<br> if (loose_route()) {<br> xlog("L_ERR",<br> "Attempt to route with preloaded Route's [$fu/$tu/$ru/$ci]");<br> if (!is_method("ACK"))<br>
sl_send_reply("403","Preload Route denied");<br> exit;<br> }</font></div>
<div><font face="tahoma,sans-serif"> # record routing<br> if (!is_method("REGISTER|MESSAGE"))<br> record_route();</font></div>
<div><font face="tahoma,sans-serif"> # account only INVITEs<br> if (is_method("INVITE")) {<br> setflag(1); # do accounting<br> }<br> if (!uri==myself)<br> ## replace with following line if multi-domain support is used<br>
##if (!is_uri_host_local())<br> {<br> append_hf("P-hint: outbound\r\n"); <br> # if you have some interdomain connections via TLS<br> ##if($rd=="<a href="http://tls_domain1.net">tls_domain1.net</a>") {<br>
## t_relay("tls:<a href="http://domain1.net">domain1.net</a>");<br> ## exit;<br> ##} else if($rd=="<a href="http://tls_domain2.net">tls_domain2.net</a>") {<br> ## t_relay("tls:<a href="http://domain2.net">domain2.net</a>");<br>
## exit;<br> ##}<br> route(1);<br> }</font></div>
<div><font face="tahoma,sans-serif"> # requests for my domain</font></div>
<div><font face="tahoma,sans-serif"> ## uncomment this if you want to enable presence server <br> ## and comment the next 'if' block<br> ## NOTE: uncomment also the definition of route[2] from below<br> ##if( is_method("PUBLISH|SUBSCRIBE"))<br>
## route(2);</font></div>
<div><font face="tahoma,sans-serif"> if (is_method("PUBLISH"))<br> {<br> sl_send_reply("503", "Service Unavailable");<br> exit;<br> }<br> </font></div>
<div><font face="tahoma,sans-serif"> if (is_method("REGISTER"))<br> {<br> # authenticate the REGISTER requests (uncomment to enable auth)<br> if (!www_authorize("", "subscriber"))<br> {<br>
www_challenge("", "0");<br> exit;<br> }<br> ##<br> if (!db_check_to()) <br> {<br> sl_send_reply("403","Forbidden auth ID");<br> exit;<br> }</font></div>
<div><font face="tahoma,sans-serif"> if (!save("location"))<br> sl_reply_error();</font></div>
<div><font face="tahoma,sans-serif"> exit;<br> }</font></div>
<div><font face="tahoma,sans-serif"> if ($rU==NULL) {<br> # request with no Username in RURI<br> sl_send_reply("484","Address Incomplete");<br> exit;<br> }</font></div>
<div><font face="tahoma,sans-serif"> # apply DB based aliases (uncomment to enable)<br> ##alias_db_lookup("dbaliases");</font></div>
<div><font face="tahoma,sans-serif"> # do lookup with method filtering<br> if (!lookup("location","m")) {<br> switch ($retcode) {<br> case -1:<br> case -3:<br> t_newtran();<br> t_reply("404", "Not Found");<br>
exit;<br> case -2:<br> sl_send_reply("405", "Method Not Allowed");<br> exit;<br> }<br> }</font></div>
<div><font face="tahoma,sans-serif"> # when routing via usrloc, log the missed calls also<br> setflag(2);</font></div>
<div><font face="tahoma,sans-serif"> route(1);<br>}</font></div>
<div><br><font face="tahoma,sans-serif">route[1] {<br> # for INVITEs enable some additional helper routes<br> if (is_method("INVITE")) {<br> t_on_branch("2");<br> t_on_reply("2");<br> t_on_failure("1");<br>
}</font></div>
<div><font face="tahoma,sans-serif"> if (!t_relay()) {<br> sl_reply_error();<br> };<br> exit;<br>}</font></div>
<div><br><font face="tahoma,sans-serif"># Presence route<br>/* uncomment the whole following route for enabling presence<br> NOTE: do not forget to enable the call of this route from the main<br> route */<br>##route[2]<br>
##{<br>## if (!t_newtran())<br>## {<br>## sl_reply_error();<br>## exit;<br>## };<br>##<br>## if(is_method("PUBLISH"))<br>## {<br>## handle_publish();<br>## }<br>## else<br>## if( is_method("SUBSCRIBE"))<br>
## {<br>## handle_subscribe();<br>## }<br>##<br>## exit;<br>##}</font></div>
<div><br><font face="tahoma,sans-serif">branch_route[2] {<br> xlog("new branch at $ru\n");<br>}</font></div>
<div><br><font face="tahoma,sans-serif">onreply_route[2] {<br> xlog("incoming reply\n");<br>}</font></div>
<div><br><font face="tahoma,sans-serif">failure_route[1] {<br> if (t_was_cancelled()) {<br> exit;<br> }</font></div>
<div><font face="tahoma,sans-serif"> # uncomment the following lines if you want to block client <br> # redirect based on 3xx replies.<br> ##if (t_check_status("3[0-9][0-9]")) {<br> ##t_reply("404","Not found");<br>
## exit;<br> ##}</font></div>
<div><font face="tahoma,sans-serif"> # uncomment the following lines if you want to redirect the failed <br> # calls to a different new destination<br> ##if (t_check_status("486|408")) {<br> ## sethostport("<a href="http://192.168.2.100:5060">192.168.2.100:5060</a>");<br>
## # do not set the missed call flag again<br> ## t_relay();<br> ##}<br>}</font></div>
<div><font face="tahoma,sans-serif"></font> </div>
<div><strong><font size="4" face="tahoma,sans-serif">opensipsctlrc</font></strong></div>
<div><font face="tahoma,sans-serif"></font> </div>
<div><font face="tahoma,sans-serif"># $Id: opensipsctlrc 7337 2010-10-28 22:02:46Z osas $<br>#<br># The OpenSIPS configuration file for the control tools.<br>#<br># Here you can set variables used in the opensipsctl and opensipsdbctl setup<br>
# scripts. Per default all variables here are commented out, the control tools<br># will use their internal default values.</font></div>
<div><font face="tahoma,sans-serif">## your SIP domain<br>SIP_DOMAIN=172.30.140.8</font></div>
<div><font face="tahoma,sans-serif">## chrooted directory<br># $CHROOT_DIR="/path/to/chrooted/directory"</font></div>
<div><font face="tahoma,sans-serif">## database type: MYSQL, PGSQL, ORACLE, DB_BERKELEY, or DBTEXT, <br>## by default none is loaded<br># If you want to setup a database with opensipsdbctl, you must at least specify<br># this parameter.<br>
DBENGINE=MYSQL</font></div>
<div><font face="tahoma,sans-serif">## database host<br>DBHOST=localhost</font></div>
<div><font face="tahoma,sans-serif">## database name (for ORACLE this is TNS name)<br>DBNAME=opensips</font></div>
<div><font face="tahoma,sans-serif"># database path used by dbtext or db_berkeley<br># DB_PATH="/usr/local/etc/opensips/dbtext"</font></div>
<div><font face="tahoma,sans-serif">## database read/write user<br>DBRWUSER=opensips</font></div>
<div><font face="tahoma,sans-serif">## password for database read/write user<br>#DBRWPW="opensipsrw"</font></div>
<div><font face="tahoma,sans-serif">## database read only user<br>DBROUSER=opensipsro</font></div>
<div><font face="tahoma,sans-serif">## password for database read only user<br>DBROPW=opensipsro</font></div>
<div><font face="tahoma,sans-serif">## database super user (for ORACLE this is 'scheme-creator' user)<br>DBROOTUSER="root"</font></div>
<div><font face="tahoma,sans-serif"># user name column<br># USERCOL="username"</font></div>
<div><br><font face="tahoma,sans-serif"># SQL definitions<br># If you change this definitions here, then you must change them <br># in db/schema/entities.xml too.<br># FIXME</font></div>
<div><font face="tahoma,sans-serif"># FOREVER="2020-05-28 21:32:15"<br># DEFAULT_ALIASES_EXPIRES=$FOREVER<br># DEFAULT_Q="1.0"<br># DEFAULT_CALLID="Default-Call-ID"<br># DEFAULT_CSEQ="13"<br>
# DEFAULT_LOCATION_EXPIRES=$FOREVER</font></div>
<div><br><font face="tahoma,sans-serif"># Program to calculate a message-digest fingerprint <br># MD5="md5sum"</font></div>
<div><font face="tahoma,sans-serif"># awk tool<br># AWK="awk"</font></div>
<div><font face="tahoma,sans-serif"># grep tool<br># GREP="grep"</font></div>
<div><font face="tahoma,sans-serif"># sed tool<br># SED="sed"</font></div>
<div><br><font face="tahoma,sans-serif"># Describe what additional tables to install. Valid values for the variables<br># below are yes/no/ask. With ask (default) it will interactively ask the user<br># for an answer, while yes/no allow for automated, unassisted installs.<br>
#</font></div>
<div><font face="tahoma,sans-serif"># If to install tables for the modules in the EXTRA_MODULES variable.<br># INSTALL_EXTRA_TABLES=ask</font></div>
<div><font face="tahoma,sans-serif"># If to install presence related tables.<br># INSTALL_PRESENCE_TABLES=ask</font></div>
<div><font face="tahoma,sans-serif"># Define what module tables should be installed.<br># If you use the postgres database and want to change the installed tables,<br># then you must also adjust the STANDARD_TABLES or EXTRA_TABLES variable <br>
# accordingly in the opensipsdbctl.base script.</font></div>
<div><font face="tahoma,sans-serif"># opensips standard modules<br># STANDARD_MODULES="standard acc lcr domain group permissions registrar usrloc <br># msilo alias_db uri_db speeddial avpops auth_db pdt dialog <br>
# dispatcher dialplan drouting nathelper load_balancer"</font></div>
<div><font face="tahoma,sans-serif"># opensips extra modules<br># EXTRA_MODULES="imc cpl siptrace domainpolicy carrierroute userblacklist b2b"</font></div>
<div><br><font face="tahoma,sans-serif">## type of aliases used: DB - database aliases; UL - usrloc aliases<br>## - default: none<br>ALIASES_TYPE="DB"</font></div>
<div><font face="tahoma,sans-serif">## control engine: FIFO or UNIXSOCK<br>## - default FIFO<br>CTLENGINE=FIFO</font></div>
<div><font face="tahoma,sans-serif">## path to FIFO file<br>OSIPS_FIFO="/tmp/opensips_fifo"</font></div>
<div><font face="tahoma,sans-serif">## MI_CONNECTOR control engine: FIFO, UNIXSOCK, UDP, XMLRPC<br># MI_CONNECTOR=FIFO:/tmp/opensips_fifo<br># MI_CONNECTOR=UNIXSOCK:/tmp/opensips.sock<br># MI_CONNECTOR=UDP:<a href="http://192.168.2.133:8000">192.168.2.133:8000</a><br>
# MI_CONNECTOR=XMLRPC:<a href="http://192.168.2.133:8000">192.168.2.133:8000</a></font></div>
<div><font face="tahoma,sans-serif">## check ACL names; default on (1); off (0)<br>VERIFY_ACL=1</font></div>
<div><font face="tahoma,sans-serif">## ACL names - if VERIFY_ACL is set, only the ACL names from below list<br>## are accepted<br>ACL_GROUPS="local ld int voicemail free-pstn"</font></div>
<div><font face="tahoma,sans-serif">## verbose - debug purposes - default '0'<br>#VERBOSE=1</font></div>
<div><font face="tahoma,sans-serif">## do (1) or don't (0) store plaintext passwords<br>## in the subscriber table - default '1'<br>STORE_PLAINTEXT_PW=1</font></div>
<div><font face="tahoma,sans-serif">## OPENSIPS START Options<br>## PID file path - default is: /var/run/opensips.pid<br># PID_FILE=/var/run/opensips.pid</font></div>
<div><font face="tahoma,sans-serif">## Extra start options - default is: not set<br># example: start opensips with 64MB share memory: STARTOPTIONS="-m 64"<br># STARTOPTIONS=<br></font></div>
<div><font face="tahoma,sans-serif">Thanks in advance!!!<br></font></div>
<div><font face="tahoma,sans-serif"><br></font></div>