Asterisk Dial Application

I hope this message finds you well. I am currently working on an Asterisk, and I have encountered a scenario when the call is dialed from asterisk to some PSTN/ SOFTPHONE/ Some extension the other party receive call and the connection between these are now established now i want that my code execute after the DIAL application but it didn’t until the caller hang up. i’ve tried many option of dial application like (‘g’,‘G’ etc) but the desired functionality is not achieved.
exten => 8080,1,Dial(PJSIP/Outside1,30)
same => n,NoOp(continue…1)
same => n,Playback(Welcome)
same => n,Hangup()
after the Dial application dials the outside it stop remaining code to execute until the call hangup

That’s what it does. The ‘g’ option allows the dialplan to continue AFTER the call is hung up.

What are you ACTUALLY trying to achieve (in detail)?

And in terms of true requirements, not implementation details.

I want to achieve simple functionality that is suppose there are two phones (phone A that is my phone ) and phone B (some other phone). phone A calls to phone B (using Dial application) and phone B answer the call “now my requirement start” when phone b answer the call i want to play some audio or IVR which will be running from phone A side. But the problem is that whenever the phone B receive the call the further code execution is stopped until he hangup the call i want to do this in an ongoing call.

And phone A would do what when the IVR or playback is happening?

Phone A will maintain the call session until the playback is not ended after this it will end the call

And… hear what? You need to be very very specific with requirements.

ok let me explain it further the IVR will be played from Phone A side and phone B will listen to it. and the response of phone b will be hear by phone A like there is a conversation between two phone in which phone A ask questions and phone B answers the question.

That’s going to be quite complex. I think it can be done using Originate and ChanSpy, but there are sufficient steps in the process than I’m likely to make a mistake. You may be able to use a pre-dial handler, to set everything up, or you may have to use an answer subroutine.

There may be ways with conferences, but clearing them down when A or B hangup would need considering.

considering Originate is good option but according to my knowledge or it is not suitable for my specific requirements and ChanSpy also have other use cases. pre-dial didn’t work because it happen before the callee pickup the call and answer subroutine i’ve also tired it. In answer subroutine when the callee answer the call it hear the some playback but at that time the caller is still ringing and when playback end the session between these two create and started

You can’t do it in the callback/subroutine. You use these to trigger the Originate.

This isn’t a requirement that I’ve seen before, so you are going to have to experiment on the details.

ok i’ll explain my requirement in very simple way.
my requirement is dial calls to some PSTN/Softphones and when ever they answer the call they will hear IVR. that’s it

The goal is:

  1. Phone A calls Phone B
  2. Phone B answers and hears an IVR played from Phone A
  3. The IVR asks Phone B some questions
  4. Phone B responds with DTMF OR Speech recognition to the IVR questions

This version can often be done without Dial, just using Originate.

In this version the IVR is implemented by phone A, not by the PABX.

You are coming up with different requirements and I’m getting lost.

my bad! haha this convo seems like client and requirement engineer. ok i’ll try it by Originate the first requirement and i think so it will work. Thankyou so much.
can you elaborate more how your 2nd answer (In this version the IVR is implemented by phone A, not by the PABX.) this one ?

You say the following:

let me clear this actually i was trying to say that IVR will me played from caller side that is phone A
and also Originate solve the first requirement :smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.