Dear Paul:
It seems the URI error on my failure_route[1] to route[6].
I force to rewriteuser("0939749xxx") before failure_route[1] to route[6], the call will forward to my mobile phone(although only one way voice).
I store my forward number at some UA id's "fwdbusy" attribute and value is "sip:0939749xxx@ser.xxx.net.tw" in usr_preferences table. Using avp_write? How to implement it, please?
How can I change it to a dialed number?
Best Regard Charles
the snippet of ser.cfg: ------------------------------------------------------------------------------------------------------ failure_route[1] { log(1, "SER: Failure Route section failure_route(1)\n");
# if caller hung up then don't sent to voicemail if (t_check_status("487")) { break; }; if (isflagset(26) && t_check_status("486")) { # forward busy is flag 26 if (avp_pushto("$ruri", "s:fwdbusy")) { log(1, "SER: fork to fwdbusy\n"); avp_delete("s:fwdbusy"); append_branch(); resetflag(26); # test for domestic PSTN gateway if (uri=~"^sip:0[0-9]{9}@") { # if (avp_check("$fwd_busy_type", "eq/dom/i")) { # test for domestic PSTN gateway log(1, "SER: Busy Failure and Jump to route(6)\n"); route(6); } else if (uri=~"^sip:002[1-9][0-9]*@") { # } else if (avp_check("$fwd_busy_type", "eq/int/i")) { # test for international PSTN gateway log(1, "SER: Busy Failure and Jump to route(3)\n"); route(3); } else { # default to sip call log(1, "SER: Busy Failure and Jump to route(2)\n"); route(2); }; break; }; };
# here we can have either voicemail __OR__ forward no answer if (isflagset(27) && t_check_status("408")) { # forward no answer is flag 27 if (avp_db_load("$ruri/username", "s:fwdnoanswer")) { avp_pushto("$ruri", "s:fwdnoanswer"); log(1, "SER: fork to fwdnoanswer\n"); avp_delete("s:fwdnoanswer"); append_branch(); resetflag(27); if (uri=~"^sip:0[0-9]{9}@") { # if (avp_check("$fwd_no_answer_type", "eq/dom/i")) { # test for domestic PSTN gateway log(1, "SER: No Answer Failure and Jump to route(3)\n"); route(3); } else if (uri=~"^sip:002[1-9][0-9]*@") { # } else if (avp_check("$fwd_no_answer_type", "eq/int/i")) { # test for international PSTN gateway log(1, "SER: No Answer Failure and Jump to route(6)\n"); rewriteuser("0939749xxx"); <=== FORCE REWRITE HERE route(6); } else { # default to sip call log(1, "SER: No Answer Failure and Jump to route(2)\n"); route(2); }; break; }; } else if (isflagset(31) && avp_pushto("$ruri", "$voicemail")) { avp_delete("$voicemail"); log(1, "SER: No Answer Failure and Jump to route(4)\n"); route(4); break; }; }