AGI Script fails

Hello, I have a few AGI-Scripts I need to run which are all written in perl. All of them reference a MySql database to check some data and then the final script updates a database table. All of this works fine in an older version of asterisk, I’m setting up a new PBX that’s version 18 and need these scripts to work again. The script that writes to the table has 5 arguments and the log always says “510 Invalid or unkown Command”.

If I run the script manually from the cli with commas between the arguments I get this same result. However if I run it manually and put spaces between the arguments then it runs fine.

I’m not sure how to change my dialplan entry to do this… It’s currently:

exten => s,n(context),AGI(script.agi,${Arg1},${Arg2},${Arg3},${Arg4},${Arg5})

Is there a way I should change this?

AGI giving me result “510 Invalid or unknown command”? - Asterisk / Asterisk Support - Asterisk Community

Thanks for the reply, it appears to be working now. From what I can tell it was just a permissions issue, I had an entry in the script to output a logfile in certain events and this would also terminate the script. This script when moved over didn’t have write permissions for asterisk. Once those were given it looks to be working again.
For anyone that may need it I used “chmod 666 /var/log/file.log”

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.