О немО себе[code]/maps/
[code] | ed_line.c
kMaps
4D
  SparseTileLayer.js
  auto_registrator_cc.c
  ed_line.c
  array-speed.php
  ed_line.cc.c
  codeZ.php
  time.php
  auto_registrator.c
 
#include "stdafx.h"
#include "l2_lapd.h"
#include "../siglib/sys_signals.h" // auto include 
#include "../siglib/release_types.h"

 //lua function RR(a)return a;end;
 //lua function CL(a)return a;end;

#define CS_CALL_CLEAR 0


static LPCSTR EDSS_TIMER_NAME[]=
{
  
"T301",
  
"T302",
  
"T303",
  
"T304",
  
"T305",
  
"T306",
  
"T308",
  
"T309",
  
"T310",
  
"T313",
  
"T314",
  
"T316",
  
"T317",
  
"T318",
  
"T319",
  
"T321",
  
"T322"
};

static 
WORD EDSS_TIMER_INFO[]=
{
  (
1),// EDSS_T301
  
(15),// EDSS_T302
  
(30),// EDSS_T303
  
(15),// EDSS_T304
  
(4),// EDSS_T305
  
(30),// EDSS_T306
  
(4),// EDSS_T308
  
(90),// EDSS_T309
  
(20),// EDSS_T310
  
(4),// EDSS_T313
  
(4),// EDSS_T314
  
(120),// EDSS_T316
  
(90),// EDSS_T317
  
(4),// EDSS_T318
  
(4),// EDSS_T319
  
(30),// EDSS_T321
  
(4),// EDSS_T322
};

#define EDT_SET2CP              T0+0
#define EDSS_RELTIMER           T1
#define EDSS_T303               T0+2
#define EDSS_T304               T0+3
#define EDSS_T305               T0+4
#define EDSS_T306               T0+5
#define EDSS_T308               T0+6
#define EDSS_T309               T0+7
#define EDSS_T310               T0+8
#define EDSS_T313               T0+9
#define EDSS_T314               T0+10
#define EDSS_T316               T0+11
#define EDSS_T317               T0+12
#define EDSS_T318               T0+13
#define EDSS_T319               T0+14
#define EDSS_T321               T0+15
#define EDSS_T322               T0+16


struct EDSS_LINE__ContextType
{
WORD    CallID;     // CallID
WORD    Orginate;     // Orginate
PWORD    TimerTimeOut;     // Timers timeout
char    Calling[0xFF];     // Call number
char    Called[0xFF];     // Self number
BYTE    BChannel;     // Used bchannel;
WORD    AdTalking;     // SipAD i am talking with;
WORD    DAdTalking;     // SipAD i am talking with;
BYTE    LinkedWith;     // Have sip twin;
struct CF_Connect    ConnectData;     // holds connect data;
WORD    BreakOnSetup;     // break on setup(due to lo channels);
enum CF_ReleaseType    BREAK_REASON;     // reason break;
WORD    TractReady;     // is voicetract ready;
WORD    VoiceConnected;     // is voice on;
WORD    TONP;     // TractOnEvent bitmask;
WORD    EnableDTMF;     // Enable DTMF on request;
time_t    StartTime;     // TalkStartTime;
WORD    DelayAlertTimer;     // Delay alert timer;
};
#define ThisProcess ((struct EDSS_LINE__ContextType*)(pContext->pContext))
#define This ((struct EDSS_LINE__ContextType*)shedule_pCurContext)


WORD PrintContext__EDSS_LINE(struct AU_BaseContextpContextcharpOutsize_t BufLen)
{    
size_t offset=0;
LPCSTR oREMOTE="REMOTE";
LPCSTR oTHIS  ="THIS";
{
sprintf(pOut+offset"<CallID data=\"%s|%d\"%s"ThisProcess->Orginate?oREMOTE:oTHISThisProcess->CallID"/>\r\n");
    
offset+=strlen(pOut+offset);};
{
sprintf(pOut+offset"<Calling data=\"%s\"%s"ThisProcess->Calling"/>\r\n");
    
offset+=strlen(pOut+offset);};
{
sprintf(pOut+offset"<Called data=\"%s\"%s"ThisProcess->Called"/>\r\n");
    
offset+=strlen(pOut+offset);};
{
sprintf(pOut+offset"<BChannel data=\"%d\"%s"ThisProcess->BChannel"/>\r\n");
    
offset+=strlen(pOut+offset);};
{
sprintf(pOut+offset"<AdTalking data=\"%d\"%s"ThisProcess->AdTalking"/>\r\n");
    
offset+=strlen(pOut+offset);};
{
sprintf(pOut+offset"<BreakOnSetup data=\"%d\"%s"ThisProcess->BreakOnSetup"/>\r\n");
    
offset+=strlen(pOut+offset);};
{
sprintf(pOut+offset"<VConn data=\"%d\"%s"ThisProcess->VoiceConnected"/>\r\n");
    
offset+=strlen(pOut+offset);};
{
sprintf(pOut+offset"<TractReady data=\"%d\"%s"ThisProcess->TractReady"/>\r\n");
    
offset+=strlen(pOut+offset);};
PrintAddr(siptmpBufThisProcess->ConnectData.Addr);
{
sprintf(pOut+offset"<connect addr data=\"%s:%d\"%s"siptmpBufThisProcess->ConnectData.Port"/>\r\n");
    
offset+=strlen(pOut+offset);}
{
sprintf(pOut+offset"<LinkedWith data=\"%d\"%s"ThisProcess->LinkedWith"/>\r\n");
    
offset+=strlen(pOut+offset);};

    return (
WORD)strlen(pOut);
}

// -- States for EDSS_LINE --
    // General states       
    
      
;
    
    
    
    
    
    
    
                       
    
    
    
            
    
    
    
    
    
    
    
    
    
    
    
    
    
    
enum EDSS_LINE__StatesEnum 
{
    
EDSS_LINE_State_EMPTY 0,     // empty
    
EDSS_LINE_State_LOCKED 1,     // LOCKED
    
EDSS_LINE_State_S_U0 2,     // UO Idle State
    
EDSS_LINE_State_S_U1 3,     // U1 Call initiated
    
EDSS_LINE_State_S_U2 4,     // U2 Overlap sending
    
EDSS_LINE_State_S_U3 5,     // U3 Outgoing call proceeding
    
EDSS_LINE_State_S_U4 6,     // U4 Call delivered
    
EDSS_LINE_State_S_U5 7,     // U5 Call present
    
EDSS_LINE_State_S_U6 8,     // U6 BAD STATE
    
EDSS_LINE_State_S_U7 9,     // U7 Call resived
    
EDSS_LINE_State_S_U8 10,     // U8 Connect request
    
EDSS_LINE_State_S_U9 11,     // U9 Incoming Call Proceeding
    
EDSS_LINE_State_S_S1O 12,     // U10 Active
    
EDSS_LINE_State_S_U11 13,     // U11 Disconnect Request
    
EDSS_LINE_State_S_U12 14,     // U12 Disconnect Indication
    
EDSS_LINE_State_S_U13 15,     // U13
    
EDSS_LINE_State_S_U14 16,     // U14
    
EDSS_LINE_State_S_U15 17,     // U15 Suspend Request
    
EDSS_LINE_State_S_U16 18,     // U16
    
EDSS_LINE_State_S_U17 19,     // U17 Resume Request
    
EDSS_LINE_State_S_U18 20,     // U18
    
EDSS_LINE_State_S_U19 21,     // U19 Release Request
    
EDSS_LINE_State_S_U2O 22,     // U2O
    
EDSS_LINE_State_S_U21 23,     // U21
    
EDSS_LINE_State_S_U22 24,     // U22 Call Abort
    
EDSS_LINE_State_S_U23 25,     // U23
    
EDSS_LINE_State_S_U24 26,     // U24
    
EDSS_LINE_State_S_U25 27,     // U25 Overlap Receiving
};

