[Serusers] Failure route processing

Jiri Kuthan jiri at iptel.org
Wed Oct 15 23:36:10 CEST 2003


Jaime,

you are using two incompatible constructs: "status" and "failure_route".
You would have to use status from onreply_route to base your processing
on status code, see example bellow.

"failure_route" is unaware of reply status -- failure_route returns to
request processing on a failure. Commands used from within failure_route
refer to and operate over the original requests. There is currently no
way to determine the current status. I'm not even sure what it would be
if it was there. With forking, is it status of last-recieved reply, 
or is it the status code which would be picked for forwarding?
(I tend to say the latter).

"status" can only be meanigfuly used from reply processing. (onreply_route)
Currently, the routing language allows you to use it from failure_route
too, but that's a mistake and it does not result in anything useful.

So the script could look like this: (derived from examples/serial_183.cfg,
never tested)

  t_on_reply("1");
  t_relay();
...
onreply_route[1] {
  if (status=~"48[0-9]")  {
  t_on_failure("1");
}
...
failure_route[1] {
 # switchboard ....


-jiri

At 12:26 PM 10/15/2003, jaime.gil at orange.co.uk wrote:

>Hello there,
>
>We are trying to put together a script that executes an external program when
>receiving a certain failure code.
>
>The current script looks like:
>
>
>/***********************  start script ********************************/
>
>route {
>
>[........]
>
>                if (method==INVITE) {
>                        log(1, "INVITE\n");
>                        t_on_failure("1");
>                };
>[........]
>     t_relay();
>
>}
>
>[......]
>
>failure_route[1] {
>
>        log(1, "Retry...\n");
>
>        if (status=~"48[0-9]") {
>                log(1, "Called when busy!!!\n");
>                exec_msg('./switchboard_server/send_request "127.0.0.1" "9002"
>"STORE_SESSION" "$SIP_HF_FROM" "$SIP_HF_TO"');
>        };
>
>        append_branch();
>        t_relay();
>        break;
>}
>
>/***************************** end of script *****************************/
>
>"exec_msg" does never get called with this configuration. What is the syntax to
>catch "48x" in failed replies?
>
>Thanks in advance,
>
>Jaime
>
>
>
>*******************************************************************************
>Important.
>Confidentiality: This communication is intended for the above-named person and
>may be confidential and/or legally privileged. Any opinions expressed in this
>communication are not necessarily those of the company. If it has come to you
>in error you must take no action based on it, nor must you copy or show it to
>anyone; please delete/destroy and inform the sender immediately.
>
>Monitoring/Viruses
>Orange may monitor all incoming and outgoing emails in line with current
>legislation.  Although we have taken steps to ensure that this email and
>attachments are free from any virus, we advise that in keeping with good
>computing practice the recipient should ensure they are actually virus free.
>
>Orange PCS Limited is a subsidiary of Orange SA and is registered in England No
>2178917, with its address at St James Court, Great Park Road, Almondsbury Park,
>Bradley Stoke, Bristol BS32 4QJ.
>*******************************************************************************
>
>_______________________________________________
>Serusers mailing list
>serusers at lists.iptel.org
>http://lists.iptel.org/mailman/listinfo/serusers

--
Jiri Kuthan            http://iptel.org/~jiri/ 




More information about the sr-users mailing list