if xxxx is “agi-test.agi” file in “/var/lib/asterisk/agi-bin” directory, it run well. But when xxxx is my file “test.agi” (i copy all the content of “agi-test.agi” file into this file), i got error :
-- Executing [100@from-sip:1] SayDigits("SIP/101-093dbfa0", "123") in new stack
-- <SIP/101-093dbfa0> Playing 'digits/1' (language 'en')
-- <SIP/101-093dbfa0> Playing 'digits/2' (language 'en')
-- <SIP/101-093dbfa0> Playing 'digits/3' (language 'en')
-- Executing [100@from-sip:2] AGI("SIP/101-093dbfa0", "test1.agi") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/test1.agi
== test1.agi: Failed to execute '/var/lib/asterisk/agi-bin/test1.agi': No such file or directory
-- AGI Script test1.agi completed, returning 0
== Auto fallthrough, channel 'SIP/101-093dbfa0' status is 'UNKNOWN'
I gave the permission 755 on test1.agi file, and it is located in “/var/lib/asterisk/agi-bin” directory. I have searched google but cannot find solution to my problem.
Please help me.
thank you.
I copy all content of /var/lib/asterisk/agi-bin/agi-test.agi file into my test.agi file and upload into /var/lib/asterisk/agi-bin/ directory and make it has all permission to run (777)
Here is result :
Verbosity is at least 3
-- Executing [1000@from-sip:1] SayDigits("SIP/101-09661dd0", "123") in new stack
-- <SIP/101-09661dd0> Playing 'digits/1' (language 'en')
-- <SIP/101-09661dd0> Playing 'digits/2' (language 'en')
-- <SIP/101-09661dd0> Playing 'digits/3' (language 'en')
-- Executing [1000@from-sip:2] Wait("SIP/101-09661dd0", "1") in new stack
-- Executing [1000@from-sip:3] AGI("SIP/101-09661dd0", "test.agi") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/test.agi
AGI Tx >> agi_request: test.agi
AGI Tx >> agi_channel: SIP/101-09661dd0
AGI Tx >> agi_language: en
AGI Tx >> agi_type: SIP
AGI Tx >> agi_uniqueid: 1252915123.10
AGI Tx >> agi_callerid: 101
AGI Tx >> agi_calleridname: 101
AGI Tx >> agi_callingpres: 0
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: 1000
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: from-sip
AGI Tx >> agi_extension: 1000
AGI Tx >> agi_priority: 3
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >>
AGI Rx << verbose "Failed to execute '/var/lib/asterisk/agi-bin/test.agi': No such file or directory" 2
== test.agi: Failed to execute '/var/lib/asterisk/agi-bin/test.agi': No such file or directory
AGI Tx >> 200 result=1
-- AGI Script test.agi completed, returning 0
== Auto fallthrough, channel 'SIP/101-09661dd0' status is 'UNKNOWN'
Hi, i don’t know how asterisk read .agi file but i use vi command to write my code (and give 755 permission). it’s work fine.
Perior, I use notepad to write my code, and then use SSH Client upload my file to /var/lib/asterisk/agi-bin/ directory. Maybe the feed line in windows cause this problem.
Hope that someone meet this problem can check out in his situation.
test1 file has the content of agi-test.agi file.
When i copy content from agi-test.agi into notepad, it has no feedline.
When i copy to notepad plus (http://notepad-plus.sourceforge.net/uk/site.htm) it has feedline. And that causes the problem.