cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I have an issue with conferenceCallout. enableAce and enableDice params don't work

valentinpazushko
Contributor

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.

1 ACCEPTED SOLUTION

Accepted Solutions

Roland_Ian
Employee
Employee

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

  • The ICE from this will arrive with call-id

2. Use conferenceCallout to put the inApp leg into the conference  

  • You call Id will be returned form the API call.

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.

 

Roland-Ian Clothier, Developer Support Engineer

View solution in original post

10 REPLIES 10

Roland_Ian
Employee
Employee

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 

Roland-Ian Clothier, Developer Support Engineer

Hi!
Thank you for your answer.
Is there any other way to make phone-to-app call?

Roland_Ian
Employee
Employee

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

  • The ICE from this will arrive with call-id

2. Use conferenceCallout to put the inApp leg into the conference  

  • You call Id will be returned form the API call.

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.

 

Roland-Ian Clothier, Developer Support Engineer

Sorry, I didn't understand the first step. Can you explain more, please?

Roland_Ian
Employee
Employee

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.

https://developers.sinch.com/docs/voice/api-reference/voice/tag/Conferences/#tag/Conferences/operati...

 

For example:

DELETE https://calling.api.sinch.com/calling/v1/conferences/id/{myconference}/{9ae753-nnnn-481c-nnnn-8dc81c1f8287} for the pstn leg 

 

 

Roland-Ian Clothier, Developer Support Engineer

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

valentinpazushko
Contributor

Hi Roland_Ian!
Any updates on my issue?
Is there any other way to implement this call to get all the events in webhooks?

Roland_Ian
Employee
Employee

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.

Roland-Ian Clothier, Developer Support Engineer

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