Detect answer via sip trunk

Hi, I have a SIp trunk and I want to make an outgoing call to a external analog number and play a message when the other side answers it.
The problem is that the message be played as soon as it finish dialing the number, without waiting to answer.
Between SIP extensions works fine but not for outgoing external calls.
Any help?

The call is initiated from the CLI (for simplicity)

CLI> Originate Sip/MySipTrunk/destinationNumber extension 6789@from-sip

in the dial plan:

ext => 6789.1, answer ()
ext => 6789,n, Playback (demo-congrats)
ext => 6789.n, hangup ()


Remove your explicit answer from your dialplan.

That’s not the problem. The problem lies outside Asterisk. Possibly he’s using an analogue line gateway.

SIP has no problem with answer supervision, but analogue PSTN lines can have problems.

On the other hand, the explicit answer serves no useful purpose, as the call is already answered at that point and Playback forces answer, by default.

I had problems before with PSTN lines, and “BackgroundDetect” doesn’t work very well when volume is low. So I paid for an IP service provider.
But the problem persists. I will try removing the explicit answer from dialplan.