Call Files and AGI Interaction

Hi Guys

I am trying to do the following

  1. Create a call file like
    ========== snippet ==============
    channel: Local/3455@internal
    maxretries: 3
    retrytime: 60
    waittime: 60
    callerid: “My ID” <*66>
    application: AGI
    data: my_dev.agi|myfile.txt
    ======== end snippet =========

As can be see this call file will call up and then execute something like
AGI(my_dev.agi|myfile.txt)
which calls up the extension and then call the my_dev.agi script with the file name myfile.txt as an argument.

This all works great. This agi script basically does something along the lines

========= snippet ===========

print “STREAM FILE $myfile “0123456789”\n”;

print “GET DATA $myfile 15000 1 \n”;
my $result = ;

======== end snippet ===========

Now similar code works great when I enter the AGI script from the dial plan. However, when entering it from the call file I can for some reason not interact with the AGI script. What I mean to say is that the GET DATA line doesn’t read in my choice on the phone (DTMF) and instead times out.

Are there different file descriptors or something when an AGI script is initiated from a call file?

Any help is highly appreciated.

Thanks,

// Jonas Arndt

Just realized that I forgot to mention what version of Asterisk I am on. It is the 1.4 branch (1.4.11)

Cheers,

// Jonas

More on this subject.

It seems that the problem occurs only IAX channels. If the call files initiates a call to a regular SIP phone the DTMF responses work like a charm. Wonder if there is something going on with tmfmode or something.

The IAX based phone where it doesn’t work is a regular analogue phone connected through Digium’s iaxy device.

Investigation continues…

// Jonas

Most probably a dtmftype setup problem.

Check both your iax.conf file and your digium device and make sure the dtmftype are properly set …

Noel

Hi Noel,

Thanks for your tip. Yes I will do this. Was a little overloaded with work today so it’ll have to be tomorrow.

It is a bit weird that the IAX channel works if the script is started from the dial plan though. I mean, if I initiate it in extensions.conf with the AGI command I can successfully use the IAX (iaxy) based phones and all the DTMF is detected by the “GET DATA” AGI command.

It seems to me that perhaps the DTMF settings are not initiated correctly on the channel when the AGI scrip is started by a call file.

I’ll do some more digging on my side.

Thanks,

// Jonas

More no this…

I seriously do not think this has anything to do with any DTMF setting anywhere. There is actually not that many on an IAX channel. I have traced (iax2 set debug) the session for when the AGI script is initiated by the call plan and it successfully detects the DTMF. I have also traced the session for when the AGI script gets initiated by a call file. In both scenarios I can see incoming events for when the key pad is pressed and they look the same. The only difference is that when the AGI is run by a call file the AGI function “GET DATA” times out.

I am a bit confused about this. I have also sent it to the development mailing list. Without anything back yet though. If it wasn’t for the fact that it works flawlessly on the SIP channel I would say it is a problem with the AGI application…

Cheers,

// Jonas