0

I am trying to retrieve caller phone number in the Flex plug-in. Using the caller phone number, I need to change the URI of the CRMContainer.

I have tried following methods but can't find caller phone number.

First method: function parameter task does not have caller phone number.

flex.CRMContainer.defaultProps.uriCallback  = task => {
  if (!task) {
    return 'http://localhost:4000'
  }

  return 'http://localhost:4000/searchresults?type=ALL&status=ANY&phoneNumber=(213)777-8888&query='

}

Second method: function parameter payload does not have caller phone number.

flex.Actions.addListener("beforeAcceptTask", payload => {
  flex.CRMContainer.defaultProps.uri = 'http://localhost:4000/searchresults?type=ALL&status=ANY&phoneNumber=(213)777-8888&query='
});

Third method: function parameter conn does not have caller phone number.

    manager.voiceClient.
    addListener('incoming', conn => {
      flex.CRMContainer.uri  =  'http://localhost:4000/searchresults?type=ALL&status=ANY&phoneNumber=(213)777-8888&query='
  })

Any help is appreciated.

Thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
goom
  • 3
  • 2

1 Answers1

0

Did you trying looking at the payload:

payload.task.attributes specifically:

payload.task.attributes.from ?

Alan
  • 10,465
  • 2
  • 8
  • 9