January 2016
Intermediate to advanced
384 pages
8h 6m
English
A CANCEL method is used to cancel a request in the early state. According to RFC 3261, CANCEL requests need to be routed in the same way as INVITE requests. The following script checks whether CANCEL matches an existing INVITE transaction and takes care of all the necessary routing. Sometimes, we have retransmissions associated with an existing transaction. If a retransmission is detected while the system is still processing the original request, the t_check_trans() function will discard it.
#CANCEL processing
if (is_method("CANCEL"))
{
if (t_check_trans())
t_relay();
exit;
}
t_check_trans();Read now
Unlock full access