static 
struct _AU_StateInfo StatesNames__EDSS_LINE[] = 
{
    {
"EMPTY",     "empty"},
    {
"LOCKED",     "LOCKED"},
    {
"S_U0",     "UO Idle State"},
    {
"S_U1",     "U1 Call initiated"},
    {
"S_U2",     "U2 Overlap sending"},
    {
"S_U3",     "U3 Outgoing call proceeding"},
    {
"S_U4",     "U4 Call delivered"},
    {
"S_U5",     "U5 Call present"},
    {
"S_U6",     "U6 BAD STATE"},
    {
"S_U7",     "U7 Call resived"},
    {
"S_U8",     "U8 Connect request"},
    {
"S_U9",     "U9 Incoming Call Proceeding"},
    {
"S_S1O",     "U10 Active"},
    {
"S_U11",     "U11 Disconnect Request"},
    {
"S_U12",     "U12 Disconnect Indication"},
    {
"S_U13",     "U13"},
    {
"S_U14",     "U14"},
    {
"S_U15",     "U15 Suspend Request"},
    {
"S_U16",     "U16"},
    {
"S_U17",     "U17 Resume Request"},
    {
"S_U18",     "U18"},
    {
"S_U19",     "U19 Release Request"},
    {
"S_U2O",     "U2O"},
    {
"S_U21",     "U21"},
    {
"S_U22",     "U22 Call Abort"},
    {
"S_U23",     "U23"},
    {
"S_U24",     "U24"},
    {
"S_U25",     "U25 Overlap Receiving"},
    {
NULLNULL}
};

static 
void ClearThisLine(BOOL WithTimers)
{
    if(
WithTimers)
     
BreakEventAllTimersByContext(shedule_pCurBaseContextshedule_pCurrentProcess->IDshedule_nContext);;
    
This->TimerTimeOut=EDSS_TIMER_INFO;
    
This->LinkedWith=0;
    
This->AdTalking=This->DAdTalking;

    
strcpy(This->Called ,"-");
    
strcpy(This->Calling,"-");
    
    
This->ConnectData.Port=0;
    if(
shedule_pCurBaseContext)
     {
shedule_pCurBaseContext->State=EDSS_LINE_State_EMPTY;if(shedule_pCurBaseContext->TraceCnt){_XML_TraceState(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pNameStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pDescriptionTraceBuffer);TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));}};
    
This->BREAK_REASON=Release_Normal;
}


#define TUA_PROCEDING 1
#define TUA_ALLERTING 2
#define TUA_PROGRESS  4

int EDSS_LINE__CallContext(struct AU_ProcesspCurProcessstruct AU_BaseContextpContextWORD nContextDWORD CodevoidpOutsize_t BufLen)
{
    switch(
Code)
    {
          case 
GET_TRACTFLAG
              *((
long*)pOut) = ThisProcess->TONP;
            return 
ERROR_noError;
          case 
SET_TRACTFLAG
              
ThisProcess->TONP = (WORD) *((long*)pOut);
            return 
ERROR_noError;


          case 
GET_LineStatState
              if(
pContext->State!=EDSS_LINE_State_EMPTY)
              {
               *((
long*)pOut)=ThisProcess->Orginate?3:2;
                if(
pContext->State==EDSS_LINE_State_S_S1O)*((long*)pOut)=4;
              }
              else                              *((
long*)pOut)=1;
              
//printf("GET_LineStatState\n");
            
return ERROR_noError;
          case 
GET_LineStatInCallerID
              
strcpy((LPSTR)pOut,ThisProcess->Calling);
            return 
ERROR_noError;
          case 
GET_LineStatOutCallerID
              
strcpy((LPSTR)pOut,ThisProcess->Called);
              
//printf("GET_LineStatOutCallerID\n");
            
return ERROR_noError;
          case 
GET_LineStatTimeStart
              {
                  
time_t cur_t;
                  
struct tmtt;
                  
time(&cur_t);
                  
cur_t-=ThisProcess->StartTime;
              
                  
tt localtime(&cur_t);
                  
sprintf((LPSTR)pOut"%.2d:%.2d:%.2d"tt->tm_hourtt->tm_mintt->tm_sec);
                  return 
ERROR_noError;
              }
    }
    return 
ERROR_noSuchName;
}

void EDSS_LINE__InitContext(WORD nContextstruct AU_BaseContextpContext)
{
 
ThisProcess->EnableDTMF=1;

 
ThisProcess->DAdTalking=5;
 
ThisProcess->TONP=TUA_ALLERTING;
 
ClearThisLine(FALSE); 
 
pContext->State=EDSS_LINE_State_EMPTY;;
 
ThisProcess->DelayAlertTimer=0;
}
           


static 
void FLOWMESSAGE(struct EDSS_MESSAGE *Sig);
static 
void SendLayerMessage(struct EDSS_MESSAGE *Message);

void EDSS_LINE__OnSignal__EDSIG_RESTART__InState__LOCKED(const struct ED_SIG_MESSAGEpSignalWORD SignalLen)
{

{
  
#define IS_REQ       (pSignal->Message->Request)
  #define RMSG         (pSignal->Message)
  #define GET_MIE(a)   (GET_MESSAGE_IE(pSignal->Message,a))
  #define OUTMESSAGE(m,a) struct EDSS_MESSAGE m;ConstructMessage(&m,This->CallID,This->Orginate,a,This) 
}
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}


#include "ed_line_sys.c" // auto include 


