示例#1
0
void CAPIConnDDI::InfoInd(_cmsg *CMSG)
 {
 if(dbg_capiind)
  cdebug << "(DDIConn) InfoInd erhalten..." << endl;
 
 _cmsg CMSG1;
 if(INFO_IND_PLCI(CMSG)>255)
  INFO_RESP(&CMSG1,Appl_Id,CMSG->Messagenumber,INFO_IND_PLCI(CMSG));
 if(INFO_IND_INFONUMBER(CMSG)==0x0070)
  {
  if(dbg_callcontrol)
   cdebug << "   DDI: Ziffer erhalten..." << endl;
  
  unsigned char *x=INFO_IND_INFOELEMENT(CMSG);
  char s[128];
  memcpy(s,x+2,(size_t)(x[0]-1));
  s[x[0]-1]='\0';
  s[x[0]]='\0';
  nr+=s;
  if(dbg_callcontrol)
   cdebug << "   DDI: Rufnummer ist jetzt:" << nr << endl;

  if(nr.length()>=anzahlnr)
   ConnectIt();
  }
 }
示例#2
0
void CAPIConn::InfoInd(_cmsg *CMSG)
 {
 if(dbg_capiind)
  cdebug << "InfoInd erhalten... INFO_NUMBER=" << INFO_IND_INFONUMBER(CMSG) << endl;
 
 _cmsg CMSG1;
 INFO_RESP(&CMSG1,Appl_Id,CMSG->Messagenumber,INFO_IND_PLCI(CMSG));
 }
示例#3
0
void CAPIApp::HandleInd()
 {
 pthread_t dummyh;

 if(dbg_capiind)
  cdebug << "IND MsgNumber:" << CMSG->Messagenumber << endl;
 

 switch(CMSG->Command)
  {
  case CAPI_CONNECT:
   if(dbg_capiind)
    cdebug << "IND CONNECT PLCI=" << CONNECT_IND_PLCI(CMSG) << endl;
   

   if(playaudio)
    pthread_create(&dummyh,NULL,&PlayNameThread,new string(getCallingNumber(CMSG)));

   // Konfiguration lesen
   C[CONNECT_IND_PLCI(CMSG)]=cConf->getCAPIConn(CMSG,Appl_Id,&C);

   if( ((CAPIConn*)byPLCI(CONNECT_IND_PLCI(CMSG))) !=NULL )
    ((CAPIConn*)byPLCI(CONNECT_IND_PLCI(CMSG)))->Connect(CMSG); 
   else
    cdebug << "Unbekannte PLCI..." << endl;
   break;

  case CAPI_CONNECT_ACTIVE:
   if(dbg_capiind)
    cdebug << "IND CONNECT_ACTIVE" << endl;
   
   ((CAPIConn*)byPLCI(CONNECT_ACTIVE_IND_PLCI(CMSG)))->ConnectActive(CMSG);
   break;

  case CAPI_CONNECT_B3:
   if(dbg_capiind)
    cdebug << "IND CONNECT_B3 " << endl;
   
   ((CAPIConn*)byNCCI(CONNECT_B3_IND_NCCI(CMSG)))->ConnectB3(CMSG);
   break;

  case CAPI_CONNECT_B3_ACTIVE:
   if(dbg_capiind)
    cdebug << "IND CONNECT_B3_ACTIVE " << endl;
   
   ((CAPIConn*)byNCCI(CONNECT_B3_ACTIVE_IND_NCCI(CMSG)))->ConnectB3Active(CMSG);
   break;

  case CAPI_DATA_B3:
   if(dbg_capiind)
    cdebug << "IND DATA_B3 " << endl;
   
   ((CAPIConn*)byNCCI(DATA_B3_IND_NCCI(CMSG)))->B3Data(CMSG);
   break;

  case CAPI_FACILITY:
   if(dbg_capiind)
    cdebug << "IND FACILITY " << endl;
   
   ((CAPIConn*)byPLCI(FACILITY_IND_PLCI(CMSG)))->Facility(CMSG);
   break;

  case CAPI_INFO:
   if(dbg_capiind)
    cdebug << "IND INFO" << endl;
   
   try{
    ((CAPIConn*)byPLCI(INFO_IND_PLCI(CMSG)))->InfoInd(CMSG);
    }
   catch(int i) {
    if(i==1)
     cdebug << "Info_Ind unbekannte PLCI=" << INFO_IND_PLCI(CMSG) << endl; 
    } 
   break;

  case CAPI_DISCONNECT:
    if(dbg_capiind)
     cdebug << "IND DISCONNECT reason=" << DISCONNECT_IND_REASON(CMSG) << endl;
   
    byPLCI(DISCONNECT_IND_PLCI(CMSG))->Disconnect(CMSG); 
    delete byPLCI(DISCONNECT_IND_PLCI(CMSG));
   break;

  case CAPI_DISCONNECT_B3:
   if(dbg_capiind)
    cdebug << "IND DISCONNECT_B3 reason=" << DISCONNECT_B3_IND_REASON_B3(CMSG) << endl;
   
   ((CAPIConn*)byNCCI(DISCONNECT_B3_IND_NCCI(CMSG)))->DisconnectB3(CMSG); 
   break;

  default:
   cdebug << "Unhandled Ind. Cmd=" << (unsigned int) CMSG->Command << endl;
  }
 }