hi to all
can anyone solve this problem
c language program ,extension in extensions.confg and error r given below
///////////////////////error displayed in cli////////////////
*CLI> – Registered SIP ‘Exam_controller’ at 192.168.0.16 port 40126 expires 3600
– Executing Answer(“SIP/Exam_controller-0a0f2750”, “”) in new stack
– Executing AGI(“SIP/Exam_controller-0a0f2750”, “zagi.c”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/zagi.c
AGI Tx >> agi_request: zagi.c
AGI Tx >> agi_channel: SIP/Exam_controller-0a0f2750
AGI Tx >> agi_language: en
AGI Tx >> agi_type: SIP
AGI Tx >> agi_uniqueid: 1162503099.0
AGI Tx >> agi_callerid: Exam_controller
AGI Tx >> agi_calleridname: Exam_controller
AGI Tx >> agi_callingpres: 0
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: 555
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: employee
AGI Tx >> agi_extension: 555
AGI Tx >> agi_priority: 2
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >>
Failed to execute ‘/var/lib/asterisk/agi-bin/zagi.c’: Exec format error
– AGI Script zagi.c completed, returning 0
– Executing Hangup(“SIP/Exam_controller-0a0f2750”, “”) in new stack
== Spawn extension (employee, 555, 3) exited non-zero on ‘SIP/Exam_controller-0a0f2750’
– Incoming call: Got SIP response 500 “Server Internal Error” back from 192.168.0.16
– Registered SIP ‘PTD’ at 192.168.0.50 port 53910 expires 3600
– Unregistered SIP ‘PTD’
///////////////////////extension////////////////////////////
exten => 555,1,answer()
exten => 555,2,agi,zagi.c
exten => 555,3,hangup()
/////////////////// agi script in clanguage saved in
agi-bin folder///////////////////////
#include <stdio.h>
main()
{
char line[80];
int a=11,i;
setlinebuf(stdout);
setlinebuf(stderr);
while(1)
{
fgets(line,80,stdin);
if(strlen(line)<=1)
break;
}
for(i=1;i<=2;i++)
{
}
/////////////////////////////////////////////////
if anyone know about AGI scripting in c language so please tell me the requirments that i didn’t fulfill to run it.
positive response will be highly appreciated
ok bye