static void OnRestartCondition(const struct ED_SIG_MESSAGE *Sig,struct EDSS_MESSAGE *m)
{
   
WORD RII;
   
RII=DECODE__EDSS_IE_CODE_RESTART_INDICATOR(GET_MESSAGE_IE(Sig->Message,EDSS_IE_CODE_RESTART_INDICATOR));
   {
      
struct sED_BCHANCTL a1066_buffer_bclstruct sED_BCHANCTLbcl = &a1066_buffer_bcl;;
      
bcl->From    =0xFF;
      
bcl->Use     =0;
      if(
RII==RII_ALL || RII==RII_SINGLE)
      {
       
bcl->BChanID =0xFF;
       
_sfSendSignal(ED_BCHAN_CTLFALSEsizeof(struct sED_BCHANCTL), (char*)(bcl));;
      }
      else
      {
       
struct EDSS_IE_DEF *IE=0;
       while(
IE=GET_MESSAGE_IE_EX(Sig->Message,EDSS_IE_CODE_RESTART_INDICATOR,IE))
       {
       if(
m)
        
APPENDM(m,IE);
       
bcl->BChanID =DECODE__EDSS_IE_CODE_CHANEL_ID(IE);
       
_sfSendSignal(ED_BCHAN_CTLFALSEsizeof(struct sED_BCHANCTL), (char*)(bcl));;
       }
      }
   }
}

void EDSS_LINE__OnSignal__EDSIG_RESTART__Default(const struct ED_SIG_MESSAGEpSignalWORD SignalLen)
{

 
  if(
IS_REQ)
  {
     
SendLayerMessage(RMSG);
    
  }
  else
  {
   
   
OUTMESSAGE(m,EDSS_MSG_CODE_RESTART_ACK);
   
//first - ask same 
   
APPENDM(&m,GET_MIE(EDSS_IE_CODE_RESTART_INDICATOR));
   
OnRestartCondition(pSignal,&m);
   
//n send
   
FLOWMESSAGE(&m);
  }
 

}

void EDSS_LINE__OnSignal__EDSIG_RESTART_ACK__Default(const struct ED_SIG_MESSAGEpSignalWORD SignalLen)
{

if(
IS_REQ)
 
SendLayerMessage(RMSG);
else 
 
//SEND_Release(0);
{
    
OnRestartCondition(pSignal,0);
    
}
KILLSELF();
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}




void EDSS_LINE__OnSignal__KL_START__Default()
{

 
ClearThisLine(TRUE);
 
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}

void EDSS_LINE__OnSignal__KL_STOP__Default()
{

 
ClearThisLine(TRUE);
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}






void EDSS_LINE__OnSignal__EDSIG_SETUP__InState__S_U0(const struct ED_SIG_MESSAGEpSignalWORD SignalLen)
{


 if(
IS_REQ)
 {
  
SendLayerMessage(RMSG);
  
StartTimer(EDSS_T303);
  {
shedule_pCurBaseContext->State=EDSS_LINE_State_S_U1;if(shedule_pCurBaseContext->TraceCnt){_XML_TraceState(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pNameStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pDescriptionTraceBuffer);TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));}};
 }
 else
 {
     
//Indication(EDSS_SETUP_IND,pSignal);
     
OnSetupLine(pSignal);
     
//StartTimer(EDSS_T303);
     
{shedule_pCurBaseContext->State=EDSS_LINE_State_S_U1;if(shedule_pCurBaseContext->TraceCnt){_XML_TraceState(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pNameStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pDescriptionTraceBuffer);TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));}};
 }
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}

void EDSS_LINE__OnSignal__EDSIG_SETUP__Default(const struct ED_SIG_MESSAGEpSignalWORD SignalLen)
{


if(
shedule_pCurBaseContext->TraceCnt){_XML_Trace(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextTraceBuffer);sprintf(TraceBuffer+(WORD)strlen(TraceBuffer), "GOT SECOND SETUP.. ignore%s\r\n""</text>\r\n</hint>\r\n");    TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));}
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}


void EDSS_LINE__OnSignal__EDSIG_DISCONNECT__Default(const struct ED_SIG_MESSAGEpSignalWORD SignalLen)
{

 
UpBreak();
 if(
IS_REQ)
 {
  
SendLayerMessage(RMSG);
  {
shedule_pCurBaseContext->State=EDSS_LINE_State_S_U11;if(shedule_pCurBaseContext->TraceCnt){_XML_TraceState(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pNameStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pDescriptionTraceBuffer);TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));}};
  
StartTimer(EDSS_T305);
 }
 else
 {
     
ReleaseLink(CS_CALL_CLEAR);
     {
shedule_pCurBaseContext->State=EDSS_LINE_State_S_U12;if(shedule_pCurBaseContext->TraceCnt){_XML_TraceState(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pNameStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pDescriptionTraceBuffer);TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));}};
 }
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}


void EDSS_LINE__OnSignal__EDSIG_STATUS__Default(const struct ED_SIG_MESSAGEpSignalWORD SignalLen)
{

 if(
This->CallID)SEND_ReleaseCmp();
    
KILLSELF();
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}


void EDSS_LINE__OnSignal__EDSIG_RELEASE__Default(const struct ED_SIG_MESSAGEpSignalWORD SignalLen)
{

  
UpBreak();
 if(
IS_REQ)
 {
     
SendLayerMessage(RMSG);
     
StopTimer(EDSS_T305);
     
StartTimer(EDSS_T308);
     {
shedule_pCurBaseContext->State=EDSS_LINE_State_S_U19;if(shedule_pCurBaseContext->TraceCnt){_XML_TraceState(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pNameStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pDescriptionTraceBuffer);TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));}};
 }
 else
 {
  
SEND_ReleaseCmp();
  
KILLSELF();
 }
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}

void EDSS_LINE__OnSignal__EDSS_T305__Default(const * pSignalWORD SignalLen)
{
    
// WHERE WAS NO ASK FOR DISCONNECT
 
if(shedule_pCurBaseContext->State==EDSS_LINE_State_S_U11)
     {
       
ReleaseLink(0);
      
/*OUTMESSAGE(m,EDSS_MSG_CODE_CALL_PROCEEDING);
      APPENDM(&m,CONSTRUCT__EDSS_IE_CODE_CHANEL_ID(This->BChannel));
      INJECT(&m);
      */
     
}
 else
     {
      if(
shedule_pCurBaseContext->TraceCnt){_XML_Trace(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextTraceBuffer);sprintf(TraceBuffer+(WORD)strlen(TraceBuffer), "T305(DISC) ENDS IN WRONG STATE.AND HOW IT HAPENDS?%s\r\n""</text>\r\n</hint>\r\n");    TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));};
     }
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}

void EDSS_LINE__OnSignal__EDSS_T308__Default(const * pSignalWORD SignalLen)
{
// WHERE WAS NO ASK FOR RELEASE
 
if(shedule_pCurBaseContext->State==EDSS_LINE_State_S_U19)
     {
      
SEND_ReleaseCmp();
      
KILLSELF();
     }
 else
     {
      if(
shedule_pCurBaseContext->TraceCnt){_XML_Trace(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextTraceBuffer);sprintf(TraceBuffer+(WORD)strlen(TraceBuffer), "T308(RELEASE) ENDS IN WRONG STATE.AND HOW IT HAPENDS?%s\r\n""</text>\r\n</hint>\r\n");    TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));};
     }
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}


