<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I am trying to translate the config file on the link from openser to opensips 1.4, but I am having an issue registering users, it looks like there is a loop, but I don't know what am I doing wrong. I can make a call from a user account to PSTN thru asterisk; I mean:<br><br>user ----&gt;&gt; opensips ---&gt;&gt; asterisk ---&gt;&gt; PSTN , but when I try to register the user with opensips I get Registration error:483 Too Many Hops<br><br>This is my config:<br><br><br><br># ----------- global configuration parameters ------------------------<br>debug=3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # debug level (cmd line: -dddddddddd)<br>fork=yes<br>log_stderror=no&nbsp;&nbsp;&nbsp; # (cmd line: -E)<br>children=4<br>disable_tcp=yes<br>port=5060<br><br># ------------------ module loading ----------------------------------<br>#set module
 path<br>mpath="/usr/local/lib/opensips/modules/"<br><br>loadmodule "db_mysql.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 "uri.so"<br>loadmodule "uri_db.so"<br>loadmodule "domain.so"<br>loadmodule "permissions.so"<br>loadmodule "group.so"<br>loadmodule "mi_fifo.so"<br>loadmodule "xlog.so"<br>loadmodule "avpops.so"<br>loadmodule "lcr.so"<br><br># Uncomment this if you want digest authentication<br># mysql.so must be loaded !<br>loadmodule "auth.so"<br>loadmodule "auth_db.so"<br><br># ----------------- setting module-specific parameters ---------------<br><br>modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")<br>modparam("usrloc", "db_mode", 2)<br>modparam("auth_db", "calculate_ha1", yes)<br>modparam("auth_db", "password_column", "password")<br>modparam("rr", "enable_full_lr",
 1)<br>modparam("auth_db|permissions|uri_db|usrloc","db_url","mysql://opensips:opensipsrw@localhost/opensips")<br>modparam("permissions", "db_mode", 1)<br>modparam("permissions", "trusted_table", "trusted")<br>modparam("tm", "fr_timer",5)<br>modparam("tm", "fr_inv_timer_avp", "$avp(i:704)")<br>modparam("lcr","db_url","mysql://opensips:opensipsrw@localhost/opensips")<br>modparam("lcr","fr_inv_timer",90)<br>modparam("lcr","fr_inv_timer_next",30)<br>modparam("lcr", "fr_inv_timer_avp", "$avp(i:704)")<br>modparam("lcr", "gw_uri_avp", "$avp(i:709)")<br>modparam("lcr", "ruri_user_avp", "$avp(i:500)")<br>modparam("lcr", "contact_avp", "$avp(i:711)")<br>modparam("lcr", "rpid_avp", "$avp(i:302)")<br>modparam("lcr", "flags_avp", "$avp(i:712)")<br>#modparam("lcr", "dm_flag", 13)<br><br><br><br><br># -------------------------&nbsp; request routing logic -------------------<br><br><br><br># main routing logic<br>route{<br><br>&nbsp;&nbsp;&nbsp; # initial sanity checks
 -- messages with<br>&nbsp;&nbsp;&nbsp; # max_forwards==0, or excessively long requests<br>&nbsp;&nbsp;&nbsp; if (!mf_process_maxfwd_header("10")) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sl_send_reply("483","Too Many Hops");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp; };<br><br>&nbsp;&nbsp;&nbsp; if (msg:len &gt;=&nbsp; 2048 ) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sl_send_reply("513", "Message too big");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp; };<br><br>&nbsp;&nbsp;&nbsp; # we record-route all messages -- to make sure that<br>&nbsp;&nbsp;&nbsp; # subsequent messages will go through our proxy; that's<br>&nbsp;&nbsp;&nbsp; # particularly good if upstream and downstream entities<br>&nbsp;&nbsp;&nbsp; # use different transport protocol<br>&nbsp;&nbsp;&nbsp; if (!method=="REGISTER")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; record_route();<br><br>&nbsp;&nbsp;&nbsp; # subsequent messages withing a
 dialog should take the<br>&nbsp;&nbsp;&nbsp; # path determined by record-routing<br>&nbsp;&nbsp;&nbsp; if (loose_route()) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # mark routing logic in request<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; append_hf("P-hint: rr-enforced\r\n"); <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; route(1);<br>&nbsp;&nbsp;&nbsp; };<br><br>&nbsp;&nbsp;&nbsp; if (!uri==myself) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # mark routing logic in request<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; append_hf("P-hint: outbound\r\n"); <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; route(1);<br>&nbsp;&nbsp;&nbsp; };<br><br>&nbsp;&nbsp;&nbsp; if (uri==myself) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (is_method("INVITE")) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; append_hf("P-hint: lcr applied\r\n"); <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # applying lcr routing<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp; route(2);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; };<br>&nbsp;&nbsp;&nbsp; };<br><br>&nbsp;&nbsp;&nbsp; route(1);<br>}<br><br><br>route[1] {<br>&nbsp;&nbsp;&nbsp; # send it out now; use stateful forwarding as it works reliably<br>&nbsp;&nbsp;&nbsp; # even for UDP2TCP<br>&nbsp;&nbsp;&nbsp; if (!t_relay()) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sl_reply_error();<br>&nbsp;&nbsp;&nbsp; };<br>&nbsp;&nbsp;&nbsp; exit;<br>}<br><br>route[2] {<br>&nbsp;&nbsp;&nbsp; # load the gateways<br>&nbsp;&nbsp;&nbsp; if (!load_gws()) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sl_send_reply("503", "Unable to load gateways");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp; } else {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $var(i) = 0;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #while($(avp(i:709)[$var(i)]) != null) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while(is_avp_set("$(avp(i:709)[$var(i)])")) {<br>&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog("L_INFO", "loading gw_uri_avp[$var(i)]='$(avp(i:709)[$var(i)])'\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $var(i) = $var(i) + 1;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; };<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(is_avp_set("$avp(i:709)")) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog("L_INFO", "trying gateway '$avp(i:709)'\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } else {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog("L_INFO", "no available gateways ...\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; };<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # try the first matched gateway<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (next_gw()) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog("L_INFO", "ruri_user_avp='$avp(i:500)'\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # prepare for lcr
 failover<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; t_on_failure("2");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; route(1);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } else {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sl_send_reply("503", "No available gateways");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; };<br>&nbsp;&nbsp;&nbsp; };<br>&nbsp;&nbsp;&nbsp; exit;<br>}<br><br><br>failure_route[2] {<br>&nbsp;&nbsp;&nbsp; xlog("L_INFO", "entering failure_route[2] for reply code '$T_reply_code'\n");<br>&nbsp;&nbsp;&nbsp; # the previous gateway is no good<br>&nbsp;&nbsp;&nbsp; if (t_check_status("408|50[34]")) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(is_avp_set("$avp(i:709)")) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog("L_INFO", "trying next gateway '$avp(i:709)'\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } else
 {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog("L_INFO", "no more gateways to try ...\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; };<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # route to the next gateway<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (next_gw()) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # prepare for lcr failover<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; t_on_failure("2");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; route(1);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } else {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; t_reply("503", "No gateways");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; };<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp; };<br>}<br><br><br><br><br><br>--- On <b>Sun, 10/5/08, Darren Sessions <i>&lt;dmsessions@gmail.com&gt;</i></b>
 wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">From: Darren Sessions &lt;dmsessions@gmail.com&gt;<br>Subject: Re: [OpenSIPS-Users] Asterisk Load Balancing with OpenSIPS + dispatcher<br>To: "Ovidiu Sas" &lt;osas@voipembedded.com&gt;<br>Cc: users@lists.opensips.org<br>Date: Sunday, October 5, 2008, 2:38 AM<br><br><div id="yiv950371802">Excellent reference material Ovidiu! I'll be bookmarking your example myself.&nbsp;<div><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><div style=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size:
 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><div style=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><div style=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><div style=""><span
 class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><div style=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><div style=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px;
 text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><div><br></div><div>Cheers,</div><div>- Darren</div><div>_____________________________</div><div><br></div><div>Darren Sessions</div><div><a rel="nofollow" target="_blank" href="mailto:dmsessions@gmail.com">dmsessions@gmail.com</a></div><div><a rel="nofollow" target="_blank" href="http://www.darrensessions.com">http://www.darrensessions.com</a></div><div><font class="Apple-style-span" face="Arial"><span class="Apple-style-span" style="line-height: 14px; white-space: pre-wrap;">_____________________________</span></font></div><div><br></div></span></div></span></div></span></div></span></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"> </div><br><div><div>On Oct 4, 2008, at 8:32 PM, Ovidiu Sas wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hello
 John,<br><br>Here's a working example of an lcr implementation:<br><a rel="nofollow" target="_blank" href="http://voipembedded.com/resources/openser_dbtext_lcr.cfg">http://voipembedded.com/resources/openser_dbtext_lcr.cfg</a><br>This is for openser 1.3, but you should be able to port it to 1.4.<br>If I have time, I will post a dispatcher one too ...<br><br>Regards,<br>Ovidiu Sas<br><br>On Sat, Oct 4, 2008 at 9:53 PM, John D &lt;mnemonic81@gmail.com&gt; wrote:<br><blockquote type="cite">Hi Darren,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I'd like to use whichever works. I don't have a particular reason for using<br></blockquote><blockquote type="cite">dispatcher other than running across the module on Google. Are either<br></blockquote><blockquote type="cite">load_gw or dispatcher clever enough to use a SIP proxy that's available (aka<br></blockquote><blockquote type="cite">failover in case one node dies) and is it
 clever enough to know which SIP<br></blockquote><blockquote type="cite">proxy has less of a load than the other, or does it just round robin?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Thanks.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On Sat, Oct 4, 2008 at 9:48 PM, Darren Sessions &lt;dmsessions@gmail.com&gt;<br></blockquote><blockquote type="cite">wrote:<br></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">If you're just load balancing two Asterisk servers, why not use the<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">load_gw function?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote
 type="cite">_____________________________<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Darren Sessions<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">dmsessions@gmail.com<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">http://www.darrensessions.com<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">_____________________________<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">On Oct 4, 2008, at 7:41 PM, John D wrote:<br></blockquote></blockquote><blockquote type="cite"><blockquote
 type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">All,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I'm trying to find some half-decent documentation to get OpenSIPS working<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">with the dispatcher module for simply load balancing two Asterisk servers.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Most links on voip-info.org and even some on opensips.org appear dated or<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">404. I was hoping to try the mail list to see if anyone could kindly suggest<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">the best resource for currently setting up the above (and most
 importantly<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">how to work with the dispatcher module).<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Thanks!<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">_______________________________________________<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Users mailing list<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Users@lists.opensips.org<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">http://lists.opensips.org/cgi-bin/mailman/listinfo/users<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote
 type="cite"><blockquote type="cite">_______________________________________________<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Users mailing list<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Users@lists.opensips.org<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">http://lists.opensips.org/cgi-bin/mailman/listinfo/users<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">Users mailing list<br></blockquote><blockquote type="cite">Users@lists.opensips.org<br></blockquote><blockquote type="cite">http://lists.opensips.org/cgi-bin/mailman/listinfo/users<br></blockquote><blockquote type="cite"><br></blockquote><blockquote
 type="cite"><br></blockquote></div></blockquote></div><br></div></div><pre>_______________________________________________<br>Users mailing list<br>Users@lists.opensips.org<br>http://lists.opensips.org/cgi-bin/mailman/listinfo/users<br></pre></blockquote></td></tr></table><br>