[HELP]: Auto-answering Calls Placed From Call Files

Home » Asterisk Users » [HELP]: Auto-answering Calls Placed From Call Files
Asterisk Users 4 Comments

Hello All,

I’ve asked this on the asterisk-dev list, so sorry for cross-posting. So far I’m not sure how to accomplish this without looking at the source code or looking at some other way to get around this issue.

I’m trying to have an automated call to an Aastra SIP phone and have the call auto-answeredby the phone. I know that a SIP call placed to the phone can be auto-answered if a certain SIP header is added to the call. I am able to apply the SIP headers manually and get that working (using SIPAddHeader(Alert-Info: info=alert-autoanswer) in the dialplan, but for call files, I don’t seem to be able to edit any of the sip headers – there is only basic customizations allowed to setup the calls.

Does anyone know how I could place automated outgoing calls that would have the proper sip headers added to it that would allow the call to be auto-answered?

I’ve also posted this question to the forums here:

4 thoughts on - [HELP]: Auto-answering Calls Placed From Call Files

  • This isn’t a development question, as it doesn’t relate to the actual Asterisk source code itself. Cross-posting across the -dev and -users lists isn’t helpful either, as pretty much everyone who is subscribed to the asterisk-dev list is also subscribed to the asterisk-users list.

    As SIPAddHeader is a dialplan application and not a dialplan function, it cannot be used from a call file. One approach to performing an outbound call that requires SIPAddHeader – and that doesn’t rely on undocumented behaviour – is to use the call file to create a Local channel in the dialplan that dials the SIP channel, and use SIPAddHeader from there. A quick Google indicates others have used a similar approach in the past as well [1].

    [1] http://lists.digium.com/pipermail/asterisk-users/2008-January/204375.html


  • So I take it in the call file you have it set to call Dial(SIP/something) ?
    If rather than dialling the sip destination immediately you dialled a local channel then it could add the custom header and then initiate the dial to the sip destination.

  • Although I haven’t tried this for this particular example, instead of using a .call file, you could probably originate a call using Ryan Bullock’s Asterisk::AMI PERL module http://search.cpan.org/~greenbean/Asterisk-AMI-v0.2.8. It’s one of the most valuable tools that I have and I’ve written literally hundreds of PERL
    scripts using it. You should check it out. It’s got good documentation and examples to go along with it. I also use the AGISpeedy FastAGI package written in PERL and there’s also an AGISpeedy package written in php that is also a valuable tool. Regards;

    —–Original Message—

  • Hello Steve,

    Have you tried to send the automated call to your dialplan instead of the phone?

    For example, instead of calling SIP/aastra_phone call Local/aastra_phone@auto-answer-context and tweak auto-answer-context from your dialplan as needed.

    HTH, Ioan