Why AGI script is not executable?

I am trying to call my agi script but don’t know why is terminated.
I also referred this post but that was no help.

*CLI>     -- Executing [1104@Long-Distance:1] Answer("PJSIP/1101-00000000", "") in new stack
       > 0x7fbcd401d7e0 -- Strict RTP learning after remote address set to: 192.168.1.7:7078
       > 0x7fbcd401d7e0 -- Strict RTP switching to RTP target address 192.168.1.7:7078 as source
    -- Executing [1104@Long-Distance:2] Playback("PJSIP/1101-00000000", "hello") in new stack
    -- <PJSIP/1101-00000000> Playing 'hello.gsm' (language 'en')
    -- Executing [1104@Long-Distance:3] Playback("PJSIP/1101-00000000", "beep") in new stack
    -- <PJSIP/1101-00000000> Playing 'beep.gsm' (language 'en')
    -- Executing [1104@Long-Distance:4] NoOp("PJSIP/1101-00000000", "Answered & beep done") in new stack
    -- Executing [1104@Long-Distance:5] Record("PJSIP/1101-00000000", "/home/mtech/Documents/data/record.wav,3") in new stack
    -- <PJSIP/1101-00000000> Playing 'beep.gsm' (language 'en')
       > 0x7fbcd401d7e0 -- Strict RTP learning complete - Locking on source address 192.168.1.7:7078
    -- Executing [1104@Long-Distance:6] Playback("PJSIP/1101-00000000", "/home/mtech/Documents/data/record") in new stack
    -- <PJSIP/1101-00000000> Playing '/home/mtech/Documents/data/record.slin' (language 'en')
    -- Executing [1104@Long-Distance:7] NoOp("PJSIP/1101-00000000", "Record Done") in new stack
    -- Executing [1104@Long-Distance:8] AGI("PJSIP/1101-00000000", "pyagi.py") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/pyagi.py
 pyagi.py: Failed to execute '/var/lib/asterisk/agi-bin/pyagi.py': No such file or directory
    -- Executing [1104@Long-Distance:9] Playback("PJSIP/1101-00000000", "/home/mtech/output") in new stack
[Mar 17 12:29:28] WARNING[3925][C-00000001]: file.c:789 ast_openstream_full: File /home/mtech/output does not exist in any format
[Mar 17 12:29:28] WARNING[3925][C-00000001]: file.c:1262 ast_streamfile: Unable to open /home/mtech/output (format (ulaw)): No such file or directory
[Mar 17 12:29:28] WARNING[3925][C-00000001]: app_playback.c:497 playback_exec: Playback failed on PJSIP/1101-00000000 for /home/mtech/output
    -- Executing [1104@Long-Distance:10] NoOp("PJSIP/1101-00000000", "TTS Playback done") in new stack
    -- Executing [1104@Long-Distance:11] Hangup("PJSIP/1101-00000000", "") in new stack
  == Spawn extension (Long-Distance, 1104, 11) exited non-zero on 'PJSIP/1101-00000000'

Did you check that? You also need to look at access rights.

yeah I did and it’s there

Existence is not sufficient.

Access? What do mean by access?

https://wiki.archlinux.org/index.php/File_permissions_and_attributes

thanks for resource yeah I can got something but I checked and the permission of the file is 755 (I also set 777 earlier but it wasn’t work and also no needed because we just need to execute our script)

What does the first line of the file contain?

Which file? AGI script file or Extensions.conf file?

The file that is not executable.

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