To better test and debug the routing script, we will use the xlog()
function as a way to insert debugging and informational messages in our script:
loadmodule "xlog.so" xlog("L_ERR","Marker 480 ruri=<$ru>");
You can check the latest XLOG messages with the following command:
tail /var/log/syslog
The t_on_failure()
function tells OpenSIPS to handle the SIP failure (negative/unsuccessful replies) conditions. Failure conditions in this context are error messages of codes, 4XX and 5XX. When you call t_on_failure()
just before calling the t_relay()
function, you will tell OpenSIPS to transfer the control to failure_route[missed_call]
when a failure message is detected:
Note
IMPORTANT: OpenSIPS does not execute the failure route when you perform t_on_failure()
but executes it in the future when (if any) a SIP failure is detected:
t_on_failure("missed_call");
The first part of the failure_route
section handles cancelled messages (487). The script simply terminates the...