1.4.2. t_relay([flags])

Relay a message statefully to destination indicated in current URI. (If the original URI was rewritten by UsrLoc, RR, strip/prefix, etc., the new URI will be taken). Returns a negative value on failure--you may still want to send a negative reply upstream statelessly not to leave upstream UAC in lurch.

The coresponding transaction may or may not be already created. If not yet created, the function will automatically create it.

The function may take as parameter an optional set of flags for controlling the internal behaviour. The flags may be given in decimal or hexa format; supported flags are:

·        0x01 - do not generate an 100 trying provisional reply when building the transaction. By default one is generated. Useful if you already pushed an stateless 100 reply from script.

·        0x02 - do not internally send a negative reply in case of failure. It applies only when the transaction is created. By default one is sent. Useful if you want to implement a serial forking in case of failure.

·        0x04 - disable the DNS failover for the transaction. Only first IP will be used. It disable the failover both at transaport and transaction level.

This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.

 

Example 1-19. t_relay usage

...

if (!t_relay()) {

    sl_reply_error();

    exit;

}

...

 


1.4.3. t_relay(proto:host:port,[flags])

Relay a message statefully to a fixed destination. The destination is specified as "[proto:]host[:port]".

The function may take as parameter an optional set of flags for controlling the internal behaviour - for details see the above "t_relay([flags])" function.

This functions can be used from REQUEST_ROUTE, FAILURE_ROUTE.

 

Example 1-20. t_relay usage

...

t_relay("tcp:192.168.1.10:5060");

t_relay("mydomain.com:5070","0x1");

t_relay("udp:mydomain.com");

...

 


http://www.openser.org/docs/modules/1.2.x/tm.html#AEN335