Sarkis Arutiunian
Sarkis Arutiunian

Reputation: 1291

Call from app to phone (web), app. with multi linked numbers

My use case is to be able to make a call from web interface to any number. It all seams to work fine.

get jwt > login and get app. instance from ConversationClient > make a call using app.callPhone(number) > GET request to answer_url.

And this is where I stuck, it works if I will hardcode one of the linked numbers, like:

return [{
      action: 'connect',
      from: 'number',
      endpoint: [{
        type: 'phone',
        number: query.to
      }]
    }]

but how I can pass query.from? or somehow decide on client side from which number I want to call?

Because each app can be linked to many numbers, and I don't want to create an app per number, but don't see any other solution.

Upvotes: 0

Views: 80

Answers (1)

Sam Machin
Sam Machin

Reputation: 3233

I believe at the moment the client only supports sending a single string from the browser to the application, which you're using for to but as MrO hinted you can pass anything as an identifier here. I would suggest putting the to and from in the string separated by a comma eg: 12125551212,14155551000 and the splitting that in your answerUrl handler.

Upvotes: 2

Related Questions