/*
 * dlg_no.vdl $Header: dlg_no.vdl, 4, 29.09.2009 15:28:39, Esther Bergter$ $Date: 29.09.2009 15:28:39$
 *
 * Diese Version empfaengt nur Fax, kein Sprachdialog
 */

// *********************************************************************
// Adapt local language configuration here ...
//
// What's my Dialoge Language   0=de, 1=us, 2=it, 3=fr, 4=es
#define MY_LANGUAGE 0

// What additional languages can I speak (excluding MY_LANGUAGE)
// CAN_de, CAN_us, CAN_it, CAN_fr, CAN_es
#define CAN_us

// Adapt local language configuration above
// *********************************************************************

#include "lib.h"

int nr_of_additional_languages;      // Number of defined CAN_xx
int additional_language;  // if nr_of_languages = 1 the code of this Language
                          // otherwise -1

/***********************************************
 * HERE IS THE IMAP/LDAP CONFIGURATION SECTION *
 ***********************************************/

#include "extension.vdl"

/**********
 * Main() *
 **********/

void Main()
{
  BOOL bLoop;

  bVideo = FALSE;
  bSMS   = FALSE;

  GetConnectionData(&ConnectionData);
  GetExtensionData(ConnectionData.szDialedExtension, &ExtensionData, EXT_LINE);
  
TraceS ("Fax only");

  switch(GetEvent(1))
  {
  case EVENT_VIDEO:
    bVideo = TRUE;
    break;

  case EVENT_SMS:
    bSMS = TRUE;
    break;
  }

  if (ExtensionData.bIsUser || ExtensionData.bIsGroup || ExtensionData.bAcceptAll)
  {

      AcceptCall();

      if (bSMS)
      {
        ReceiveSMS();
        exit(0);
      }

      DoSleep(1000); // Pause fuer H.323 - Telefone

      if (ExtensionData.bIMAPError)
      {
        InitLanguages();
        SayTTSC("L D A P oder I M A P Fehler.");
      }

      ReceiveFax();
  }
  else 
  {
      RejectCall();
  }
  
  exit(0);
}
