Asterisk playback starts playing before answering call

i am using Asterisk call files to call my customers and play a message. it works but there is a problem. track starts playing before customer answers the call. i am using this call file format:

    Channel: SIP/Tenor/myNumber
    MaxRetries: 0
    RetryTime: 3
    WaitTime: 30
    Application: Playback
    Data: myRecorded-message

i tested it with local sip account like below and it works correctly.sound starts playing after answering.

Channel: Local/My-internal-number
MaxRetries: 0
RetryTime: 3
WaitTime: 30
Application: Playback
Data: myRecorded-message

i think the problem is with analog lines.

a also tried these, and not working …

Channel: SIP/Tenor/myNumber
MaxRetries: 0
RetryTime: 3
WaitTime: 30
context: takNetAutoDial
Extension: s
Priority: 1
-------------------------------
[takNetAutoDial]
exten => s,1,Set(TIMEOUT(response)=20) 
exten => s,2,Answer
exten => s,3,Wait(2)
exten => s,4,Playback(en/myRecorded-message)
exten => s,5,Hangup

---------------------------------------- ;or

  [takNetAutoDial]
    exten => s,1,Set(TIMEOUT(response)=20) 
    exten => s,2,Answer()
    exten => s,3,Wait(2)
    exten => s,4,Playback(en/myRecorded-message,skip) ; also noanswer
    exten => s,5,Hangup

-------------------------------------------- ;or
  [takNetAutoDial]
    exten => s,1,Set(TIMEOUT(response)=20) 
    exten => s,n,Answer(10)
    exten => s,n,Wait(2)
    exten => s,n,Playback(en/myRecorded-message)
    exten => s,n,Hangup

whats the problem ?

I presume you are accessing the analogue line through a gateway, so I’ll have to assume the gateway works in a similar way to how Asterisk would work.

Many analogue lines don’t provide answer supervision, so when directly connected to one, Asterisk assumes the line answered immediately. It can be configured to recognize answer when there is a polarity reversal on the line, and wait for that, although without that form of answer supervision it would never detect any answer.

Generally, simple analogue lines are not really suitable for automated operations, as they were only designed for use by humans. Any serious users would interface using ISDN, either directly , or via an ITSP.

I presume you are accessing the analogue line through a gateway, so I’ll have to assume the gateway works in a similar way to how Asterisk would work.

yes we are using gateway for accessing analogue line with Tenor AX800

A bit of digging through broken links leads to https://support.sonus.net/download/attachments/4030473/Answer_Supervision.pdf?api=v2

THAANKK YOU IT WORKS :blush:

Also you have explicit answers in your contexts. Remove it if you dont want to answer the call before the user.

The Answers are redundant here, as the call is already up before the B side of the originate gets run, but it is true that a lot of people wrongly think they have to start with Answer.

Hi, I have the same issues and I’m using Digium FXO adapter
https://store.digium.com/boards/#search/1A4B03F

Is there any solution?

The best solution is to use ISDN, directly, or via a SIP service provider.

Otherwise, your PSTN provider needs to support answer supervision. I believe Asterisk only supports the use of polarity reversals for this.

This must be explicitly enabled in Asterisk, as otherwise calls on lines that don’t support it will never appear answered.

This feature is more likely to be available on business tariffs than domestic ones.

Also note your problem is not the same. The OP did not have direct access to the PSTN line from Asterisk, whereas you do. He had the added problem that his hardware may not have supported answer supervision, even if the PSTN provider did.

1 Like