void EDSS_LINE__OnSignal__EDSIG_RELEASE_COMPLETE__Default(const struct ED_SIG_MESSAGEpSignalWORD SignalLen)
{

 
SetEventTimer(shedule_pCurBaseContextshedule_pCurrentProcess->IDshedule_nContextEDSS_RELTIMER-T00FALSETRUE);
 if(
IS_REQ)
 {
     
SendLayerMessage(RMSG);
 }
 else
 {
     
 }
 
KILLSELF();
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}


void EDSS_LINE__OnSignal__CF_SETUP__InState__LOCKED(const struct CF_SetuppSignalWORD SignalLen)
{

 
This->AdTalking=shedule_pEvent->AdapterNo;
 
This->LinkedWith=1;
 if(
This->BreakOnSetup)
 {
  
KILLSELF();
  return;
 }
 {
shedule_pCurBaseContext->State=EDSS_LINE_State_S_U0;if(shedule_pCurBaseContext->TraceCnt){_XML_TraceState(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pNameStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pDescriptionTraceBuffer);TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));}};
 
 {
    
// Запрашиваем преобразование номера
    
struct RT_DestinationRq a1066_buffer_rqstruct RT_DestinationRqrq = &a1066_buffer_rq;;
    
rq->Hook 100;
    
strcpy(rq->SetpSignal->To);
    
strcpy(This->CallingpSignal->To);
    
sSyncSignalFlag TRUE;
 }
 
SetupLine(pSignal->From,This->Calling,1);

    
shedule_pCurBaseContext->ActivityFlag TRUE;
}

void EDSS_LINE__OnSignal__RT_REPLACED__Default(const struct RT_DestinationRqpSignalWORD SignalLen)
{

    
strcpy(This->CallingpSignal->Set);
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}

void EDSS_LINE__OnSignal__RT_NOTRESOLVED__Default(const struct RT_DestinationNotResolvedpSignalWORD SignalLen)
{

    
shedule_pCurBaseContext->ActivityFlag TRUE;
}

void EDSS_LINE__OnSignal__RT_NOTCOMPLETED__Default(const struct RT_DestinationNotResolvedpSignalWORD SignalLen)
{

 
StopTimer(EDT_SET2CP);
 
OUTMESSAGE(m,EDSS_MSG_CODE_SETUP_ACK);
 
//APPENDM(&m,CONSTRUCT__EDSS_IE_CODE_CHANEL_ID(This->BChannel));
 
FLOWMESSAGE(&m);
 
//StopTimer(EDSS_T304);
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}


void EDSS_LINE__OnSignal__CF_SETUP__Default(const struct CF_SetuppSignalWORD SignalLen)
{

 
This->AdTalking=shedule_pEvent->AdapterNo;
 
This->LinkedWith=1;
 if(
shedule_pCurBaseContext->TraceCnt){_XML_Trace(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextTraceBuffer);sprintf(TraceBuffer+(WORD)strlen(TraceBuffer), "EDL:line%d got CF_SETUP not in LOCKED state%s\r\n"shedule_nContext"</text>\r\n</hint>\r\n");    TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));};
 
KILLSELF();
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}



void EDSS_LINE__OnSignal__EDSS_RELTIMER__Default(const * pSignalWORD SignalLen)
{
//,LOCKED)
SEND_ReleaseCmp();
KILLSELF();
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}


void EDSS_LINE__OnSignal__CF_RELEASE__Default(const struct CF_ReleasepSignalWORD SignalLen)
{

 if(
shedule_pCurBaseContext->TraceCnt){_XML_Trace(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextTraceBuffer);sprintf(TraceBuffer+(WORD)strlen(TraceBuffer), "incoming release%s\r\n""</text>\r\n</hint>\r\n");    TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));};

 
LineBreakRelease();
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}


void EDSS_LINE__OnSignal__CF_TRYNING__Default()
{

 
OUTMESSAGE(m,EDSS_MSG_CODE_CALL_PROCEEDING);
 
APPENDM(&m,CONSTRUCT__EDSS_IE_CODE_CHANEL_ID(This->BChannel));
 
FLOWMESSAGE(&m);
 
StopTimer(EDSS_T304);
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}


void EDSS_LINE__OnSignal__CF_COMPLETED__Default(const struct CF_CompletedpSignalWORD SignalLen)
{


 
OUTMESSAGE(m,EDSS_MSG_CODE_CALL_PROCEEDING);
 
APPENDM(&m,CONSTRUCT__EDSS_IE_CODE_CHANEL_ID(This->BChannel));
 
FLOWMESSAGE(&m);
 
StopTimer(EDSS_T304);
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}

void EDSS_LINE__OnSignal__CF_NOTCOMPLETED__Default()
{

 
OUTMESSAGE(m,EDSS_MSG_CODE_SETUP_ACK);
 
SendLayerMessage(&m);
 if(
This->EnableDTMF)
     
ToneCTL(EDT_DTMF_ON);
 
StartTimer(EDSS_T304);
 {
shedule_pCurBaseContext->State=EDSS_LINE_State_S_U2;if(shedule_pCurBaseContext->TraceCnt){_XML_TraceState(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pNameStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pDescriptionTraceBuffer);TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));}};
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}

void EDSS_LINE__OnSignal__EDSS_T304__Default(const * pSignalWORD SignalLen)
{
    
// dial time ends. no number assepted
 
if(shedule_pCurBaseContext->TraceCnt){_XML_Trace(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextTraceBuffer);sprintf(TraceBuffer+(WORD)strlen(TraceBuffer), "dial time ends. no number assepted%s\r\n""</text>\r\n</hint>\r\n");    TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));};
 
KILLSELF();
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}

void EDSS_LINE__OnSignal__EDSIG_SETUP_ACK__Default(const struct ED_SIG_MESSAGEpSignalWORD SignalLen)
{

 
// Signal CF_NOTCOMPLETED nc;
 
_sfSendSignalTo(CF_NOTCOMPLETEDFALSE0NULL,This->AdTalking);
 {
shedule_pCurBaseContext->State=EDSS_LINE_State_S_U2;if(shedule_pCurBaseContext->TraceCnt){_XML_TraceState(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pNameStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pDescriptionTraceBuffer);TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));}};
 
//ToneCTL(EDT_DTMF_ON);
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}

void EDSS_LINE__OnSignal__EDSIG_PROGRESS__Default(const struct ED_SIG_MESSAGEpSignalWORD SignalLen)
{

 
// Signal CF_PROGRESS nc;
 
_sfSendSignalTo(CF_PROGRESSFALSE0NULL,This->AdTalking);
 
TryUpTransfer(TUA_PROGRESS);
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}

