minimumHeaders function

bool minimumHeaders()

Implementation

bool minimumHeaders() {
  List<String> mandatoryHeaders = <String>[
    'from',
    'to',
    'call_id',
    'cseq',
    'via'
  ];

  for (String header in mandatoryHeaders) {
    if (!message.hasHeader(header)) {
      logger.debug(
          'missing mandatory header field : $header, dropping the response');

      return false;
    }
  }

  return true;
}