OK...
Two things
You can add code to the dialplan using custom-apps. SAIL will automatically stitch the app into the correct place in the dialplan for you. Secondly, what exactly are you attempting to authorise? If it is, as I suspect, outbound calls, SAIL already has that functionality. Create your pin numbers in headers=>selauth.conf. You can create as many pin numbers as you like (one for each person)
Then in your outbound route set "Authorization Required" to YES.
All done.
Kind Regards
S