[SR-Dev] $T_reply_code, any equivalent in sr tm?

Andrei Pelinescu-Onciul andrei at iptel.org
Wed Apr 22 13:12:50 CEST 2009


On Apr 22, 2009 at 11:30, Henning Westerholt <henning.westerholt at 1und1.de> wrote:
> Hi,
> 
> i'd like to use the PV $T_reply_code [1] to test my carrierroute configs. This 
> variable holds in k the numerical result code of the last reply. Is there any 
> equivalent available in the sr tm as well?
> 
> I read in the module README, there is something like 'status'. I've tried to 
> use this in the module, this obviously not work. Even assigning this to a 
> temporary AVP does not work. 

status should work in reply routes, but it's string:

if (status~="[4-5]..") ....

You could also use:
t_check_status("string"), e.g.: if (t_check_status("5[0-9][0-9]")) ...

which works in all the routes, similar to $T_reply_code.

There are also some selects which might be usefull:

@tm.uas.status - last sent reply (!=current in the reply route)

@tm.uac[n].status - last received reply on branch n

(they evaluate to string too).

> 
> Apr 22 11:08:00 ca ser: BUG: <core> [cfg.y:2798]: parse error in config file, 
> line 41, column 19: syntax error
> Apr 22 11:08:00 ca ser: BUG: <core> [cfg.y:2798]: parse error in config file, 
> line 41, column 19: invalid operator, == , != or =~ expected
> 
> Is there any other variable available (in sr tm) that holds something like 
> this?
> 
> Thanks,
> 
> Henning
> 
> 
> [1] 
> http://www.kamailio.org/dokuwiki/doku.php/pseudovariables:devel#t_reply_code

Andrei



More information about the sr-dev mailing list