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

callback is a required parameter #237

Open
enqbator opened this issue Jan 19, 2023 · 2 comments
Open

callback is a required parameter #237

enqbator opened this issue Jan 19, 2023 · 2 comments

Comments

@enqbator
Copy link

I am getting "callBack is a required parameter" when trying to create a call. I had just updated the plivo nuget package and this parameter was not required before. There doesnt seem to be any indication of what exactly this parameter is or why its needed in any of the documentation.

This is the call that I am making:

var result = await api.Call.CreateAsync(
    to: new List<string> { to },
    from: from,
    answerMethod: "GET",
    answerUrl: answerUrl,
    hangupUrl: hangupUrl,
    hangupMethod: "GET",
    machineDetection: "hangup",
    machineDetectionTime: 2000
);
@manjunath-plivo
Copy link
Contributor

manjunath-plivo commented Feb 7, 2023

@enqbator Please use Calls.Create function instead of Calls.CreateAsync.
As you are using Async function for making outbound call, callback_url is mandatory as make call function response will be posted to this url.

Refer this https://www.plivo.com/docs/voice/api/call#make-a-call
Every request can be made async using callback_url, ref: https://www.plivo.com/docs/voice/api/request#asynchronous-request. In this SDK, separate functions are written for async and normal request.

Ex:
make a call
Async function name: Calls.CreateAsync
without async : Calls.Create

Retrieve details of all calls:
Async function name: Call.ListAsync
without async : Calls.List

@enqbator
Copy link
Author

enqbator commented Feb 7, 2023

For what I am doing, I don't necessarily need the api id or that response though. I get all I need from the answer and hangup callbacks. I would like to take advantage of the c# await/async but not waste the resources getting this message and api id that don't really tell me anything important.

It just doesnt seem like this should be required. In fact, until the recently (after 5.9.0), callBack was not required. I reverted back to 5.9.0 to avoid this error.

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

2 participants