If the SIP stack is considered to be the muscle responsible for handling large amounts of SIP traffic, then the routing script can be considered as the brain or intelligence deciding on how to handle the SIP traffic. The OpenSIPS routing script is a kind of program that tells OpenSIPS what to do with the SIP traffic—how to route the incoming traffic, how to forward the traffic, and how to generate new traffic.
The power to master OpenSIPS resides in the ability to write down and understand routing scripts. To do so, two kinds of knowledge on the scripting are required:
An understanding of the scripting itself; how to use functions, how to use variables, and how to use various statements at the script level
An understanding of the mapping between the routing script and flow of the SIP traffic, such as what part of the script is triggered when SIP messages are received or sent, how to forward or reply to SIP requests, or how a SIP dialog reflects over the routing...