Channel originate with auto answer

Hi,
I’m making a click to call using AMI and it works, but I don’t understund how I can auto answer the call to my extension that originate the dial action. Is thre any possibility to do what I want?
I read something about SIPAddHeader(Call-Info: sip:;answer-after=0) but I really don’t understand how to use it and where I can place it.

Thank you

depends on the Asterisk-Version You’re using:

For Asterisk-Versions up to 10.x I have no idea.

Starting with Asterisk 11 You may define the b-Option in the dial-command. With this option You may define a subroutine which will be triggered before the extension is dialed/bridged. Within this subroutine You may place the SIPAddHeader-Command:

wiki.asterisk.org/wiki/display/ … l+Handlers

Can you give me an example please?
I really can’t understund

follow the link, example is there.

But You may get it even more easy by using a local channel (I just forgot about local channels while answering You the first time :smiling_imp: )

Lets assume You want to make a call where extension 100 is the internat extension (dialing some othe number in context outbound). Your callfile/originate may look like

Channel: Local/100@aa_call/n Context: outbound Extension: 1234567890 CallerID: "Ext 100" <100> MaxRetries: 0 RetryTime: 30 WaitTime: 60 Priority: 1

Your context aa_call may then look like this:

[aa_call] exten => 100,1,SIPAddHeader(Call-Info: sip:\;answer-after=0) exten => 100,n,Dial(SIP/100);

This should work independend from teh Asterisk-version.

The variant I supposed to use first also needs to be triggered by a local channel as there’s no other way to issue a dial-command with some options while using agi originate or callfiles

Thank you fo your answer,

I try that but I must answer to make the call.
I use softphones, maybe that doesn’t work with them?

Wheter auto-answer works or not depends on the client (and what it expects to ghet into this mode). I even don’t checked the Header You’re trying to send out.
The only advice I may give You is to look into the documentation for Your softphone (intercom/paging/auto-answer). Probably there’s some documentation what the client expects to get into an “auto-answer” behaviour.

Ok thank you,
The last question:
Can I transfer the incoming call wich starts the “make call” to a channel that already exists?
For exemple,
I talk with someone on my telephone, than I want to start another call, can I transfert the asterisk incoming call for the originate action to the channel that is already open in the other conversation (not before I transfert the first call to music on hold)?

When I understand the scenario correct You’re talking about

A talks to B

a new call is established where

A would talk to C

But instead result shoud be

B talks to C (without putting B on Hold before bridging to C)?

If this is the idea it would be a standard call transfer, but: I’v got no idea how to achieve a transfer (which is possible) without putting B on hold for a moment (while dialing to C) but maybe someone else has a solution for You …