Custom module with agi script not running

I am working on a custom module for my company that includes calling an agi script. The problem i am facing is that the log says that the script has completed, but it doesn’t indicate that the script has launched, nor does it actually run the script.

I’m not even sure it is seeing the script because it would give me the same output before i had placed the file in /var/lib/asterisk/agi-bin

Here are the logs from trying to run the agi script

[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] pbx.c: Executing [s@my-context:3] AGI("PJSIP/6001-00000008", "agi://127.0.0.1/myscript.php") in new stack
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: AGI Tx >> agi_network: yes
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: AGI Tx >> agi_network_script: myscript.php
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_request: agi://127.0.0.1/myscript.php
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_channel: PJSIP/6001-00000008
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_language: en
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_type: PJSIP
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_uniqueid: 1594392778.8
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_version: 16.6.2
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_callerid: 6001
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_calleridname: Mike
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_callingpres: 0
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_callingani2: 0
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_callington: 0
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_callingtns: 0
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_dnid: 6502
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_rdnis: unknown
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_context: my-context
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_extension: s
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_priority: 3
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_enhanced: 0.0
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_accountcode:
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> agi_threadid: 140291203450624
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >>
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Script agi://127.0.0.1/myscript.php completed, returning 0
[2020-07-10 14:53:00] VERBOSE[18078][C-00000009] res_agi.c: <PJSIP/6001-00000008>AGI Tx >> HANGUP

I believe I resolved my own issue. The agi script was created on a windows machine so it had the incorrect line endings. After resolving that the script ran normally.

I actually had a reply typed up for you to check the EOL line endings, but got distracted by something shiny and didn’t get to send before you figured it out on your own. I have to learn this myself every once in a while.

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