<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 ---->> opensips --->> asterisk --->> 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 # debug level (cmd line: -dddddddddd)<br>fork=yes<br>log_stderror=no # (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># ------------------------- request routing logic -------------------<br><br><br><br># main routing logic<br>route{<br><br> # initial sanity checks
-- messages with<br> # max_forwards==0, or excessively long requests<br> if (!mf_process_maxfwd_header("10")) {<br> sl_send_reply("483","Too Many Hops");<br> exit;<br> };<br><br> if (msg:len >= 2048 ) {<br> sl_send_reply("513", "Message too big");<br> exit;<br> };<br><br> # we record-route all messages -- to make sure that<br> # subsequent messages will go through our proxy; that's<br> # particularly good if upstream and downstream entities<br> # use different transport protocol<br> if (!method=="REGISTER")<br> record_route();<br><br> # subsequent messages withing a
dialog should take the<br> # path determined by record-routing<br> if (loose_route()) {<br> # mark routing logic in request<br> append_hf("P-hint: rr-enforced\r\n"); <br> route(1);<br> };<br><br> if (!uri==myself) {<br> # mark routing logic in request<br> append_hf("P-hint: outbound\r\n"); <br> route(1);<br> };<br><br> if (uri==myself) {<br> if (is_method("INVITE")) {<br> append_hf("P-hint: lcr applied\r\n"); <br> # applying lcr routing<br>
route(2);<br> };<br> };<br><br> route(1);<br>}<br><br><br>route[1] {<br> # send it out now; use stateful forwarding as it works reliably<br> # even for UDP2TCP<br> if (!t_relay()) {<br> sl_reply_error();<br> };<br> exit;<br>}<br><br>route[2] {<br> # load the gateways<br> if (!load_gws()) {<br> sl_send_reply("503", "Unable to load gateways");<br> exit;<br> } else {<br> $var(i) = 0;<br> #while($(avp(i:709)[$var(i)]) != null) {<br> while(is_avp_set("$(avp(i:709)[$var(i)])")) {<br>
xlog("L_INFO", "loading gw_uri_avp[$var(i)]='$(avp(i:709)[$var(i)])'\n");<br> $var(i) = $var(i) + 1;<br> };<br> if(is_avp_set("$avp(i:709)")) {<br> xlog("L_INFO", "trying gateway '$avp(i:709)'\n");<br> } else {<br> xlog("L_INFO", "no available gateways ...\n");<br> };<br> # try the first matched gateway<br> if (next_gw()) {<br> xlog("L_INFO", "ruri_user_avp='$avp(i:500)'\n");<br> # prepare for lcr
failover<br> t_on_failure("2");<br> route(1);<br> } else {<br> sl_send_reply("503", "No available gateways");<br> exit;<br> };<br> };<br> exit;<br>}<br><br><br>failure_route[2] {<br> xlog("L_INFO", "entering failure_route[2] for reply code '$T_reply_code'\n");<br> # the previous gateway is no good<br> if (t_check_status("408|50[34]")) {<br> if(is_avp_set("$avp(i:709)")) {<br> xlog("L_INFO", "trying next gateway '$avp(i:709)'\n");<br> } else
{<br> xlog("L_INFO", "no more gateways to try ...\n");<br> };<br> # route to the next gateway<br> if (next_gw()) {<br> # prepare for lcr failover<br> t_on_failure("2");<br> route(1);<br> } else {<br> t_reply("503", "No gateways");<br> exit;<br> };<br> exit;<br> };<br>}<br><br><br><br><br><br>--- On <b>Sun, 10/5/08, Darren Sessions <i><dmsessions@gmail.com></i></b>
wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">From: Darren Sessions <dmsessions@gmail.com><br>Subject: Re: [OpenSIPS-Users] Asterisk Load Balancing with OpenSIPS + dispatcher<br>To: "Ovidiu Sas" <osas@voipembedded.com><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. <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 <mnemonic81@gmail.com> 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 <dmsessions@gmail.com><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>