Playback after answer channel

hello
see :

[test]
exten =>100,1,Answer()
exten =>100,n,Dial(DAHDI/g0/Mobile-number)
;-- — – after answer(pickup) mobile run : – -- –
exten => p,n,Saydigits(123456789) ;==> play for mobile
exten => p,n,NoOp(pickup)
exten => p,n,Hangup()
; – -- – else no answer then run : — - - –
exten => na,n,NoOp(no answer)
exten => na,n,Hangup()

------*
mean : call 100, dial mobile number and after pickup phone saydigits and if no answer, then noop ‘no answer’.
--------*
I have a card analog digium.
I do not have a Gateway.

Tank you

For playing a file when the remote party picks up, check out the A option of the Dial application.

For checking if the call was answered or not, check out DIALSTATUS variable after the Dial application.

If you just want to play a file you can use this:

exten =>100,n,Playback(file-name-no-spaces);

Then just put a file in the /var/lib/asterisk/sounds
File name would be “file-name-no-spaces.wav” not you do not need to include .wav in above dial plan command.

Make sure file is in wav or other format that asterisk will play. If its wrong format asterisk will tell you on cli.

He’s trying to play on the destination channel, not the source channel. The problem is not the choice about the application but the misunderstanding that Dial returns on Answer, when it actually only returns on the hangup of one of the parties.

[quote=“dejanst”]For playing a file when the remote party picks up, check out the A option of the Dial application.

For checking if the call was answered or not, check out DIALSTATUS variable after the Dial application.[/quote]

tanks

You can a example?

Examples of using DIALSTATUS are in the documentation.

you see :

[test]
exten => 100,1,Answer()
exten => 100,n,Dial(DAHDI/g0/Mobile-number)
exten => 100,n,GotoIf($[${DIALSTATUS} = ANSWER ]?yes:no)
exten => 100,n(yes),Saydigits(123456789)
exten => 100,n,NoOp(pickup)
exten => 100,n,Hangup()
exten => 100,n(no),NoOp(no answer)
exten => 100,n,Hangup()

It does not work!!
please Help Me :frowning:

In what way doesn’t it work? That dialplan should say the digits towards the caller. If you want to say them to the callee, you must do that using options on the Dial application, as the call will no longer be up to the callee hen Dial exits.

You have already been told one Dial option that should be usable, for some cases. If you need to do something more general, you will need to use the goto, subroutine, or macro options on Dial.

:frowning:

It does not work :frowning:

[call]
exten => 10,1,Answer()
exten => 10,2,Dial(DAHDI/g0/Mobile-Number, ,G(call,1,3))
exten => 10,3,GotoIf( $[ ${DUALSTATUS} = ANSWER ] ? yes : no)
exten => 10,4(yes),Goto(mYes,1,1)
exten => 10,5,Hangup()
exten => 10,6(no),Goto(mNo,1,1)
exten => 10,7,Hangup()

[mYes]
exten => 1,1,NoOp(Dial Status : ${DIALSTATUS})
exten => 1,n,Playback(welcome)
exten => 1,n,NoOp(Uniqueid : ${UNIQUEID})
exten => 1,n,NoOp(Answer Mobile)
exten => 1,10,Hangup()

[mNo]
exten => 1,1,NoOp(Dial Status : ${DIALSTATUS})
exten => 1,n,NoOp(No Answer Mobile)
exten => 1,10,Hangup()

please help me :cry:

See :

It works :

[eee]
exten => 100,1,Answer()
exten => 100,2,Originate(SIP/6060,exten,xx,100,1)

[xx]
exten => 100,1,Wait(5)
exten => 100,2,Saydigits(123456789)
exten => 100,3,Hangup()

==> after pickup sip/6060 , run wait and saydigits But it does not work : :frowning:

[eee]
exten => 100,1,Answer()
exten => 100,2,Originate(DAHDI/g0/Mobile-number,exten,xx,100,1)

[xx]
exten => 100,1,Wait(5)
exten => 100,2,Saydigits(123456789)
exten => 100,3,Hangup()

help me PLZ

If it is sending the message early on dahdi, it is because either the service provider isn’t providing answer supervision (quite likely) or Asterisk hasn’t been configured to wait for it (default setting, because of the former caveat).

tnx

Can you further explain ??

Many analogue lines don’t tell the caller when a call has been answered. As such, unless told otherwise, Asterisk assumes such calls are answered immediately. If you are sure that your service provider reverses the battery on answer, you can tell Asterisk to wait for this. If they don’t actually do this, and you configure for it, the call will be assumed to have never been answered.

TNX

I’m working on it
until later