10-02-2023 07:24 AM - last edited on 10-05-2023 02:40 AM by Shahzad_Ismail
I’m trying to make a phone-to-app call. On ICE event of incoming PSTN call I response SVAML :
{
"action": {
"name": "ConnectConf",
"conferenceId": "InAppToPSTN",
"moh": "ring"
}
}
Then I use the Voice / Calling API ConferenceCallout request to add the InApp client to the same conference:
$this->httpClient
->requestAsync('POST', 'https://calling.api.sinch.com/calling/v1/callouts', [
RequestOptions::HEADERS => [
'x-timestamp' => $now,
'Authorization' => "application {$appId}:{$authorizationSignature}",
],
RequestOptions::JSON => [
'method' => 'conferenceCallout',
'conferenceCallout' => [
'destination' => [
'type' => 'username',
'endpoint' => 'user-698',
],
'conferenceId' => 'InAppToPSTN',
'cli' => '+E.164',
'maxDuration' => 3600,
'enableAce' => true,
'enableDice' => true,
],
])
->then(function(ResponseInterface $response): ?array {
if ($response->getStatusCode() === 204) {
return null;
}
return json_decode($response->getBody()->getContents(), true);
});
I removed the generation of $authorizationSignature to save space.
The problem is that I am not receiving ACE and DICE callbacks of second call leg.
Solved! Go to Solution.
10-04-2023 02:29 AM
No, but doing this will enable you to proceed I believe:
1: Dial your purchased number (DiD) and put the PSTN leg into the conference with connectConf
2. Use conferenceCallout to put the inApp leg into the conference
3. Verify your participants in the conference with Get Conference Info GET https://calling.api.sinch.com/calling/v1/conferences/id/{conference_name}
in this case the conference_name being InAppToPSTN
{
"participants": [
{
"cli": "+46111111111",
"id": "XXXXXXX-7859-422e-8d14-XXXXXXXXXXXX",
"duration": 22,
"muted": false,
"onhold": false
},
{
"cli": " +46222222222",
"id": "XXXXXX-c1da-49b7-b1e1-XXXXXXXXXXXX",
"duration": 11,
"muted": false,
"onhold": false
}
]
}
4. When you recieve the DICE for the PSTN leg you can run Get Conference Info to see if all participants have left, if the mxp leg has not hung up you can issue Kick participant
DELETE https://calling.api.sinch.com/calling/v1/conferences/id/{confererence_name}/{callid}
{
"participants": []
}
If the participants array is empty then the conference is finished.
10-03-2023 10:14 AM
Hi
Sorry for the delay in responding here.
Currently we do not support ACE or DICE for connectConf towards an inApp destination.
If this changes I will update on this thread.
We will alter the documentation to make this a bit clearer.
I am checking if
10-04-2023 01:23 AM
Hi!
Thank you for your answer.
Is there any other way to make phone-to-app call?
10-04-2023 02:29 AM
No, but doing this will enable you to proceed I believe:
1: Dial your purchased number (DiD) and put the PSTN leg into the conference with connectConf
2. Use conferenceCallout to put the inApp leg into the conference
3. Verify your participants in the conference with Get Conference Info GET https://calling.api.sinch.com/calling/v1/conferences/id/{conference_name}
in this case the conference_name being InAppToPSTN
{
"participants": [
{
"cli": "+46111111111",
"id": "XXXXXXX-7859-422e-8d14-XXXXXXXXXXXX",
"duration": 22,
"muted": false,
"onhold": false
},
{
"cli": " +46222222222",
"id": "XXXXXX-c1da-49b7-b1e1-XXXXXXXXXXXX",
"duration": 11,
"muted": false,
"onhold": false
}
]
}
4. When you recieve the DICE for the PSTN leg you can run Get Conference Info to see if all participants have left, if the mxp leg has not hung up you can issue Kick participant
DELETE https://calling.api.sinch.com/calling/v1/conferences/id/{confererence_name}/{callid}
{
"participants": []
}
If the participants array is empty then the conference is finished.
10-11-2023 05:07 AM
Sorry, I didn't understand the first step. Can you explain more, please?
10-13-2023 03:22 AM
Hi
Sure. You are already doing this part.
When you issue
{
"action": {
"name": "ConnectConf",
"conferenceId": "InAppToPSTN",
"moh": "ring"
}
}
You will have recieved a call-id in the ICE
event: 'ice',
callid: '9ae753-nnnn-481c-nnnn-8dc81c1f8287',
callResourceUrl: 'https://calling-euc1.api.sinch.com/calling/v1/calls/id/9ae753-nnnn-481c-nnnn-8dc81c1f8287',
timestamp: '2023-10-04T08:47:56Z',
version: 1,
userRate: { currencyId: 'USD', amount: 0.2 },
cli: '4611111111',
to: { type: 'did', endpoint: '+4622222222 },
domain: 'pstn',
applicationKey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
originationType: 'PSTN',
rdnis:
In the ICE is contained the call-id 9ae763... in the example above
It will be used in the portion of the call-id in kick participant.
For example:
DELETE https://calling.api.sinch.com/calling/v1/conferences/id/{myconference}/{9ae753-nnnn-481c-nnnn-8dc81c1f8287} for the pstn leg
10-13-2023 05:35 AM
Yes, I've already done it. I have only problem with `ace` and `dice` callbacks for call that I initiate by `conferenceCallout` command. I need to control this call on my backend
10-26-2023 08:17 AM
Hi Roland_Ian!
Any updates on my issue?
Is there any other way to implement this call to get all the events in webhooks?
10-26-2023 11:38 PM
Hi
Unfortunately when the destination is type "username" in the Voice / Calling API ConferenceCallout
enableACE and enableDICE are not supported for this type currently.
I will request an update to the documentation to make this clearer.
To monitor the inApp conference leg as mentioned before I would recommend.
Verify your participants in the conference with Get Conference Info, implementing logic to kick from the conference once you have verified one leg has left the conference.
This is the current recommended solution to manage the inApp conference leg.
10-30-2023 04:53 AM
Hi!
I have a problem with VOIP push notifications. They don't come to the device.
I'm executing a conferenceCallout command with the username in the destination:
$this->httpClient
->requestAsync('POST', 'https://calling.api.sinch.com/calling/v1/callouts', [
RequestOptions::HEADERS => [
'x-timestamp' => $now,
'Authorization' => "application {$appId}:{$authorizationSignature}",
],
RequestOptions::JSON => [
'method' => 'conferenceCallout',
'conferenceCallout' => [
'destination' => [
'type' => 'username',
'endpoint' => 'user-698-staging',
],
'conferenceId' => 'InAppToPSTN',
'cli' => '+E.164',
'maxDuration' => 3600,
],
])
->then(function(ResponseInterface $response): ?array {
if ($response->getStatusCode() === 204) {
return null;
}
return json_decode($response->getBody()->getContents(), true);
});
From the Voice logs in your dashboard I see that the connectMxp command is called and immediately the call ends with Failed status and Congestion reason. Call id - 1a194bf5-f909-4d5f-b867-fa2b852e0689