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

AGIChannel and LastReply #120

Closed
orastarter opened this issue Nov 10, 2017 · 9 comments · Fixed by #187
Closed

AGIChannel and LastReply #120

orastarter opened this issue Nov 10, 2017 · 9 comments · Fixed by #187
Labels
bug A bug in the project that needs to be fixed. FastAGI Issue specific to AGI.

Comments

@orastarter
Copy link
Contributor

orastarter commented Nov 10, 2017

Hi!
I have faced with bad situation. AGIChannel.LastReply could contain AGIReplay for another AGICommand. I think it is much better to remove field agiReply from AGIChannel and use return value from method SendCommand.
Thank you!

@skrusty
Copy link
Collaborator

skrusty commented Nov 12, 2017

In what context are you using LastReply? I've not seen any issues myself during normal operation. Are you trying to manually query some result?

@orastarter
Copy link
Contributor Author

orastarter commented Nov 12, 2017

I haven't used LastReply. I have faced with situation when i sent "Exec Dial" and expected result of this command but i have got result of the command "get variable" which I have sent next. I have removed field and rewrite logic to use return value of SendCommand and problem was left.

@zendassie
Copy link

zendassie commented Sep 20, 2018

We've actually come across this issue. We fire just over 6 million events a month, of which about a thousand had this issue. It's when we push high volumes that this happens.

Essentially this is how we retrieved parameters:

public static string GetVariable(AGIChannel channel, string name)
{
    channel.SendCommand(new AsterNET.FastAGI.Command.GetVariableCommand(name));
    if (channel.LastReply.ResultCode != 1)
        return null;
    return channel.LastReply.Extra;
}

We've actually ended up replacing this with a REST call to Asterisk (when fetching multiple parameters we simply fetch them all in parallel).

I would however love to know how the above issue occurs?

@Deantwo Deantwo added FastAGI Issue specific to AGI. bug A bug in the project that needs to be fixed. labels Sep 20, 2018
@orastarter
Copy link
Contributor Author

I have changed 2 files - AGIChannel and AGIScript. Please check this fix in your side.
FastAGI.zip

@skrusty
Copy link
Collaborator

skrusty commented Sep 21, 2018

@orastarter please submit changes as a PR and not a ZIP file. We can't accept any code submitted in any other way then a PR using git.

@orastarter
Copy link
Contributor Author

@skrusty, how can i make PR? I have tried to create branch but i can't publish it:
Error encountered while publishing branch to the remote repository: Response status code does not indicate success: 403 (Forbidden).

@Deantwo
Copy link
Collaborator

Deantwo commented Sep 24, 2018

@orastarter, you need to first make your own fork, then make your changes on that fork. Once the fork has your changes you then make a pull request from it to this main repository

@orastarter
Copy link
Contributor Author

@Deantwo Thank you! Next step find VS2017 :)

orastarter added a commit to orastarter/AsterNET that referenced this issue Sep 24, 2018
@orastarter
Copy link
Contributor Author

@Deantwo and @skrusty - done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug in the project that needs to be fixed. FastAGI Issue specific to AGI.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants