Skip to content

Get audio stream "424 Failed Dependency" error #3

@hoilo

Description

@hoilo

The getAudioStream function fails with a request and does not return a stream.

public getAudioStream(source: string, participantId: number) {
    return this.fetch!.get(
      '/callcontrol' + `/${source}` + '/participants' + `/${participantId}` + '/stream',
      {
        responseType: 'stream',
      },
    );
  }

I use the source and id that I get as part of the execution of the requestUpdatedEntityFromWebhookEventfunction

this.externalApiSvc
                        .requestUpdatedEntityFromWebhookEvent(wsEvent)
                        .then((res) => {
                            const participantData: CallParticipant = res.data;
                            this.updateParticipant(dn, parseFloat(id), participantData, wsEvent.event.entity);
                            console.log(chalk.green("📞 participantData:"), participantData);
                            /**
                             * handle here updated participants
                             */
                            const participant = this.getParticipantOfDnById(dn, parseFloat(id));
                            if (!participant || !this.externalApiSvc.connected) {
                                console.log(chalk.yellow(`participant not found by ${dn} ${parseFloat(id)}`));
                                return;
                            }

                            if (participantData.status === PARTICIPANT_STATUS_CONNECTED) {
                                //GET AUDIO STREAM HERE
                                const response = await this.externalApiSvc.getAudioStream(dn, participant.id!);
                            }

                        })
                        .catch((error) => {
                            console.error(chalk.red("❌ Error fetching participant data:"), error);
                        });

In the error text I see that dn and id are correct. The link was correct for receiving the stream.
In my case dn is the Extension number, not the application name. I specified in the settings of my API application which extension to use (the field Set extensions that are allowed for control and monitoring.).
I just need to record conversations to a file.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions