As I said, the newer version of OpenSER has a slightly different script than the one encountered in version 1.2.2; let's comment some of the modifications.
According to RFC3261, CANCEL requests have to be forwarded in the same way as INVITE requests. The code below is a shortcut. If an existing transaction exists, the CANCEL will be relayed automatically with the existing information about the transaction. The proxy needs to be operating in the stateful mode. In other words, using t_relay()
instead of forward()
to route the calls.
#CANCEL processing if (is_method("CANCEL")) { if (t_check_trans()) t_relay(); exit; }
The t_check_trans()
will take care of non-CANCEL and non-ACK requests belonging to a transaction, taking care of the retransmissions, if required. According to the documentation found at www.openser.org: non-CANCEL/non-ACK requests: if the request belongs to a transaction (it's a retransmision), the function will...