Book Image

Building Telephony Systems with OpenSER

Book Image

Building Telephony Systems with OpenSER

Overview of this book

Table of Contents (18 chapters)
Building Telephony Systems with OpenSER
Credits
About the Author
About the Reviewers
Preface
6
Building the User Portal with SerMyAdmin
Index

Handling CANCEL requests and retransmissions


Cancel requests according to the RFC3261, needs to be routed in the same way as the INVITE requests. The script below checks if the CANCEL request matches an existing transaction and takes care of all the necessary routing. Sometimes, we have retransmissions associated with an existing transaction. If this is the case, the function t_check_trans() will handle it and exit the script.

#CANCEL processing
if (is_method("CANCEL"))
{
if (t_check_trans())
    t_relay();
    exit;
}

t_check_trans();