Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't able to place calls properly using Create() and Dial () #122

Open
mashaikx13 opened this issue Jul 15, 2020 · 2 comments
Open

Couldn't able to place calls properly using Create() and Dial () #122

mashaikx13 opened this issue Jul 15, 2020 · 2 comments

Comments

@mashaikx13
Copy link

On answering the channel when a call enters the Stasis App I create a new channel for "SIP/8312453028" with app "test" and then place the dial function to initiate the call with newly created channel id. I get the call on SIP/8312453028, then I answered but there are no media between both clients.
Workflow is given below:

orig := &ari.ChannelCreateRequest{Endpoint: "SIP/8312453028", App: "test"}
channel, err1 := h.Create(*orig)
if err1 != nil {
log.Error("Failed to Create Channel", "error", err1)
return
}
err2 := channel.Dial(channel.ID(), 30)
if err2 != nil {
log.Error("Failed to Dial Call", "error", err2)
return
}

return

The console error I received:

EROR[07-15|16:04:20] failed to answer call error="Non-2XX response: 412 Precondition Failed"

It would be helpful if you guide more about it. Thanks.

@arudyavsky
Copy link

I have the same problem. Can anyone provide a complete basic call example? Eg, call from 1000 to 1001. Thanks.

@Ulexus
Copy link
Member

Ulexus commented Sep 7, 2023

Using Create-Dial is tricky, because many things are not done for you. I recommend using Originate instead. If you need a two-stage (create, attach a bunch of listeners, then execute), use StageOriginate.

Regardless, the log error in the above example doesn't correspond with the code. It reads "failed to answer call", but there is no corresponding code. One cannot answer a dialed channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants