libwebphone icon indicating copy to clipboard operation
libwebphone copied to clipboard

Add getCustomHeaders to lwpCall

Open silviofernandesdeveloper opened this issue 2 years ago • 0 comments

I added a method in lwpCall to return the list of custom headers from a call as I needed to implement a logic where calls tagged with a certain header will be answered automatically.

if (currentCall.isInProgress()) {
  const customHeaders = currentCall.getCustomHeaders()
  if (customHeaders && customHeaders['X-IntegratedCall'] === 'true') {
    return currentCall.answer()
  }
}