exten => 200,1,AGI("agi-test.agi", ${CALLERID(num)}-${EXTEN})
/var/lib/asterisk/agi-bin/agi-test.agi
#include <stdio.h>
int main(int args, int **argv)
{
char *str = argv[1];
FILE *fp = fopen("/var/lib/asterisk/agi-bin/test.log", "a");
fwrite(str, fp);
fclose(fp);
return 0;
}
chmod 755 /var/lib/asterisk/agi-bin/agi-test.agi
chown asterisk:asterisk /var/lib/asterisk/agi-bin/agi-test.agi
systemctl restart asterisk
200に内線をかける