1

I need to create a channel using ARI and put it into stasis before dialling the extension, which according to the documentation is what should be happening. But as soon as I create the channel it starts ringing and goes into stasis only after being answered.

I have a testing extension configured in sip.conf which I've registered with a softphone, this is the extension I'm creating a channel to.

[101]
 type = friend
 username = 101
 secret = 1234
 context = from-internal
 host = dynamic

1 Answer 1

0

Asterisk have two "legs", incoming and outgoing.

Ringing is first one.

So you have put it in stasis before ringing, after that put in stasis second leg on answer.

You can do it using dial via dial - Local channel.

For that need use dialstring like Local/number@stasis_out and in dialplan write like this

[stasis_out]
exten => _.,1,Stasis(out-app)

exten => h,1,Hangup()

Now you get it in stasis and can do additional Dial for call out.

Please note, stasis app have alot of perfomance issues, if you application expected be hi-load, better use dialplan.

10
  • After changing the dialstring like suggested, the stasis websocket can't connect for some reason now. Also I noticed the extension@context format only works for Local, not SIP. Will this work for outside calls as well? The local extension is really just for testing purposes, in the end I need this to be able to make calls to the outside.
    – Nicolas
    Oct 4, 2019 at 12:34
  • Yes, you should use Local, not SIP. WHY you think sip should use dialplan? This site is for questions, not for manuals. Check some book about asterisk.
    – arheops
    Oct 4, 2019 at 13:58
  • 2
    I'm asking it here because asterisk documentation is absolute and utter crap.
    – Nicolas
    Oct 4, 2019 at 14:05
  • This setup works if I put a Dial() into the context before the Stasis(), but then it defeats the purpose. If it's just the Stasis(), the applications doesn't register.
    – Nicolas
    Oct 4, 2019 at 14:59
  • No, it should go stasis, you should get notification about that and all should freeze. After that in stasis control app do exec dial.
    – arheops
    Oct 4, 2019 at 18:30

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.