<div>Hi Daniel,</div>  <div>Thanks for your response. My configuration was OK. My problem got solved after I removed the function consume_credentials() from route(3). After the forwarding, the&nbsp;openser used to ask for proxy authentication again. This was the problem.</div>  <div>I was also trying to implement forwarding if the user is not registered. My config seemed to be ok, but when I tried testing this feature, openser gives me a message saying:</div>  <div>513-message too big. Can someone please explain me what this means and how to rectify this problem.</div>  <div>&nbsp;</div>  <div>Thanks in advance</div>  <div>&nbsp;</div>  <div>w/regards,</div>  <div>jayesh..<BR><BR><B><I>Daniel-Constantin Mierla &lt;daniel@voice-system.ro&gt;</I></B> wrote:</div>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Hello,<BR><BR>have a look at<BR>http://www.voice-system.ro/docs/avpops/ar01s08.html#ex_serial_forking<BR><BR>the
 example is pretty similar with what you want to achieve.<BR><BR>Cheers,<BR>Daniel<BR><BR><BR>On 04/20/06 22:08, Jayesh Nambiar wrote:<BR>&gt; Hi all,<BR>&gt; I am trying to implement simple call forwarding in my script. The <BR>&gt; problem is when the call is forwarded to a another registered user and <BR>&gt; if the user is not in the location table, the message is correctly <BR>&gt; returned as "User Not Found".<BR>&gt; But if the user is present in the location table, the call does not <BR>&gt; get forwarded and invite comes to the same number again. This happens <BR>&gt; when the call is forwarded on no answer. I try to do serial forking <BR>&gt; using avp_pushto() but it does'nt seem to work.<BR>&gt; Can someone please help me out. The blind forwarding works perfectly.<BR>&gt; Here is my script:<BR>&gt;<BR>&gt; debug=3<BR>&gt; fork=yes<BR>&gt; log_stderror=no<BR>&gt; listen=202.XX.61.XX # INSERT YOUR IP ADDRESS HERE<BR>&gt; port=5060<BR>&gt; children=4<BR>&gt;
 dns=no<BR>&gt; rev_dns=no<BR>&gt; fifo="/tmp/openser_fifo"<BR>&gt; fifo_db_url="mysql://openser:openserrw@localhost/openser"<BR>&gt; loadmodule "/usr/local/lib/openser/modules/mysql.so"<BR>&gt; loadmodule "/usr/local/lib/openser/modules/sl.so"<BR>&gt; loadmodule "/usr/local/lib/openser/modules/tm.so"<BR>&gt; loadmodule "/usr/local/lib/openser/modules/rr.so"<BR>&gt; loadmodule "/usr/local/lib/openser/modules/maxfwd.so"<BR>&gt; loadmodule "/usr/local/lib/openser/modules/usrloc.so"<BR>&gt; loadmodule "/usr/local/lib/openser/modules/registrar.so"<BR>&gt; loadmodule "/usr/local/lib/openser/modules/auth.so"<BR>&gt; loadmodule "/usr/local/lib/openser/modules/auth_db.so"<BR>&gt; loadmodule "/usr/local/lib/openser/modules/uri.so"<BR>&gt; loadmodule "/usr/local/lib/openser/modules/uri_db.so"<BR>&gt; loadmodule "/usr/local/lib/openser/modules/mediaproxy.so"<BR>&gt; loadmodule "/usr/local/lib/openser/modules/nathelper.so"<BR>&gt; loadmodule
 "/usr/local/lib/openser/modules/textops.so"<BR>&gt; loadmodule "/usr/local/lib/openser/modules/avpops.so"<BR>&gt; loadmodule "/usr/local/lib/openser/modules/domain.so"<BR>&gt; loadmodule "/usr/local/lib/openser/modules/permissions.so"<BR>&gt; modparam("auth_db|permissions|uri_db|usrloc",<BR>&gt; "db_url", "mysql://openser:openserrw@localhost/openser")<BR>&gt; modparam("auth_db", "calculate_ha1", 1)<BR>&gt; modparam("auth_db", "password_column", "password")<BR>&gt; modparam("nathelper", "rtpproxy_disable", 1)<BR>&gt; modparam("nathelper", "natping_interval", 0)<BR>&gt; modparam("mediaproxy","natping_interval", 30)<BR>&gt; modparam("mediaproxy","mediaproxy_socket", "/var/run/mediaproxy.sock")<BR>&gt; modparam("mediaproxy","sip_asymmetrics","/usr/local/etc/ser/sip-clients")<BR>&gt; modparam("mediaproxy","rtp_asymmetrics","/usr/local/etc/ser/rtp-clients")<BR>&gt; modparam("usrloc", "db_mode", 2)<BR>&gt; modparam("usrloc", "use_domain", 1)<BR>&gt; modparam("registrar",
 "nat_flag", 6)<BR>&gt; modparam("registrar", "use_domain", 1)<BR>&gt; modparam("rr", "enable_full_lr", 1)<BR>&gt; modparam("tm", "fr_inv_timer", 27)<BR>&gt; modparam("tm", "fr_inv_timer_avp", "inv_timeout")<BR>&gt; modparam("permissions", "db_mode", 1)<BR>&gt; modparam("permissions", "trusted_table", "trusted")<BR>&gt; modparam("avpops", "avp_url", <BR>&gt; "mysql://openser:openserrw@localhost/openser")<BR>&gt; modparam("avpops", "avp_table", "usr_preferences")<BR>&gt; route {<BR>&gt; # -----------------------------------------------------------------<BR>&gt; # Sanity Check Section<BR>&gt; # -----------------------------------------------------------------<BR>&gt; if (!mf_process_maxfwd_header("10")) {<BR>&gt; sl_send_reply("483", "Too Many Hops");<BR>&gt; return;<BR>&gt; };<BR>&gt; if (msg:len &gt; max_len) {<BR>&gt; sl_send_reply("513", "Message Overflow");<BR>&gt; return;<BR>&gt; };<BR>&gt; # -----------------------------------------------------------------<BR>&gt; #
 Record Route Section<BR>&gt; # -----------------------------------------------------------------<BR>&gt; if (method=="INVITE" &amp;&amp; client_nat_test("3")) {<BR>&gt; # INSERT YOUR IP ADDRESS HERE<BR>&gt; record_route_preset("202.XX.61.XX:5060;nat=yes");<BR>&gt; } else if (method!="REGISTER") { <BR>&gt; record_route(); <BR>&gt; };<BR>&gt; # -----------------------------------------------------------------<BR>&gt; # Call Tear Down Section<BR>&gt; # -----------------------------------------------------------------<BR>&gt; if (method=="BYE" || method=="CANCEL") {<BR>&gt; end_media_session();<BR>&gt; };<BR>&gt; # -----------------------------------------------------------------<BR>&gt; # Loose Route Section<BR>&gt; # -----------------------------------------------------------------<BR>&gt; if (loose_route()) {<BR>&gt; if (has_totag() &amp;&amp; (method=="INVITE" || method=="ACK")) {<BR>&gt; if (client_nat_test("3")||search("^Route:.*;nat=yes")){<BR>&gt; setflag(6);<BR>&gt;
 use_media_proxy();<BR>&gt; };<BR>&gt; };<BR>&gt; route(1);<BR>&gt; return;<BR>&gt; };<BR>&gt; # -----------------------------------------------------------------<BR>&gt; # Call Type Processing Section<BR>&gt; # -----------------------------------------------------------------<BR>&gt; if (!is_uri_host_local()) {<BR>&gt; if (is_from_local() || allow_trusted()) {<BR>&gt; route(4);<BR>&gt; route(1);<BR>&gt; } else {<BR>&gt; sl_send_reply("403", "Forbidden");<BR>&gt; };<BR>&gt; return;<BR>&gt; };<BR>&gt; if (method=="CANCEL") {<BR>&gt; route(1);<BR>&gt; return;<BR>&gt; } else if (method=="INVITE") {<BR>&gt; route(3);<BR>&gt; return;<BR>&gt; } else if (method=="REGISTER") {<BR>&gt; route(2);<BR>&gt; return;<BR>&gt; };<BR>&gt; lookup("aliases");<BR>&gt; if (uri!=myself) {<BR>&gt; route(4);<BR>&gt; route(1);<BR>&gt; return;<BR>&gt; };<BR>&gt; if (!lookup("location")) {<BR>&gt; sl_send_reply("404", "User Not Found");<BR>&gt; return;<BR>&gt; };<BR>&gt; route(1);<BR>&gt; }<BR>&gt;
 route[1] {<BR>&gt; # -----------------------------------------------------------------<BR>&gt; # Default Message Handler<BR>&gt; # -----------------------------------------------------------------<BR>&gt; t_on_reply("1");<BR>&gt; if (!t_relay()) {<BR>&gt; if (method=="INVITE" || method=="ACK") {<BR>&gt; end_media_session();<BR>&gt; };<BR>&gt; sl_reply_error();<BR>&gt; };<BR>&gt; }<BR>&gt; route[2] {<BR>&gt; # -----------------------------------------------------------------<BR>&gt; # REGISTER Message Handler<BR>&gt; # -----------------------------------------------------------------<BR>&gt; sl_send_reply("100", "Trying");<BR>&gt; if (!search("^Contact:[ ]*\*") &amp;&amp; client_nat_test("7")) {<BR>&gt; setflag(6);<BR>&gt; fix_nated_register();<BR>&gt; force_rport();<BR>&gt; };<BR>&gt; if (!www_authorize("","subscriber")) {<BR>&gt; www_challenge("","0");<BR>&gt; return;<BR>&gt; };<BR>&gt; if (!check_to()) {<BR>&gt; sl_send_reply("401", "Unauthorized");<BR>&gt;
 return;<BR>&gt; };<BR>&gt; consume_credentials();<BR>&gt; if (!save("location")) {<BR>&gt; sl_reply_error();<BR>&gt; };<BR>&gt; }<BR>&gt; route[3] {<BR>&gt; # -----------------------------------------------------------------<BR>&gt; # INVITE Message Handler<BR>&gt; # -----------------------------------------------------------------<BR>&gt; if (!allow_trusted()) {<BR>&gt; if (!proxy_authorize("","subscriber")) {<BR>&gt; proxy_challenge("","0");<BR>&gt; return;<BR>&gt; } else if (!check_from()) {<BR>&gt; sl_send_reply("403", "Use From=ID");<BR>&gt; return;<BR>&gt; };<BR>&gt; consume_credentials();<BR>&gt; };<BR>&gt; if (client_nat_test("3")) {<BR>&gt; setflag(7);<BR>&gt; force_rport();<BR>&gt; fix_nated_contact();<BR>&gt; };<BR>&gt; if (uri=~"^sip:1[0-9]{10}@") {<BR>&gt; strip(1);<BR>&gt; };<BR>&gt; lookup("aliases");<BR>&gt; if (uri!=myself) {<BR>&gt; route(4);<BR>&gt; route(1);<BR>&gt; return;<BR>&gt; };<BR>&gt; if (uri=~"^sip:011[0-9]*@") {<BR>&gt; route(4);<BR>&gt;
 route(5);<BR>&gt; return;<BR>&gt; };<BR>&gt; if (avp_db_load("$ruri/username", "$avp(s:callfwd)")) {<BR>&gt; setflag(22);<BR>&gt; avp_pushto("$ruri", "$avp(s:callfwd)");<BR>&gt; route(6);<BR>&gt; return;<BR>&gt; };<BR>&gt; if (!lookup("location")) {<BR>&gt; /*if (uri=~"^sip:[0-9]{10}@") {<BR>&gt; route(4);<BR>&gt; route(5);<BR>&gt; return;<BR>&gt; };*/<BR>&gt; sl_send_reply("404", "User Not Found");<BR>&gt; return;<BR>&gt; };<BR>&gt; if (avp_db_load("$ruri/username", "$avp(s:fwdbusy)")) {<BR>&gt; if (!avp_check("$avp(s:fwdbusy)", "eq/$ruri/i")) {<BR>&gt; setflag(26);<BR>&gt; };<BR>&gt; };<BR>&gt; if (avp_db_load("$ruri/username", "$avp(s:fwdnoanswer)")) {<BR>&gt; if (!avp_check("$avp(s:fwdnoanswer)", "eq/$ruri/i")) {<BR>&gt; setflag(27);<BR>&gt; };<BR>&gt; };<BR>&gt; t_on_failure("1");<BR>&gt; route(4);<BR>&gt; route(1);<BR>&gt; }<BR>&gt; route[4] {<BR>&gt; # -----------------------------------------------------------------<BR>&gt; # NAT Traversal Section<BR>&gt; #
 -----------------------------------------------------------------<BR>&gt; if (isflagset(6) || isflagset(7)) {<BR>&gt; if (!isflagset(8)) {<BR>&gt; setflag(8);<BR>&gt; use_media_proxy();<BR>&gt; };<BR>&gt; };<BR>&gt; }<BR>&gt; route[5] {<BR>&gt; # -----------------------------------------------------------------<BR>&gt; # PSTN Handler<BR>&gt; # -----------------------------------------------------------------<BR>&gt; rewritehost("216.168.162.97"); # INSERT YOUR PSTN GATEWAY IP ADDRESS<BR>&gt; avp_write("i:45", "$avp(s:inv_timeout)");<BR>&gt; t_on_failure("1");<BR>&gt; route(4);<BR>&gt; route(1);<BR>&gt; }<BR>&gt; route[6] {<BR>&gt; # <BR>&gt; ------------------------------------------------------------------------<BR>&gt; # Call Forwarding Reply Route Handler<BR>&gt; #<BR>&gt; # This must be done as a route block because sl_send_reply() cannot be<BR>&gt; # called from the failure_route block<BR>&gt; # <BR>&gt;
 ------------------------------------------------------------------------<BR>&gt; if (uri=~"^sip:1[0-9]{10}@") {<BR>&gt; strip(1);<BR>&gt; };<BR>&gt; lookup("aliases");<BR>&gt; if (!isflagset(22)) {<BR>&gt; append_branch();<BR>&gt; };<BR>&gt; <BR>&gt; if (uri!=myself) {<BR>&gt; route(4);<BR>&gt; route(1);<BR>&gt; return;<BR>&gt; };<BR>&gt; if (uri=~"^sip:011[0-9]*@") {<BR>&gt; route(4);<BR>&gt; route(5);<BR>&gt; return;<BR>&gt; };<BR>&gt; if (!lookup("location")) {<BR>&gt; /*if (uri=~"^sip:[0-9]{10}@") {<BR>&gt; route(4);<BR>&gt; route(1);<BR>&gt; return;<BR>&gt; };*/<BR>&gt; sl_send_reply("404", "User Not Found");<BR>&gt; return;<BR>&gt; };<BR>&gt; route(4);<BR>&gt; route(1);<BR>&gt; }<BR>&gt; onreply_route[1] {<BR>&gt; if ((isflagset(6) || isflagset(7)) &amp;&amp;<BR>&gt; (status=~"(180)|(183)|2[0-9][0-9]")) {<BR>&gt; if (!search("^Content-Length:[ ]*0")) {<BR>&gt; use_media_proxy();<BR>&gt; };<BR>&gt; };<BR>&gt; if (client_nat_test("1")) {<BR>&gt;
 fix_nated_contact();<BR>&gt; };<BR>&gt; }<BR>&gt; failure_route[1] {<BR>&gt; if (t_check_status("487")) {<BR>&gt; return;<BR>&gt; };<BR>&gt; if (isflagset(26) &amp;&amp; t_check_status("486")) {<BR>&gt; if (avp_pushto("$ruri", "$avp(s:fwdbusy)")) {<BR>&gt; avp_delete("$avp(s:fwdbusy)");<BR>&gt; resetflag(26);<BR>&gt; route(6);<BR>&gt; return;<BR>&gt; };<BR>&gt; };<BR>&gt; if (isflagset(27) &amp;&amp; t_check_status("408")) {<BR>&gt; if (avp_pushto("$ruri", "$avp(s:fwdnoanswer)")) {<BR>&gt; avp_delete("$avp(s:fwdnoanswer)");<BR>&gt; resetflag(27);<BR>&gt; route(6);<BR>&gt; return;<BR>&gt; };<BR>&gt; };<BR>&gt; end_media_session();<BR>&gt; }<BR>&gt; <BR>&gt;<BR>&gt; ------------------------------------------------------------------------<BR>&gt; Jiyo cricket on Yahoo! India cricket <BR>&gt; <HTTP: cricket in.sports.yahoo.com *http: mailcricket in mail us.rd.yahoo.com /><BR>&gt; Yahoo! Messenger Mobile <BR>&gt; <HTTP: *http: in mail us.rd.yahoo.com messenger new
 in.mobile.yahoo.com mailmobilemessenger /><BR>&gt; Stay in touch with your buddies all the time.<BR>&gt; ------------------------------------------------------------------------<BR>&gt;<BR>&gt; _______________________________________________<BR>&gt; Users mailing list<BR>&gt; Users@openser.org<BR>&gt; http://openser.org/cgi-bin/mailman/listinfo/users<BR>&gt; <BR></BLOCKQUOTE><BR><p>
        

        
                <hr size=1> 
Jiyo cricket on <a href="http://us.rd.yahoo.com/mail/in/mailcricket/*http://in.sports.yahoo.com/cricket/">Yahoo! India cricket</a><br>
<a href="http://us.rd.yahoo.com/mail/in/mailmobilemessenger/*http://in.mobile.yahoo.com/new/messenger/">Yahoo! Messenger Mobile</a> Stay in touch with your buddies all the time.