[OpenSIPS-Users] Invoking 'failure_route[X]' when OpenSIPS replies [3456]XX by itself

Iñaki Baz Castillo ibc at aliax.net
Wed Nov 26 17:29:31 CET 2008


El Miércoles, 26 de Noviembre de 2008, Brett Nemeroff escribió:
> Why not just call a normal route after you send your negative reply?

Because I've already coded the needed logic in a failure_route that would be 
runned when a negative reply comes from the callee. But I want the same 
behaviour when I (OpenSIPS) send the negative reply.

I could do the following (but it's not very cool):

---------
route[TO_USER] {
        
        t_on_failure("TO_USER");

        # some_custom_query...
        if $rc = ... {
                # I decide to reject the call
                # First create the transaction ("failure_route" could have 
sense)
                t_newtran();
                route(FAILURE);
                exit;
        }

        # do loockup and so...
        t_relay();
}

failure_route[TO_USER] {

	route(FAILURE);

}

route[FAILURE] {

        if $fU == "alice" {
                $ru = "sip:voicemail at server";
                append_branch();
        }

}
---------

-- 
Iñaki Baz Castillo



More information about the Users mailing list