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

Unable to get the Dialstatus value #13

Open
iliesh opened this issue Aug 23, 2021 · 0 comments
Open

Unable to get the Dialstatus value #13

iliesh opened this issue Aug 23, 2021 · 0 comments

Comments

@iliesh
Copy link

iliesh commented Aug 23, 2021

Trying to get the dialstatus value for the Dial command by using the following code:

func main() {
	agi.Listen(":4753", handler)
}

func handler(a *agi.AGI) {
	defer a.Close()

	a.Exec("Dial", "PJSIP/I11")

	dStatus, err := a.Get("DIALSTATUS")
	if err != nil {
		fmt.Printf("unable to get the dialstatus variable, error: %s\n", err.Error())
	}
	fmt.Printf("Dial Status: %v\n", dStatus)
}

Here I'm calling ext 11 and just before answering the call, I'm dropping it and expecting to get the "NOANSWER" status, but I'm getting an error:

'unable to get the dialstatus variable, error: hangup'

I believe that this is because Asterisk is sending hangup first, and then the Dial Status.

Regards,

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

1 participant