[OpenSIPS-Users] routing function variable scope

John Quick john.quick at smartvox.co.uk
Sun May 9 17:20:58 EST 2021


Kingsley,

I hope you won't be offended, but in my opinion you are at risk of
sacrificing code readability in the pursuit of code re-usability.
If you accept that variables are in-scope both within the route and the
sub-route, then why not just have one variable for the result - set it
inside the sub-route and read the result from it immediately after the
sub-route has returned. This may not be quite right for a code style
perfectionist, but at least it would be easily understood by the rooky
programmer who has to maintain your code in 5 years' time.

John Quick
Smartvox Limited





More information about the Users mailing list