How to hang up the call whent it's status is in queued state(ringing or initiated)? None of the codes below have any effect on call, call continues to ring untill receiver picks up.Sometimes when agent realizes they are dialing wrong number they need a way to hangup the call in the middle of ringing.
PHP code
$client->calls($callRecord->call_sid)->update([
'status' => 'canceled'
]);
$client->calls($callRecord->call_sid)->update([
'status' => 'completed'
]);
$client->calls($callRecord->call_sid)->update([
'url' => 'mywebsite.com/tw-hangup'
]);
See the following Twilio Documentation:
Voice API: Call (the last paragraph is most relevant)
https://www.twilio.com/docs/voice/api/call
When you redirect an active call to another phone number, Twilio creates an entirely new Call instance for that new phone number. The original call is the parent call, and any additional number dialed establishes a child call. Parent and child calls will have uniquely identifying Call SIDs.
Note that any parent call currently executing a is considered in-progress by Twilio. Even if you've re-directed your initial call to a new number, the parent call is still active, and thus you must use Status=completed to end it.
Unanswered child calls cannot be canceled via the REST API, but the parent call can be modified to point to new TwiML. This action will end the child call.
Related
Is there an endpoint in Slack API to detect a user (AKA me) is in a call? getPresence just returns 'active' and 'away' which is not helpful - I can be active but not in a call. I tried getting user status, that is of no help either
There's no API that will return that information at this time. The calls.info method would return a list of users in a specific call but you'd need to know the call id for that. Something as simple as knowing if any given user is on a call would be a great feature request for the users.getPresence method. Happy to pass that along!
In the below widget, the field NUMBER TO CALL cannot be edited.
So, how do we set the value of the phone number that needs to be called
You can't change the NUMBER TO CALL in Twilio Studio for this case.
The {{contact.channel.address}} value comes in as the To parameter for the Trigger widget when you make the POST request to Studio's REST API.
So, you'll have to pass the number when you trigger the flow.
Docs: (https://www.twilio.com/docs/studio/user-guide#rest-api)
When using the GraphAPI's Delta Query for /users, we have noticed that the assignedPlans property is only returned on the first call to /delta, but on all subsequent calls that use the deltaLink returned on the previous call, the property is consistently missing.
The API call we make on the first call:
GET https://graph.microsoft.com/v1.0/users/delta?$select=id,mail,givenName,surname,userType,displayName,givenName,userPrincipalName,businessPhones,jobTitle,mobilePhone,officeLocation,department,companyName,assignedPlans
This call's response does include the assignedPlans property for users, but on subsequent calls (using the deltaLink) - this property is missing.
Is this a known issue with the Delta Query?
Thank you!
When submitting a transaction via 'composer-rest-server' I encapsulate the input parameters in form of JSON-body inside requests. However, I always receive the same JSON-String inside the Body-Response. Is there a way to return some response string from transaction written with JS that will be propagated to the caller inside Response-Body? How is the reverse communication to the caller foreseen in the composer? -- Thx.
This is not currently possible with Hyperledger v0.6 -- there's no way to synchronously propagate return value to the submitter of a transaction.
I need to modify current in-progress call.
if A calls B, they are connected and have a talk, I need to redirect B to some Twiml URL, and to disconnect A from call (I can do this via JavaScript SDK .diconnect() function, since I am the "A" caller). I am using an example from Twilio docs (php SDK v4.x):
$call = $client->account->calls->get($callsid);
$call->update(array(
"Url" => "http://path-to-twiml.php",
"Method" => "POST"
));
but nothing happens. Is it possible to somehow do what I need without using Conference Twilio options?
PS: adding "Status" => "complete" parameter to update options causes disconnect for both sides of a call, since I need to disconnect only 1 (the one who initiated the call) and to leave other (redirected to specific twiml url)
Twilio evangelist here.
From the code that you posted, I'm guessing that the callsid you are modifying is actually Caller A, not Caller B. In your scenario, A and B are each going to have their own seperate callsid, where Caller A is the "parent" and Caller B is the "child".
To get the child sid, you can include a URL in the statusCallback parameter in your <Dial> verb which will get requested when Caller B answers. The callsid parameter of this request is Caller B's sid. You'll also receive a parameter named parentCallSid which is Caller A's sid and that lets you correlate the child leg (Caller B) with the parent leg (Caller A).
Once you have child sid, you can modify it using the PHP library.
Hope that helps.