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