AGI Commands don't work

I have installed AsteriskNow and run it in a virtual machine on a Windows XP System.
Asterisk Version is : 1.4.18.1
VMWarePlayer : 2.0.1 build-55017

I have installed Asterisk.Net.1.6.1.0 as a dll on my XP System and wrote a simple VBTest app. This app initialises manager api connection with success and intatiates and agi script host also with success.

I have defined one sip extension to dial into asterisk with x-lite phone. SIP.conf looks like this:

[2000]
type=friend
secret=0000
host=dynamic
,n,Wait
extensions.conf looks like this:

[default]
exten=s,1,Ringing()
exten=s,n,Wait(3)
exten=s,n,AGI(agi://192.168.49.237/tkfastagi)
exten=s,n,Hangup()

now i initiate a call from my sip phone. Asterisk reacts with the following lines:

Executing[s@default:1] Ringing(“SIP/2000-08207c60”,"") in new stack
Executing[s@default:2] Wait(“SIP/2000-08207c60”,“3”) in new stack
Executing[s@default:3] AGI(“SIP/2000-08207c60”,“agi://192.168.49.237/tkfastagi”) in new stack

when i do agi debug on asterisk console i see data coming for call seems correct like

AGI TX >> agi_network: yes
etc…

but when it comes to RX the followeing lines come

AGI RX << temp buffer (three digits I cannot type on keyboard) - errno Ressource temporarily unavaliable

This line is repeated 100 times or so and this ends with

AGI RX << (the same three digits as above)ANSWER
AGI TX >> 510 Invalid or unknown command

I am trying to solve this problem for a few days now and I tested much but it doesn’t work.

Any help is very apreciated.

Thanks…Guido

what is your AGI ‘script’ written in and what exactly are you trying to make it do?

AGI Script is written in VB.NET 2008 and I am using the library Asterisk.NET which is written in C#.NET.

The AGI Script should take n calls coming in and seek callerid in mssql db and do much more. After getting a desired agent for the caller from db the agent will be called. If answers after x seconds the caller and the agent will be connected and the call will be recorded as well DTMF tones will be accepted during the conversation. It is not an easy thing to do, but I think all this can be done with Asterisk controlled by an AGI script that is multithreaded.

Thanks again…Guido

I would run wireshark (or similar) to see what is being trasmitted on the ‘wire’. It sounds like your AGI server is not properly transmitting it’s data.

I did it with wireshark and got the following four packets that are relevant for the conversation:

agi_network_script: tkfastagi
agi_request: agi://192.168.49.237/tkfastagi
agi_channel: OSS/dsp
agi_language: en
agi_type: Console
agi_uniqueid: 1231430966.0
agi_callerid: unknown
agi_calleridname: unknown
agi_callingpres: 0
agi_callingani2: 0
agi_callington: 0
agi_callingtns: 0
agi_dnid: s
agi_rdnis: unknown
agi_context: default
agi_extension: s
agi_priority: 3
agi_enhanced: 0.0
agi_accountcode:

ANSWER

510 Invalid or unknown command

Event: Newexten
Privilege: call,all
Channel: OSS/dsp
Context: default
Extension: s
Priority: 3
Application: AGI
AppData: agi://192.168.49.237/tkfastagi
Uniqueid: 1231430966.0

I think the last package is a manager api packet which is also connected at the same time.

well, the protocol looks fine. Check to see if there are any leading characters before the ANSWER. You said you saw some non-printable chars in the CLI, so perhaps there is some junk before the command.

I dont think that the nonprintable chars are the problem. There seems to be something not well initialised in Asterisk Server. As I said before ther are somewhat like 100 !!! Lines with the same message:

AGI RX << temp buffer xyz - errno Ressource temporarily unavailable
AGI RX << temp buffer xyz - errno Ressource temporarily unavailable
AGI RX << temp buffer xyz - errno Ressource temporarily unavailable
AGI RX << temp buffer xyz - errno Ressource temporarily unavailable
AGI RX << temp buffer xyz - errno Ressource temporarily unavailable
AGI RX << temp buffer xyz - errno Ressource temporarily unavailable
AGI RX << temp buffer xyz - errno Ressource temporarily unavailable
AGI RX << temp buffer xyz - errno Ressource temporarily unavailable
AGI RX << temp buffer xyz - errno Ressource temporarily unavailable
AGI RX << temp buffer xyz - errno Ressource temporarily unavailable

where x is an i with two points on top, y is a small >> and z is a on head standing questionmark (?)

after these lines there is the line

AGI RX << xyz

and the final line

AGI TX >> 510 Invalid or unknown command

I am really at the end of my knowledge…[/img]

I have nothing further at this point… might want to dig through some of the source code to determine the cause of the error messages

The combination of the virtual machine and the Windows XP dll may make finding support around these parts fairly difficult.

g2010

Thank you for now. Even if my problem is not solved I don’t think that this is a problem of the VM and I also don’t think that it is a problem of the dll. In any case I have to solve this. So anyone is welcome with suggestions.

Guido

I have found the solution !!!

It was an error in the dll Asterisk.NET with the encoding. The Encoding in Sourcefile “AsteriskFastAgi.cs” must be reset to default.

Thanks @all