void EDSS_LINE__OnSignal__EDSIG_INFORMATION__Default(const struct ED_SIG_MESSAGEpSignalWORD SignalLen)
{

 
struct EDSS_IE_DEF *CN=GET_MESSAGE_IE(pSignal->Message,EDSS_IE_CODE_CALLED_PARTY_NUM);
 if(
CN)
 {
  
LPCSTR To;
  
struct CF_Digits a1066_buffer_dgstruct CF_Digitsdg = &a1066_buffer_dg;;
  
To  =DECODE__EDSS_IE_CODE_CALLED_PARTY_NUM(CN);
  
strcpy(dg->Set,To);
  
_sfSendSignalTo(CF_DIGITSFALSEsizeof(struct CF_Digits), (char*)(dg), This->AdTalking);;
  
RestartTimer(EDSS_T304);
 }
    
shedule_pCurBaseContext->ActivityFlag TRUE;


void EDSS_LINE__OnSignal__CF_DIGITS__Default(const struct CF_DigitspSignalWORD SignalLen)
{

 if(
shedule_pEvent->AdapterNo==8)
 {
  
struct CF_Digits a1066_buffer_dgstruct CF_Digitsdg = &a1066_buffer_dg;;
  
memcpy(dg,pSignal,sizeof(*dg));
  
_sfSendSignalTo(CF_DIGITSFALSEsizeof(struct CF_Digits), (char*)(dg), This->AdTalking);;
  return;
 }

 if(
strlen(pSignal->Set)==&& *(pSignal->Set)=='#')
 {
 }
 else
 {
  
OUTMESSAGE(m,EDSS_MSG_CODE_INFORMATION);
  
strcat(This->Calling,pSignal->Set);
  
APPENDM(&m,CONSTRUCT__EDSS_IE_CODE_CALLED_PARTY_NUM(pSignal->Set));
  
SendLayerMessage(&m);
 }
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}

void EDSS_LINE__OnSignal__CF_QUEUED__Default()
{

 
OUTMESSAGE(m,EDSS_MSG_CODE_ALERTING);
 
SendLayerMessage(&m);
 
TryUpTransfer(TUA_ALLERTING);
 
ToneCTL(EDT_TONE_QUE);
 {
shedule_pCurBaseContext->State=EDSS_LINE_State_S_U4;if(shedule_pCurBaseContext->TraceCnt){_XML_TraceState(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pNameStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pDescriptionTraceBuffer);TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));}};
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}


void EDSS_LINE__OnSignal__CF_RINGING__Default()
{

 
OUTMESSAGE(m,EDSS_MSG_CODE_ALERTING);
 
SendLayerMessage(&m);
 
TryUpTransfer(TUA_ALLERTING);
 
ToneCTL(EDT_TONE_RNG);
 
StopTimer(EDSS_T304);
 {
shedule_pCurBaseContext->State=EDSS_LINE_State_S_U4;if(shedule_pCurBaseContext->TraceCnt){_XML_TraceState(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pNameStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pDescriptionTraceBuffer);TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));}};
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}



void EDSS_LINE__OnSignal__CF_PROGRESS__Default()
{

 
OUTMESSAGE(m,EDSS_MSG_CODE_PROGRESS);
 
SendLayerMessage(&m);
 
TryUpTransfer(TUA_PROGRESS);
 
StopTimer(EDSS_T304);
 
//ToneCTL(EDT_TONE_RNG);
 //SET_STATE(S_U4);
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}

void EDSS_LINE__OnSignal__CF_ANSWER__Default()
{

 
OUTMESSAGE(m,EDSS_MSG_CODE_CONNECT);
 
SendLayerMessage(&m);
 
StopTimer(EDSS_T304);
 {
shedule_pCurBaseContext->State=EDSS_LINE_State_S_S1O;if(shedule_pCurBaseContext->TraceCnt){_XML_TraceState(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pNameStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pDescriptionTraceBuffer);TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));}};
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}

void EDSS_LINE__OnSignal__EDSIG_ALERTING__Default(const struct ED_SIG_MESSAGEpSignalWORD SignalLen)
{

  
// Signal CF_RINGING cfs;
  
_sfSendSignalTo(CF_RINGINGFALSE0NULL,This->AdTalking);;
  
TRYCHANGECHANNEL(pSignal);
  
TryUpTransfer(TUA_ALLERTING);
  {
shedule_pCurBaseContext->State=EDSS_LINE_State_S_U4;if(shedule_pCurBaseContext->TraceCnt){_XML_TraceState(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pNameStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pDescriptionTraceBuffer);TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));}};
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}

void EDSS_LINE__OnSignal__EDSIG_CONNECT__Default(const struct ED_SIG_MESSAGEpSignalWORD SignalLen)
{

{
  
// Signal CF_ANSWER cfs;
  
_sfSendSignalTo(CF_ANSWERFALSE0NULL,This->AdTalking);;
}
 
TRYCHANGECHANNEL(pSignal);
{
 
OUTMESSAGE(m,EDSS_MSG_CODE_CONNECT_ACK);
 
SendLayerMessage(&m);
}
  
This->TractReady=TRUE;
  
SetUpTransfer();
  
ToneCTL(EDT_TONE_OFF);
  {
shedule_pCurBaseContext->State=EDSS_LINE_State_S_S1O;if(shedule_pCurBaseContext->TraceCnt){_XML_TraceState(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pNameStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pDescriptionTraceBuffer);TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));}};
  
time(&(This->StartTime));
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}

void EDSS_LINE__OnSignal__EDSIG_CONNECT_ACK__Default(const struct ED_SIG_MESSAGEpSignalWORD SignalLen)
{

  
// Signal CF_ANSWER cfs;
  
_sfSendSignalTo(CF_ANSWERFALSE0NULL,This->AdTalking);;
  
This->TractReady=TRUE;
  
TRYCHANGECHANNEL(pSignal);
  
SetUpTransfer();
  
ToneCTL(EDT_TONE_OFF);
  {
shedule_pCurBaseContext->State=EDSS_LINE_State_S_S1O;if(shedule_pCurBaseContext->TraceCnt){_XML_TraceState(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pNameStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pDescriptionTraceBuffer);TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));}};
  
time(&(This->StartTime));
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}

void EDSS_LINE__OnSignal__EDSIG_CALL_PROCEEDING__Default(const struct ED_SIG_MESSAGEpSignalWORD SignalLen)
{

if(
IS_REQ)
 
SendLayerMessage(RMSG);
else
{
  
// Signal CF_TRYNING cfs;
  
_sfSendSignalTo(CF_TRYNINGFALSE0NULL,This->AdTalking);;
  {
shedule_pCurBaseContext->State=EDSS_LINE_State_S_U3;if(shedule_pCurBaseContext->TraceCnt){_XML_TraceState(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pNameStatesNames__EDSS_LINE[shedule_pCurBaseContext->State].pDescriptionTraceBuffer);TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));}};
  
