[Users] Call forward when no answer

Howard Tang howard615 at gmail.com
Fri May 18 03:18:15 CEST 2007


HI All,

Problem is fixed by adding append_branch(); in the failure_route

failure_route[1] {
	if (t_was_cancelled()) {


		xdbg("transaction was cancelled by UAC\n");
		return;
	}
	 xlog("L_INFO", "failure_route - call forward to Voice Mail - M=$rm
RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
        # restore initial uri

	avp_pushto("$ruri", "i:10");
	prefix("1");
	# route to Asterisk Media Server

	rewritehostport("
10.10.10.11:5060");
	resetflag(2);
        append_branch();
	route(1);

}

Regards,
Howard

On 5/18/07, Howard Tang <howard615 at gmail.com> wrote:
>
> I have the same problem. It works fine if the forward happened in
>
> 	# native SIP destinations are handled using our USRLOC DB
> 		if (!lookup("location")) {
> 			if(isflagset(2)) {
>                                 xlog("L_INFO", "Callee is Offline, call forward to Voice Mail - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
>
> 				# route to Asterisk Media Server
> 				prefix("1");
> 				rewritehostport("10.10.10.11:5060
> ");
> 				route(1);
> 			} else {
> 				sl_send_reply("404", "Not Found");
>
> 				exit;
> 			}
>
> May 18 09:06:21 localhost /usr/sbin/openser[24410]: Callee is Offline,
> call forward to Voice Mail - M=INVITE RURI= sip:0280000000 at 10.10.1.2 F=
> sip:0299000000 at 10.10.1.2 T=sip:0280000000 at 10.10.1.2 IP= 10.10.1.1 ID=
> call-F11EC874-4CE7-2910-000A-3E6 at 10.10.1.1
>
> It is not working good in Failure_route
>
>
> failure_route[1] {
> 	if (t_was_cancelled()) {
>
>
> 		xdbg("transaction was cancelled by UAC\n");
> 		return;
> 	}
> 	 xlog("L_INFO", "failure_route - call forward to Voice Mail - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
>         # restore initial uri
>
> 	avp_pushto("$ruri", "i:10");
> 	prefix("1");
> 	# route to Asterisk Media Server
>
> 	rewritehostport("
> 10.10.10.11:5060");
> 	resetflag(2);
> 	route(1);
>
> }
>
>
>
> May 18 09:08:45 localhost /usr/sbin/openser[24414]: failure_route - call
> forward to Voice Mail - M=INVITE RURI=sip:0280000000 at 10.10.2.126:57042;rinstance=dbdab29df7aa260b
> F= sip:0299000000 at 10.10.1.2 T=sip:0280000000 at 10.10.1.2 IP=10.10.1.1 ID=call-F17BFBB3-4FE7-2910-000C-3E8 at 10.10.1.1
> May 18 09:08:59 localhost /usr/sbin/openser[24399]:
> ERROR:tm:t_forward_nonack: no branch for forwarding
> May 18 09:08:59 localhost /usr/sbin/openser[24399]: ERROR:tm:w_t_relay:
> t_forward_nonack failed
> May 18 09:09:09 localhost /usr/sbin/openser[24399]:
> ERROR:tm:t_forward_nonack: failure to add branches
>
> Anyone have an idea on where i have done wrong?
>
> Regards,
> Howard
>
>
> On 5/18/07, Bill Neely <ceo at xantek.cc> wrote:
> >
> > I am having a very similar problem. Using v1.2.0
> >
> > Here is my route:
> > route[1] {
> >
> > if(isflagset(2))
> >     t_on_failure("2");
> >
> >
> >     if (!t_relay()) {
> >         sl_reply_error();
> >     };
> >     exit;
> > }
> >
> > failure_route[2]
> > {
> >     if ( t_check_status("408"))
> >
> >     {
> >         xlog("L_ERR","rrreeeeeeeeeeeeeeeeeecalling froute2
> > <$rm><$ru>\n");
> >         avp_pushto("$ruri", "$avp(i:10)");
> >         prefix("777");
> >         # route to Asterisk Media Server
> >         rewritehostport("66.xxx.20.50:5060");
> >         resetflag(2);
> >
> >         xlog("L_ERR","22222222222222222222calling froute2
> > <$rm><$ruri>\n");
> >         route(1);
> >
> >
> >     }
> >     exit;
> > }
> >
> > Here is error message received:
> >
> > 1(53165) rrreeeeeeeeeeeeeeeeeecalling froute2
> > <INVITE><sip:1020101 at 67.188.xxx.188:35937;rinstance=e867c589f1896b12>
> > 1(53165) 22222222222222222222calling froute2
> > <INVITE><sip:7771020101 at 66.xxx.20.50:5060;rinstance=e867c589f1896b12>
> > 1(53165) ERROR:tm:t_forward_nonack: no branch for forwarding
> > 1(53165) ERROR:tm:w_t_relay: t_forward_nonack failed
> >
> > Bogdan-Andrei Iancu wrote:
> > > Check with log/xlog prints if it gets to t_on_failure() and  into
> > > failure route.
> > >
> > > regards,
> > > Bogdan
> > >
> > > Howard Tang wrote:
> > >> HI Bogdan,
> > >>
> > >> Thank you for your reply. I did that but i forget to include in this
> > >> email.
> > >>
> > >>
> > >> route[1] {
> > >>        #check for nat flag
> > >>        if (isflagset(2))
> > >>        {
> > >>                fix_nated_contact();
> > >>                use_media_proxy();
> > >>        }
> > >>
> > >>        t_on_reply("1");
> > >>        t_on_failure("1");
> > >>
> > >>        # send it out now; use stateful forwarding as it works
> > reliably
> > >>        # even for UDP2TCP
> > >>        xlog("L_INFO", "Request leaving server - M=$rm RURI=$ru F=$fu
> > >> T=$tu IP=$si ID=$ci\n");
> > >>        if (!t_relay()) {
> > >>                if(isflagset(2))
> > >>                        end_media_session();
> > >>                sl_reply_error();
> > >>        };
> > >>        exit;
> > >> }
> > >>
> > >> The voice mail work fine only when someone call in and the UA is
> > >> offline (not registered to the openser), if the UA is online, the
> > >> call will ring the UA until the caller hang up.
> > >>
> > >> I want to set up some sort of timer, i.e. 60 second and the call will
> > >> forwarded to the Voice mail.
> > >>
> > >> Can you suggest me an idea on how i can make this happen please?
> > >>
> > >> Regards,
> > >> Howard
> > >>
> > >>
> > >>
> > >> On 5/17/07, *Bogdan-Andrei Iancu* <bogdan at voice-system.ro
> > >> <mailto: bogdan at voice-system.ro>> wrote:
> > >>
> > >>     Hi Howard,
> > >>
> > >>     I guess you do not arm the failure route - use t_on_failure("1");
> >
> > >>     before
> > >>     relaying the request.
> > >>
> > >>     regards,
> > >>     bogdan
> > >>
> > >>     Howard Tang wrote:
> > >>     > Hi All,
> > >>     >
> > >>     > I have followed a tutorial and set up Asterisk as a voice mail
> > >>     server.
> > >>     >
> > >>     >
> > >>
> > >>
> > http://www.voip-info.org/wiki/view/Realtime+Integration+Of+Asterisk+With+OpenSER
> > >>
> > >>     >
> > >>
> > >> <http://www.voip-info.org/wiki/view/Realtime+Integration+Of+Asterisk+With+OpenSER
> > >>
> > >>
> > >> <http://www.voip-info.org/wiki/view/Realtime+Integration+Of+Asterisk+With+OpenSER
> > >>
> > >>
> > >>     >
> > >>     > It works fine when the UA is offline. Now, I want a call
> > >>     forwarded to
> > >>     > the Voice mail server when there is no answer from the UA after
> > 60
> > >>     > seconds(UA is registered on the openser).
> > >>     >
> > >>     > What should I do? Below is my config (copy from the above
> > link).
> > >>     >
> > >>     >
> > >>     >               # requests for Media server
> > >>     >               if(is_method("INVITE") && !has_totag() &&
> > >>     uri=~"sip:\*9") {
> > >>     >                       route(3);
> > >>     >                       exit;
> > >>     >               }
> > >>     >
> > >>     >               # mark transaction if user is in voicemail group
> > >>     >
> > >>     >               if(is_method("INVITE") && !has_totag()
> > >>     >                       && is_user_in("Request-URI","voicemail"))
> > >>     >               {
> > >>     >                       xdbg("user [$ru] has voicemail
> > redirection
> > >>     enabled\n");
> > >>     >
> > >>     >                       # backup R-URI
> > >>     >                       avp_write("$ruri", "i:10");
> > >>     >                       setflag(2);
> > >>     >               };
> > >>     >
> > >>     >               # native SIP destinations are handled using our
> > >>     USRLOC DB
> > >>     >               if (!lookup("location")) {
> > >>     >                       if(isflagset(2)) {
> > >>     >
> > >>     >                               # route to Asterisk Media Server
> > >>     >                               prefix("1");
> > >>     >                               rewritehostport("10.10.10.11:5060
> > >>     <http://10.10.10.11:5060> < http://10.10.10.11:5060>");
> > >>     >                               route(1);
> > >>     >                       } else {
> > >>     >                               sl_send_reply("404", "Not
> > Found");
> > >>     >
> > >>     >                               exit;
> > >>     >                       }
> > >>     >               };
> > >>     >
> > >>     > # voicemail access
> > >>     > # - *98 - listen caller's voice messages, being prompted for
> > pin
> > >>     > # - *981 - listen voice messages, being promted for mailbox and
> > >> pin
> > >>     > # - *98XXXX - leave voice message to XXXX
> > >>     >
> > >>     > #
> > >>     > route[3] {
> > >>     >       # direct voicemail
> > >>     >       if (uri =~ "sip:\*98@" ) {
> > >>     >               rewriteuser("1");
> > >>     >               xdbg("voicemail access\n");
> > >>     >       } else if (uri =~ "sip:\*981@" ) {
> > >>     >
> > >>     >               strip(4);
> > >>     >               rewriteuser("11");
> > >>     >       } else if (uri =~ "sip:\*98.+@" ) {
> > >>     >               strip(3);
> > >>     >               prefix("1");
> > >>     >       } else {
> > >>     >               xlog("unknown media extension $rU\n");
> > >>     >               sl_send_reply("404", "Unknown media service");
> > >>     >
> > >>     >               exit;
> > >>     >       }
> > >>     >
> > >>     >       # route to Asterisk Media Server
> > >>     >       rewritehostport("10.10.10.11:5060
> > >>     <http://10.10.10.11:5060> < http://10.10.10.11:5060>");
> > >>     >       route(1);
> > >>     > }
> > >>     >
> > >>     > failure_route[1] {
> > >>     >       if (t_was_cancelled()) {
> > >>     >
> > >>     >               xdbg("transaction was cancelled by UAC\n");
> > >>     >               return;
> > >>     >       }
> > >>     >       # restore initial uri
> > >>     >       avp_pushto("$ruri", "i:10");
> > >>     >       prefix("1");
> > >>     >       # route to Asterisk Media Server
> > >>     >
> > >>     >       rewritehostport("10.10.10.11:5060
> > >>     <http://10.10.10.11:5060> <http://10.10.10.11:5060>");
> > >>     >       resetflag(2);
> > >>     >       route(1);
> > >>     >
> > >>     > }
> > >>     >
> > >>     >
> > >>     >
> > >>
> > >>
> > ------------------------------------------------------------------------
> > >>     >
> > >>     > _______________________________________________
> > >>     > Users mailing list
> > >>     > Users at openser.org <mailto: Users at openser.org>
> > >>     > http://openser.org/cgi-bin/mailman/listinfo/users
> > >>     >
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> --
> > >> Howard Tang
> > >> ICQ : 259083
> > >> MSN : howard615 at hotmail.com <mailto: howard615 at hotmail.com>
> > >
> > >
> > > _______________________________________________
> > > Users mailing list
> > > Users at openser.org
> > > http://openser.org/cgi-bin/mailman/listinfo/users
> >
> > --
> > Bill Neely
> > Xantek, Inc.
> > 1-866-553-3833
> > 1-702-874-3833
> >
> >
>
>
> --
> Howard Tang
> ICQ : 259083
> MSN : howard615 at hotmail.com
>



-- 
Howard Tang
ICQ : 259083
MSN : howard615 at hotmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20070518/29aab46a/attachment.htm>


More information about the sr-users mailing list