Answer()

Hi!
I’m trying to understand the true (and complete) command Answer().
Sure, I understand what it means… but the real effects what are?

I’ve searched on the web and I found that it connects the two legs of the call but the relationship with the time of a call what is?
I try to explain…

I call from my SIP telephone (that is subscribed to a provider) the server that has asterisk with a trunk SIP.
I’ve noticed that if I write a context like this:
[AAA]
exten => AAA,1,Ringing()
exten => AAA,n,Dial(…)
exten => AAA,n,Dial(someone else…,and play music to the caller while is ringing)
exten => AAA,n,Hangup
if noboy picks up the telephone never shows the timer until the end of the call.

if I write a context like this:
[AAA]
exten => AAA,1,Ringing()
exten => AAA,n,Dial(…)
exten => AAA,n,Answer
exten => AAA,n,Dial(someone else…,and play music to the caller while is ringing)
exten => AAA,n,Hangup
when it start the 3rd row my telephone starts to show the timer of the call…although nobody picks up!!!

So my question is: in the first case I never pay to the service provider???

Doesn’t the timer on the telephone be related to the cost of the call???

As these are outgoing calls the charging is up to the supplier and they will start charging when the far end answers the call.
the timer on the phone in the cases you describe have nothing to do with charging , unless you are charging the phone user to make the call then example 2 is wrong and shouldnt be used.

Ian

Answer() doesn’t connect two parties together. It signals the network that you have answered the call. If the incoming line were an FXO analogue line, rather than a SIP one, it would cause Asterisk to go off hook. It is generally used by public networks to signal that the call should be charged for and that two way speech should be enabled.

In some circumstances, it is possible to send outgoing speech without answering, although if you hit a public network, it will probably be treated as answer, unless you are also another recognized network operator.

Simple dialplans do not need to use Answer, as Asterisk will normally answer when needed. You only need to use Answer if you want to answer the call early for some reason.

Thanks guys for the answers!

Colo