[OpenSER-Devel] Why "sl_send_reply()" allow psudo-variables and "t_relay()" doesn't?

Iñaki Baz Castillo ibc at in.ilimit.es
Thu May 29 17:16:13 CEST 2008


El Thursday 29 May 2008 16:58:09 Bogdan-Andrei Iancu escribió:
> :) - if you need this, add a feature request and assigned it to me - it
>
> is a simple change for it...

Thanks a lot Bogdan, request done:
  
https://sourceforge.net/tracker/index.php?func=detail&aid=1977936&group_id=139143&atid=743023

I explain why I need it:

I do a failure_route adding a branch to a media server (SEMS) to reproduce 
some early messages ("the number you are calling is busy"...).
In the request to SEMS I tell him which final code to return after the 183.

But if SEMS is unavailble them I must do a "t_relay" keeping the *real* final 
code sent by the called (that is in fact the real cause of called user 
unavailability).

This is: the caller doesn't care if SEMS failed to reproduce the early media 
so it shouldn't get the "408 Timeout" but the initial "486 Busy" sent by the 
called.


For now I must do it manually:

-------------------------------------
failure_route[ON_FAILURE_TO_MEDIA_SERVER] {

	if ! isflagset(FLAG_SEMS_REPLIED) {
		xlog("L_ERROR","$C(sr)ERROR: No reply from SEMS$C(xx)\n");
		route(ROUTE_CREATE_REPLY);
	}
	
	end_media_session();
}

route[ROUTE_CREATE_REPLY] {

	switch($rU) {
		case "user_not_available":
			t_reply("480","Number Not Available Now");
			break;
		case "user_busy":
			t_reply("486","Busy Here");
			break;
		case "number_doesnt_exist":
			t_reply("404","Number Doesn't Exist Here");
			break;
		case "service_unavailable":
			t_reply("503","Service Unavailable Now");
			break;
	}

}
---------------------------------------------


Note that since I already had reply code and reason stored in an AVP I could 
do:

route[ROUTE_CREATE_REPLY] {
	t_reply("$avp(reply_code)","$avp(reply_reason)");
	break;
}

but for that I need "t_reply" allows pseudo-variables.


Thanks a lot for all and best regards.

:)

-- 
Iñaki Baz Castillo
ibc at in.ilimit.es



More information about the Devel mailing list