Sometimes, it is hard to debug an existing script. We strongly encourage you to use a versioning system such as subversion or Git for your scripts. Always create a backup before editing a production script. Try to avoid changing the routing script (opensips.cfg
) as much as possible. Use the database for the daily configuration changes to subscribers, dialplans, and routes. It is usual to run the same script for years.
You can test the syntax of a script without running it using the following command:
opensips –c
It will show you the syntax errors and related lines. Some common syntax errors are as follows:
A missing semi-column at the end of the line
Missing brackets (
[]
) and curly brackets ({}
)Command not available because the module was not loaded
A global parameter pointing to the wrong library path (
mpath
)
Missing parentheses, curly braces, and brackets are hard to spot because the system will point to the line where it detected the mistake, but the error is...