TRYCHANGECHANNEL(pSignal);
}
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}


void EDSS_LINE__OnSignal__ED_BCHAN_USE__Default(const struct sED_BCHANCTLpSignalWORD SignalLen)
{

  
This->BChannel=pSignal->BChanID;
  if(
shedule_pCurBaseContext->TraceCnt){_XML_Trace(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextTraceBuffer);sprintf(TraceBuffer+(WORD)strlen(TraceBuffer), "EDL:line%d use channel %d%s\r\n"shedule_nContextThis->BChannel"</text>\r\n</hint>\r\n");    TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));};
  
SetUpTransfer();
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}

void EDSS_LINE__OnSignal__CF_CONNECT__Default(const struct CF_ConnectpSignalWORD SignalLen)
{

 
//control channel
// Signal CF_ECHO_ON echo_on
// Signal CF_ECHO_OFF echo_off
 
memcpy(&This->ConnectData,pSignal,sizeof(This->ConnectData));
 if(
shedule_pCurBaseContext->TraceCnt){_XML_Trace(shedule_pCurrentProcessshedule_pCurBaseContextshedule_nContextTraceBuffer);sprintf(TraceBuffer+(WORD)strlen(TraceBuffer), "connect info set to line%s\r\n""</text>\r\n</hint>\r\n");    TraceMessage(shedule_pCurrentProcessshedule_nContextTraceBuffer, (WORD)strlen(TraceBuffer));};
 
SetUpTransfer();
 if(
pSignal->Codec!=G711a
    { 
_sfSendSignal(CF_ECHO_ONFALSE0NULL); }
 else if(
pSignal->Echo)
    { 
_sfSendSignal(CF_ECHO_ONFALSE0NULL); } 
 else 
    { 
_sfSendSignal(CF_ECHO_OFFFALSE0NULL); }
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}   


void EDSS_LINE__OnSignal__CF_HOLD__Default()
{

    if(
This->BChannel)
    {
        
// Signal CF_HOLD cpc;   
        
snContext SheduleSendContextSheduleSendContext This->BChannel;
        
_sfSendSignalTo(CF_HOLDFALSE0NULL,8); SheduleSendContext snContext;;
    }   
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}   

void EDSS_LINE__OnSignal__CF_UNHOLD__Default()
{

    if(
This->BChannel)
    {
        
// Signal CF_UNHOLD cpc;   
        
snContext SheduleSendContextSheduleSendContext This->BChannel;
        
_sfSendSignalTo(CF_UNHOLDFALSE0NULL,8); SheduleSendContext snContext;;
    }   
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}   



void EDSS_LINE__OnSignal__EDSIG_SUSPEND__Default(const struct ED_SIG_MESSAGEpSignalWORD SignalLen)
{

 
OUTMESSAGE(m,EDSIG_SUSPEND_REJ);
 
SendLayerMessage(&m);
    
shedule_pCurBaseContext->ActivityFlag TRUE;
}






// ***** SUPER_FINISH(cc) ***** Root file="ed_line"
// ***** DECLARE_PROCESS
static char sEDSS_LINE__XMLSignalMap[] = 
"<signalmap>\r\n\
<signal id=KL_STOP>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=ED_ORGINATE>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=RT_NOTRESOLVED>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=EDT_SET2CP>\r\n\
<state id=S_U1/>\r\n\
<state id=/>\r\n\
</signal>\r\n\
<signal id=RT_NOTCOMPLETED>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=EDSIG_ALERTING>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=EDSIG_INFORMATION>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=EDSIG_CONNECT_ACK>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=CF_RINGING>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=CF_ANSWER>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=EDSIG_RELEASE_COMPLETE>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=ED_LOCKLINK>\r\n\
<state id=EMPTY/>\r\n\
</signal>\r\n\
<signal id=EDSIG_STATUS>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=EDSIG_RELEASE>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=CF_NOTCOMPLETED>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=CF_COMPLETED>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=EDSIG_SETUP>\r\n\
<state id=S_U0/>\r\n\
<state id=/>\r\n\
</signal>\r\n\
<signal id=CF_CONNECT>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=EDSS_RELTIMER>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=EDSIG_SETUP_ACK>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=ED_CONNECT>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=EDSIG_DISCONNECT>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=EDSIG_PROGRESS>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=EDSIG_SUSPEND>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=EDSS_T304>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=EDSS_T308>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=KL_START>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=CF_DIGITS>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=EDSIG_RESTART_ACK>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=TF>\r\n\
<state id=LOCKED/>\r\n\
</signal>\r\n\
<signal id=CF_SETUP>\r\n\
<state id=LOCKED/>\r\n\
<state id=/>\r\n\
</signal>\r\n\
<signal id=CF_HOLD>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=CF_TRYNING>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=EDSIG_RESTART>\r\n\
<state id=LOCKED/>\r\n\
<state id=/>\r\n\
</signal>\r\n\
<signal id=ED_NEW>\r\n\
<state id=LOCKED/>\r\n\
<state id=EMPTY/>\r\n\
</signal>\r\n\
<signal id=CF_RELEASE>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=RT_REPLACED>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=EDSIG_CONNECT>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=CF_PROGRESS>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=CF_UNHOLD>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=EDSIG_CALL_PROCEEDING>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=ED_BCHAN_USE>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=CF_QUEUED>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
<signal id=EDSS_T305>\r\n\
<state id=""/>\r\n\
</signal>\r\n\
</signalmap>"
;

const 
charget_EDSS_LINE__XMLSignalMap() {return sEDSS_LINE__XMLSignalMap;}

void EDSS_LINE__ProcessEvents(const struct AU_EventpEvent)
{
    
shedule_pEvent = (struct AU_Event*)pEvent;
    
snContext SheduleSendContext;
    
sSyncSignalFlag FALSE;
    
shedule_pCurBaseContext->ActivityFlag FALSE;
    switch(
pEvent->Code)
    {
    case 
KL_STOP:
        switch(
shedule_pCurBaseContext->State)
        {
        default:
            
EDSS_LINE__OnSignal__KL_STOP__Default();
        }
        break;
    case 
ED_ORGINATE:
        
EDSS_LINE__OnSignal__ED_ORGINATE__Default((const struct sED_LINEID*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
RT_NOTRESOLVED:
        
EDSS_LINE__OnSignal__RT_NOTRESOLVED__Default((const struct RT_DestinationNotResolved*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
EDT_SET2CP:
        switch(
shedule_pCurBaseContext->State)
        {
        case 
EDSS_LINE_State_S_U1:
            
EDSS_LINE__OnSignal__EDT_SET2CP__InState__S_U1((const *)(pEvent->pData), pEvent->DataLen);
            break;
        default:
            
EDSS_LINE__OnSignal__EDT_SET2CP__Default((const *)(pEvent->pData), pEvent->DataLen);
        }
        break;
    case 
RT_NOTCOMPLETED:
        
EDSS_LINE__OnSignal__RT_NOTCOMPLETED__Default((const struct RT_DestinationNotResolved*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
EDSIG_ALERTING:
        
EDSS_LINE__OnSignal__EDSIG_ALERTING__Default((const struct ED_SIG_MESSAGE*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
EDSIG_INFORMATION:
        
EDSS_LINE__OnSignal__EDSIG_INFORMATION__Default((const struct ED_SIG_MESSAGE*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
EDSIG_CONNECT_ACK:
        
EDSS_LINE__OnSignal__EDSIG_CONNECT_ACK__Default((const struct ED_SIG_MESSAGE*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
CF_RINGING:
        switch(
shedule_pCurBaseContext->State)
        {
        default:
            
EDSS_LINE__OnSignal__CF_RINGING__Default();
        }
        break;
    case 
CF_ANSWER:
        switch(
shedule_pCurBaseContext->State)
        {
        default:
            
EDSS_LINE__OnSignal__CF_ANSWER__Default();
        }
        break;
    case 
EDSIG_RELEASE_COMPLETE:
        
EDSS_LINE__OnSignal__EDSIG_RELEASE_COMPLETE__Default((const struct ED_SIG_MESSAGE*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
ED_LOCKLINK:
        switch(
shedule_pCurBaseContext->State)
        {
        case 
EDSS_LINE_State_EMPTY:
            
EDSS_LINE__OnSignal__ED_LOCKLINK__InState__EMPTY((const struct sED_LINEID*)(pEvent->pData), pEvent->DataLen);
            break;
        }
        break;
    case 
EDSIG_STATUS:
        
EDSS_LINE__OnSignal__EDSIG_STATUS__Default((const struct ED_SIG_MESSAGE*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
EDSIG_RELEASE:
        
EDSS_LINE__OnSignal__EDSIG_RELEASE__Default((const struct ED_SIG_MESSAGE*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
CF_NOTCOMPLETED:
        switch(
shedule_pCurBaseContext->State)
        {
        default:
            
EDSS_LINE__OnSignal__CF_NOTCOMPLETED__Default();
        }
        break;
    case 
CF_COMPLETED:
        
EDSS_LINE__OnSignal__CF_COMPLETED__Default((const struct CF_Completed*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
EDSIG_SETUP:
        switch(
shedule_pCurBaseContext->State)
        {
        case 
EDSS_LINE_State_S_U0:
            
EDSS_LINE__OnSignal__EDSIG_SETUP__InState__S_U0((const struct ED_SIG_MESSAGE*)(pEvent->pData), pEvent->DataLen);
            break;
        default:
            
EDSS_LINE__OnSignal__EDSIG_SETUP__Default((const struct ED_SIG_MESSAGE*)(pEvent->pData), pEvent->DataLen);
        }
        break;
    case 
CF_CONNECT:
        
EDSS_LINE__OnSignal__CF_CONNECT__Default((const struct CF_Connect*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
EDSS_RELTIMER:
        
EDSS_LINE__OnSignal__EDSS_RELTIMER__Default((const *)(pEvent->pData), pEvent->DataLen);
        break;
    case 
EDSIG_SETUP_ACK:
        
EDSS_LINE__OnSignal__EDSIG_SETUP_ACK__Default((const struct ED_SIG_MESSAGE*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
ED_CONNECT:
        
EDSS_LINE__OnSignal__ED_CONNECT__Default((const struct CF_Connect*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
EDSIG_DISCONNECT:
        
EDSS_LINE__OnSignal__EDSIG_DISCONNECT__Default((const struct ED_SIG_MESSAGE*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
EDSIG_PROGRESS:
        
EDSS_LINE__OnSignal__EDSIG_PROGRESS__Default((const struct ED_SIG_MESSAGE*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
EDSIG_SUSPEND:
        
EDSS_LINE__OnSignal__EDSIG_SUSPEND__Default((const struct ED_SIG_MESSAGE*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
EDSS_T304:
        
EDSS_LINE__OnSignal__EDSS_T304__Default((const *)(pEvent->pData), pEvent->DataLen);
        break;
    case 
EDSS_T308:
        
EDSS_LINE__OnSignal__EDSS_T308__Default((const *)(pEvent->pData), pEvent->DataLen);
        break;
    case 
KL_START:
        switch(
shedule_pCurBaseContext->State)
        {
        default:
            
EDSS_LINE__OnSignal__KL_START__Default();
        }
        break;
    case 
CF_DIGITS:
        
EDSS_LINE__OnSignal__CF_DIGITS__Default((const struct CF_Digits*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
EDSIG_RESTART_ACK:
        
EDSS_LINE__OnSignal__EDSIG_RESTART_ACK__Default((const struct ED_SIG_MESSAGE*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
TF:
        switch(
shedule_pCurBaseContext->State)
        {
        case 
EDSS_LINE_State_LOCKED:
            
EDSS_LINE__OnSignal__TF__InState__LOCKED();
            break;
        }
        break;
    case 
CF_SETUP:
        switch(
shedule_pCurBaseContext->State)
        {
        case 
EDSS_LINE_State_LOCKED:
            
EDSS_LINE__OnSignal__CF_SETUP__InState__LOCKED((const struct CF_Setup*)(pEvent->pData), pEvent->DataLen);
            break;
        default:
            
EDSS_LINE__OnSignal__CF_SETUP__Default((const struct CF_Setup*)(pEvent->pData), pEvent->DataLen);
        }
        break;
    case 
CF_HOLD:
        switch(
shedule_pCurBaseContext->State)
        {
        default:
            
EDSS_LINE__OnSignal__CF_HOLD__Default();
        }
        break;
    case 
CF_TRYNING:
        switch(
shedule_pCurBaseContext->State)
        {
        default:
            
EDSS_LINE__OnSignal__CF_TRYNING__Default();
        }
        break;
    case 
EDSIG_RESTART:
        switch(
shedule_pCurBaseContext->State)
        {
        case 
EDSS_LINE_State_LOCKED:
            
EDSS_LINE__OnSignal__EDSIG_RESTART__InState__LOCKED((const struct ED_SIG_MESSAGE*)(pEvent->pData), pEvent->DataLen);
            break;
        default:
            
EDSS_LINE__OnSignal__EDSIG_RESTART__Default((const struct ED_SIG_MESSAGE*)(pEvent->pData), pEvent->DataLen);
        }
        break;
    case 
ED_NEW:
        switch(
shedule_pCurBaseContext->State)
        {
        case 
EDSS_LINE_State_LOCKED: case EDSS_LINE_State_EMPTY
            
EDSS_LINE__OnSignal__ED_NEW__In__LOCKED_EMPTY((const struct sED_LINEID*)(pEvent->pData), pEvent->DataLen);
            break;
        }
        break;
    case 
CF_RELEASE:
        
EDSS_LINE__OnSignal__CF_RELEASE__Default((const struct CF_Release*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
RT_REPLACED:
        
EDSS_LINE__OnSignal__RT_REPLACED__Default((const struct RT_DestinationRq*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
EDSIG_CONNECT:
        
EDSS_LINE__OnSignal__EDSIG_CONNECT__Default((const struct ED_SIG_MESSAGE*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
CF_PROGRESS:
        switch(
shedule_pCurBaseContext->State)
        {
        default:
            
EDSS_LINE__OnSignal__CF_PROGRESS__Default();
        }
        break;
    case 
CF_UNHOLD:
        switch(
shedule_pCurBaseContext->State)
        {
        default:
            
EDSS_LINE__OnSignal__CF_UNHOLD__Default();
        }
        break;
    case 
EDSIG_CALL_PROCEEDING:
        
EDSS_LINE__OnSignal__EDSIG_CALL_PROCEEDING__Default((const struct ED_SIG_MESSAGE*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
ED_BCHAN_USE:
        
EDSS_LINE__OnSignal__ED_BCHAN_USE__Default((const struct sED_BCHANCTL*)(pEvent->pData), pEvent->DataLen);
        break;
    case 
CF_QUEUED:
        switch(
shedule_pCurBaseContext->State)
        {
        default:
            
EDSS_LINE__OnSignal__CF_QUEUED__Default();
        }
        break;
    case 
EDSS_T305:
        
EDSS_LINE__OnSignal__EDSS_T305__Default((const *)(pEvent->pData), pEvent->DataLen);
        break;
    default:
        {
            
sprintf(pErrorString"Signal not processed! Process:%s Context:%d Signal:%d Len:%d From:%d Route:%d"shedule_pCurrentProcess->Nameshedule_nContextpEvent->CodepEvent->DataLenpEvent->FrompEvent->Route);
            
ErrorStack_Push(pErrorString);
        }
    }
    if(!
shedule_pCurBaseContext->ActivityFlag)
    {
        
char tmp[100];
        
PrintSignalCode(pEvent->Codetmp);
        
sprintf(pErrorString"Activity flag filed! Process:%s Context:%d Signal:%d(%s)"shedule_pCurrentProcess->Nameshedule_nContextpEvent->Codetmp);
        
ErrorStack_Push(pErrorString);
    }
}

BOOL EDSS_LINE__TuneContext(struct AU_BaseContextpContextWORD nContext, const charpParam, const charpParamValue);
BOOL EDSS_LINE__TraceContext(struct AU_BaseContextpContextWORD nContextcharpOutsize_t OutLen);
const 
charget_EDSS_LINE__XMLClassInfo();
const 
charget_EDSS_LINE__XMLSignalMap();

void RegisterProcess__EDSS_LINEClass(struct AU_ProcessTemplatepClass)
{
    
sprintf(pClass->Description"EDSS LINE");
    
pClass->pInitFunc EDSS_LINE__InitContext;
    
pClass->pTuneFunc EDSS_LINE__TuneContext;
    
pClass->pTraceFunc EDSS_LINE__TraceContext;
    
pClass->pEventFunc EDSS_LINE__ProcessEvents;
    
pClass->pBaseInfoFunc get_EDSS_LINE__XMLClassInfo;
    
pClass->pSignalMapFunc get_EDSS_LINE__XMLSignalMap;
    
pClass->pCallFunc EDSS_LINE__CallContext;
    
pClass->ExtContextSize sizeof(struct EDSS_LINE__ContextType);
}

BOOL EDSS_LINE__TraceContext(struct AU_BaseContextpBaseContextWORD nContextcharpOutsize_t OutLen)
{
    
size_t offset;
    
offset _XML_TraceContext(shedule_pCurrentProcesspBaseContextnContextStatesNames__EDSS_LINE[pBaseContext->State].pNameStatesNames__EDSS_LINE[pBaseContext->State].pDescriptionpOut);
    
PrintContext__EDSS_LINE(pBaseContextpOut+offsetOutLen);
    
offset+=strlen(pOut+offset);
    
sprintf(pOut+offset"</params>\r\n</context>");
    return 
TRUE;
}


BOOL EDSS_LINE__TuneContext(struct AU_BaseContextpContextWORD nContext, const charpParam, const charpParamValue)
{
    return 
FALSE;
}


static 
char EDSS_LINE_XMLClassInfo[] = 
"<class name=EDSS_LINE info=\"EDSS LINE\">\r\n\
<states>\r\n\
<state id=S_U14>U14</state>\r\n\
<state id=LOCKED>LOCKED</state>\r\n\
<state id=S_U25>U25 Overlap Receiving</state>\r\n\
<state id=S_U24>U24</state>\r\n\
<state id=S_U15>U15 Suspend Request</state>\r\n\
<state id=S_U23>U23</state>\r\n\
<state id=S_U6>U6 BAD STATE</state>\r\n\
<state id=S_U16>U16</state>\r\n\
<state id=S_U0>UO Idle State</state>\r\n\
<state id=S_U19>U19 Release Request</state>\r\n\
<state id=S_U22>U22 Call Abort</state>\r\n\
<state id=S_U18>U18</state>\r\n\
<state id=S_U11>U11 Disconnect Request</state>\r\n\
<state id=S_U5>U5 Call present</state>\r\n\
<state id=S_U12>U12 Disconnect Indication</state>\r\n\
<state id=S_U21>U21</state>\r\n\
<state id=S_U17>U17 Resume Request</state>\r\n\
<state id=S_U1>U1 Call initiated</state>\r\n\
<state id=S_U9>U9 Incoming Call Proceeding</state>\r\n\
<state id=S_U13>U13</state>\r\n\
<state id=EMPTY>empty</state>\r\n\
<state id=S_S1O>U10 Active</state>\r\n\
<state id=S_U2>U2 Overlap sending</state>\r\n\
<state id=S_U3>U3 Outgoing call proceeding</state>\r\n\
<state id=S_U4>U4 Call delivered</state>\r\n\
<state id=S_U7>U7 Call resived</state>\r\n\
<state id=S_U8>U8 Connect request</state>\r\n\
<state id=S_U2O>U2O</state>\r\n\
</states>\r\n\
<tunes>\r\n\
</tunes>\r\n\
<signal_map>\r\n\
</signal_map>\r\n\
</class>\r\n"
;
const 
charget_EDSS_LINE__XMLClassInfo() {return EDSS_LINE_XMLClassInfo;}





[CODE]/ed_line.c

Решил как-то Кащей-бессмертный жизнь покончить самоубийством..
в речке топился, с 10 этажа вниз головой падал, вешался, апстену бился, йаду пил...в общем развлекался как мог..