<div><font face="arial,sans-serif">Or rather (as you've pointed out yourself), from </font></div>
<div><font face="arial,sans-serif"> </font></div>
<div><font face="arial,sans-serif"><em>## ANYTHING ADDED BELOW CAUSE OPENSER TO CRASH ???####<br><br>route[5] {<br> rewritehostport("</em></font><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://10.10.10.10:5060/" target="_blank">
<font face="arial,sans-serif"><em>10.10.10.10:5060 </em></font></a><font face="arial,sans-serif"><em>");<br></em></font>
<div style="DIRECTION: ltr"><span><font face="arial,sans-serif"><em> t_on_failure("1");<br> route(1);<br> exit;<br>}</em></font></span></div></div>
<div><br><font face="arial,sans-serif">If you follow the logic, looks to me like it's 'exit-ting' twice. First call jumps to route[5], then within route[5] you've also callled the <font color="#550055"><strong>
route[1]</strong> </font><font color="#000000">sub-routine - which also contains an 'exit', so from within <strong>route[1]</strong> it never returns to <strong>route[5]</strong> as you've intended.</font></font>
</div>
<div><font face="arial,sans-serif"></font> </div>
<div><br> </div>
<div><span class="gmail_quote">On 05/01/2008, <b class="gmail_sendername">Max Gregorian</b> <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:gregorian442@googlemail.com" target="_blank">gregorian442@googlemail.com
</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>As per the logs, the error is in the syntax. It mentions missing brackets somewhere.</div>
<div> </div>
<div>Starts from where it says</div>
<div>".. 0(9514) parse error (129,6-7): syntax error<span><br> 0(9514) parse error (129,6-7): missing '(' or ')' ?<br> 0(9514) parse error (129,6-7): bad command: missing ';'?<br> 0(9514) parse error (129,7-8): bad command (!!!attention: from
<br>v1.0.0+ use 'return' instead of 'break'!!!)"</span></div>
<div> </div>
<div>Do as it says - also in 1.1.1 'exit' was replaced by 'break' in some sections - see changelog. I have had this before.</div>
<div> </div>
<div>If I was you, I would go there (really useful tip:- it gives you the line number/s where the errors occured). Go to the first error and debug downwards from there. You'd find it's probably the 'exit' in the first route function.
</div><span>
<div> </div>
<div>Where it says:</div>
<div> </div>
<div><font color="#550055">if (!lookup("location")) {<br> route(5);<br>exit;<br> </font></div>
<div style="DIRECTION: ltr">};</div>
<p> </p></span>
<div><span>
<p><span class="gmail_quote">On 27/12/2007, <b class="gmail_sendername">Lazer Ramm</b> <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:vchouse@gmail.com" target="_blank">vchouse@gmail.com</a>> wrote:
</span></p>
<div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi,<br><br>thanx for taking the time to answer my question.<br><br>when i try to run openser i get the following errors . how do i debug
<br>them ? this is my first time using version 1.1.x<br><br>[root@IPX100 openser]# openser -f openser.cfg<br>0(9514) loading module /usr/lib/openser/modules/sl.so<br>0(9514) loading module /usr/lib/openser/modules/tm.so<br>
0(9514) loading module /usr/lib/openser/modules/rr.so<br>0(9514) loading module /usr/lib/openser/modules/maxfwd.so<br>0(9514) loading module /usr/lib/openser/modules/usrloc.so<br>0(9514) loading module /usr/lib/openser/modules/registrar.so
<br>0(9514) loading module /usr/lib/openser/modules/textops.so<br>0(9514) loading module /usr/lib/openser/modules/uac_redirect.so<br>0(9514) set_mod_param_regex: usrloc matches module usrloc<br>0(9514) set_mod_param_regex: found <db_mode> in module usrloc
<br>[/usr/lib/openser/modules/usrloc.so]<br>0(9514) set_mod_param_regex: rr matches module rr<br>0(9514) set_mod_param_regex: found <enable_full_lr> in module rr<br>[/usr/lib/openser/modules/rr.so]<br>0(9514) find_cmd_export_t: found <mf_process_maxfwd_header>(1) in
<br>module maxfwd [/usr/lib/openser/modules/maxfwd.so]<br>0(9514) find_cmd_export_t: found <sl_send_reply>(2) in module sl<br>[/usr/lib/openser/modules/sl.so]<br>0(9514) find_cmd_export_t: found <sl_send_reply>(2) in module sl
<br>[/usr/lib/openser/modules/sl.so]<br>0(9514) find_cmd_export_t: found <record_route>(0) in module rr<br>[/usr/lib/openser/modules/rr.so]<br>0(9514) find_cmd_export_t: found <loose_route>(0) in module rr<br>
[/usr/lib/openser/modules/rr.so]<br>0(9514) find_cmd_export_t: found <append_hf>(1) in module textops<br>[/usr/lib/openser/modules/textops.so]<br>0(9514) find_cmd_export_t: found <save>(1) in module registrar<br>
[/usr/lib/openser/modules/registrar.so]<br>0(9514) find_cmd_export_t: found <lookup>(1) in module registrar<br>[/usr/lib/openser/modules/registrar.so]<br>0(9514) parse error (129,6-7): syntax error<br>0(9514) parse error (129,6-7): missing '(' or ')' ?
<br>0(9514) parse error (129,6-7): bad command: missing ';'?<br>0(9514) parse error (129,7-8): bad command (!!!attention: from<br>v1.0.0+ use 'return' instead of 'break'!!!)<br>0(9514) parse error (129,8-9): bad command (!!!attention: from
<br>v1.0.0+ use 'return' instead of 'break'!!!)<br>0(9514) parse error (129,10-11): bad command (!!!attention: from<br>v1.0.0+ use 'return' instead of 'break'!!!)<br>0(9514) find_cmd_export_t: found <t_on_failure>(1) in module tm
<br>[/usr/lib/openser/modules/tm.so]<br>0(9514) find_cmd_export_t: found <t_relay>(0) in module tm<br>[/usr/lib/openser/modules/tm.so]<br>0(9514) find_cmd_export_t: found <sl_reply_error>(0) in module sl<br>[/usr/lib/openser/modules/sl.so]
<br>0(9514) find_cmd_export_t: found <t_check_status>(1) in module tm<br>[/usr/lib/openser/modules/tm.so]<br>0(9514) find_cmd_export_t: found <t_relay>(0) in module tm<br>[/usr/lib/openser/modules/tm.so]<br>0(9514) find_cmd_export_t: found <get_redirects>(1) in module
<br>uac_redirect [/usr/lib/openser/modules/uac_redirect.so]<br>0(9514) find_cmd_export_t: found <t_relay>(0) in module tm<br>[/usr/lib/openser/modules/tm.so]<br>0(9514) parse error (157,1-2): syntax error<br>0(9514) parse error (157,1-2):
<br>ERROR: bad config file (8 errors)<br>0(9514) DEBUG: tm_shutdown : start<br>0(9514) DEBUG: tm_shutdown : emptying hash table<br>0(9514) DEBUG: tm_shutdown : releasing timers<br>0(9514) DEBUG: tm_shutdown : removing semaphores
<br>0(9514) DEBUG: tm_shutdown : destroying tmcb lists<br>0(9514) DEBUG: tm_shutdown : done<br>0(9514) shm_mem_destroy<br><br><br><br><br># ------------------------- request routing logic -------------------<br><br># main routing logic
<br><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><br> if (method=="REGISTER") {<br> save("location");
<br> exit;<br><br> };<br>#this closes the if uri ==<br>}<br><br>if (!lookup("location")) {<br> route(5);<br>exit;<br>};<br><br>## ANYTHING ADDED BELOW CAUSE OPENSER TO CRASH ???####
<br><br>route[5] {<br> rewritehostport("<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://10.10.10.10:5060/" target="_blank">10.10.10.10:5060</a>");<br> t_on_failure("1");
<br> route(1);<br> exit;<br>}<br><br>route[1] {<br> if (!t_relay()) { <br> sl_reply_error();<br> };<br> exit;<br>}<br><br>failure_route[1] {<br> if (t_check_status("404")) {
<br> rewritehostport("<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://192.168.10.1:5060/" target="_blank"> 192.168.10.1:5060</a>");<br> append_branch();<br> t_relay();
<br> } else {<br> get_redirects("*");<br> t_relay();<br> }<br>}<br><br><br><br>#this closes the route<br>}<br><br><br><br><br><br><br><br>On Dec 27, 2007 12:14 PM, Jesus Rodriguez <
<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:jesusr@voztele.com" target="_blank">jesusr@voztele.com</a>> wrote:<br>><br>> Hi Lazer,<br>><br>> >i need a simple config that achieves the following (w/ out a db)
<br>> ><br>> >if a user is not registered then all calls should go to a default gw<br>> ><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://192.168.10.1/" target="_blank">192.168.10.1
</a><br>> ><br>> >the default gw will only respond w/ a 302 or a 404 <br>> ><br>> >if a 302 is received then openser should forward the call on to the<br>> >new gw listed in the reply<br>
> ><br>> >if a 404 is received the call should be forwarded to a different gw <br>> <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://172.16.20.1/" target="_blank">172.16.20.1</a><br>
> ><br>> >if the send gw is done then the call should die.<br>><br>><br>> Try with somehting like this (not tested):<br>><br>> if (!lookup("location")) { <br>> route(5);<br>
> exit;<br>> }<br>><br>> route[5] {<br>> rewritehostport("<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://192.168.10.1:5060/" target="_blank">192.168.10.1:5060</a>
");<br>> t_on_failure("1"); <br>> route(1);<br>> exit;<br>> }<br>><br>> route[1] {<br>> if (!t_relay()) {<br>> sl_reply_error();<br>> };
<br>> exit;<br>> }<br>><br>> failure_route[1] {<br>> if (t_check_status("404")) {<br>> rewritehostport("<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://172.16.20.1:5060/" target="_blank">
172.16.20.1:5060</a>");<br>> append_branch(); <br>> t_relay();<br>> } else {<br>> get_redirects("*");<br>> t_relay();<br>
> }<br>> }<br>><br>><br>> Saludos<br>> JesusR. <br>><br>><br>><br>><br>> >here is what i was thinking of but as a newbie i may be off my rocker<br>> >i seem to get an error
<br>> ><br>> > ERROR: t_check_status: cannot check status for a reply which has no <br>> >T-state established<br>> ><br>> >but again my whole approach may be wrong.<br>> ><br>> >
<br>> > if (!lookup("location")) {<br>> ><br>> >rewritehostport (" <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://192.168.10.1:5060/" target="_blank">
192.168.10.1:5060</a>");<br>> >if (t_check_status("(404)|(480)")) {<br>> > log("404 or 480 negative reply\n");<br>> >rewritehostport (" <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://172.16.20.1:5060/" target="_blank">
172.16.20.1:5060</a>");<br>> >}<br>> >else{<br>> >t_on_failure("1");<br>> > t_relay();<br>> >}<br>> ><br>> ><br>> > failure_route[1] {
<br>> ><br>> > get_redirects("*");<br>> > t_relay();<br>> >}<br>> > }<br>><br>><br>><br>><br>> Saludos
<br>> JesusR.<br>><br>> ------------------------------------<br>> Jesus Rodriguez<br>> VozTelecom Sistemas, S.L.<br>> <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:jesusr@voztele.com" target="_blank">
jesusr@voztele.com</a><br>> <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.voztele.com/" target="_blank">http://www.voztele.com</a><br>> Tel. 902360305<br>> -------------------------------------
<br>><br>><br>><br>><br>><br><br>_______________________________________________<br>Users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Users@lists.openser.org" target="_blank">
Users@lists.openser.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.openser.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser.org/cgi-bin/mailman/listinfo/users
</a><br></blockquote></div><br></span></div></blockquote></div><br>