ooh323ep.c

来自「一个非常美妙的proxy。功能强大。基于sip的协议。如果还要的话」· C语言 代码 · 共 781 行 · 第 1/2 页

C
781
字号
   }   return OO_OK;}int ooH323EpEnableGkRouted(void){   OO_SETFLAG(gH323ep.flags, OO_M_GKROUTED);   return OO_OK;}int ooH323EpDisableGkRouted(void){   OO_CLRFLAG(gH323ep.flags, OO_M_GKROUTED);   return OO_OK;}int ooH323EpEnableAutoAnswer(void){   OO_SETFLAG(gH323ep.flags, OO_M_AUTOANSWER);   return OO_OK;}int ooH323EpDisableAutoAnswer(void){   OO_CLRFLAG(gH323ep.flags, OO_M_AUTOANSWER);   return OO_OK;}int ooH323EpEnableManualRingback(void){   OO_SETFLAG(gH323ep.flags, OO_M_MANUALRINGBACK);   return OO_OK;}int ooH323EpDisableManualRingback(void){   OO_CLRFLAG(gH323ep.flags, OO_M_MANUALRINGBACK);   return OO_OK;}int ooH323EpEnableFastStart(void){   OO_SETFLAG(gH323ep.flags, OO_M_FASTSTART);   return OO_OK;}int ooH323EpDisableFastStart(void){   OO_CLRFLAG(gH323ep.flags, OO_M_FASTSTART);   return OO_OK;}int ooH323EpEnableH245Tunneling(void){   OO_SETFLAG(gH323ep.flags, OO_M_TUNNELING);   return OO_OK;} int ooH323EpDisableH245Tunneling(void){   OO_CLRFLAG(gH323ep.flags, OO_M_TUNNELING);   return OO_OK;}int ooH323EpSetTermType(int value){   gH323ep.termType = value;   return OO_OK;}int ooH323EpSetProductID (const char* productID){   if (0 != productID) {      char* pstr = (char*) memAlloc (&gH323ep.ctxt, strlen(productID)+1);      strcpy (pstr, productID);      if(gH323ep.productID)         memFreePtr(&gH323ep.ctxt, gH323ep.productID);      gH323ep.productID = pstr;      return OO_OK;   }   else return OO_FAILED;}int ooH323EpSetVersionID (const char* versionID){   if (0 != versionID) {      char* pstr = (char*) memAlloc (&gH323ep.ctxt, strlen(versionID)+1);      strcpy (pstr, versionID);      if(gH323ep.versionID)         memFreePtr(&gH323ep.ctxt, gH323ep.versionID);      gH323ep.versionID = pstr;      return OO_OK;   }   else return OO_FAILED;}int ooH323EpSetCallerID (const char* callerID){   if (0 != callerID) {      char* pstr = (char*) memAlloc (&gH323ep.ctxt, strlen(callerID)+1);      strcpy (pstr, callerID);      if(gH323ep.callerid)         memFreePtr(&gH323ep.ctxt, gH323ep.callerid);      gH323ep.callerid = pstr;      return OO_OK;   }   else return OO_FAILED;}int ooH323EpSetCallingPartyNumber(const char* number){   int ret=OO_OK;   if(number)   {      strncpy(gH323ep.callingPartyNumber, number,                                         sizeof(gH323ep.callingPartyNumber)-1);      ret = ooH323EpAddAliasDialedDigits((char*)number);      return ret;   }   else return OO_FAILED;}int ooH323EpSetTraceLevel(int traceLevel){   ooSetTraceThreshold(traceLevel);   return OO_OK;}void ooH323EpPrintConfig(void){   OOTRACEINFO1("H.323 Endpoint Configuration is as follows:\n");      OOTRACEINFO2("\tTrace File: %s\n", gH323ep.traceFile);   if(!OO_TESTFLAG(gH323ep.flags, OO_M_FASTSTART))   {      OOTRACEINFO1("\tFastStart - disabled\n");   }   else{      OOTRACEINFO1("\tFastStart - enabled\n");   }   if(!OO_TESTFLAG(gH323ep.flags, OO_M_TUNNELING))   {      OOTRACEINFO1("\tH245 Tunneling - disabled\n");   }   else{      OOTRACEINFO1("\tH245 Tunneling - enabled\n");   }   if(OO_TESTFLAG(gH323ep.flags, OO_M_AUTOANSWER))      OOTRACEINFO1("\tAutoAnswer - enabled\n");   else      OOTRACEINFO1("\tAutoAnswer - disabled\n");        OOTRACEINFO2("\tTerminal Type - %d\n", gH323ep.termType);   OOTRACEINFO2("\tT35 CountryCode - %d\n", gH323ep.t35CountryCode);   OOTRACEINFO2("\tT35 Extension - %d\n", gH323ep.t35Extension);   OOTRACEINFO2("\tManufacturer Code - %d\n", gH323ep.manufacturerCode);   OOTRACEINFO2("\tProductID - %s\n", gH323ep.productID);      OOTRACEINFO2("\tVersionID - %s\n", gH323ep.versionID);   OOTRACEINFO2("\tLocal signalling IP address - %s\n", gH323ep.signallingIP);   OOTRACEINFO2("\tH225 ListenPort - %d\n", gH323ep.listenPort);   OOTRACEINFO2("\tCallerID - %s\n", gH323ep.callerid);   OOTRACEINFO2("\tCall Establishment Timeout - %d seconds\n",                                           gH323ep.callEstablishmentTimeout);      OOTRACEINFO2("\tMasterSlaveDetermination Timeout - %d seconds\n",                   gH323ep.msdTimeout);   OOTRACEINFO2("\tTerminalCapabilityExchange Timeout - %d seconds\n",                   gH323ep.tcsTimeout);   OOTRACEINFO2("\tLogicalChannel  Timeout - %d seconds\n",                   gH323ep.logicalChannelTimeout);   OOTRACEINFO2("\tSession Timeout - %d seconds\n", gH323ep.sessionTimeout);   return;   }int ooH323EpAddG711Capability(int cap, int txframes, int rxframes, int dir,                              cb_StartReceiveChannel startReceiveChannel,                              cb_StartTransmitChannel startTransmitChannel,                              cb_StopReceiveChannel stopReceiveChannel,                              cb_StopTransmitChannel stopTransmitChannel){   return ooCapabilityAddSimpleCapability(NULL, cap, txframes, rxframes, FALSE,                            dir, startReceiveChannel, startTransmitChannel,                             stopReceiveChannel, stopTransmitChannel, FALSE);}int ooH323EpAddG729Capability(int cap, int txframes, int rxframes, int dir,                              cb_StartReceiveChannel startReceiveChannel,                              cb_StartTransmitChannel startTransmitChannel,                              cb_StopReceiveChannel stopReceiveChannel,                              cb_StopTransmitChannel stopTransmitChannel){   return ooCapabilityAddSimpleCapability(NULL, cap, txframes, rxframes, FALSE,                               dir, startReceiveChannel, startTransmitChannel,                                stopReceiveChannel, stopTransmitChannel, FALSE);}int ooH323EpAddG7231Capability(int cap, int txframes, int rxframes,                               OOBOOL silenceSuppression, int dir,                              cb_StartReceiveChannel startReceiveChannel,                              cb_StartTransmitChannel startTransmitChannel,                              cb_StopReceiveChannel stopReceiveChannel,                              cb_StopTransmitChannel stopTransmitChannel){   return ooCapabilityAddSimpleCapability(NULL, cap, txframes, rxframes,                              silenceSuppression, dir, startReceiveChannel,                              startTransmitChannel, stopReceiveChannel,                              stopTransmitChannel, FALSE);}int ooH323EpAddGSMCapability(int cap, ASN1USINT framesPerPkt,                              OOBOOL comfortNoise, OOBOOL scrambled, int dir,                             cb_StartReceiveChannel startReceiveChannel,                             cb_StartTransmitChannel startTransmitChannel,                             cb_StopReceiveChannel stopReceiveChannel,                             cb_StopTransmitChannel stopTransmitChannel){   return ooCapabilityAddGSMCapability(NULL, cap, framesPerPkt, comfortNoise,                                      scrambled, dir, startReceiveChannel,                                      startTransmitChannel, stopReceiveChannel,                                     stopTransmitChannel, FALSE);}int ooH323EpAddH263VideoCapability(int cap, unsigned sqcifMPI,                                  unsigned qcifMPI, unsigned cifMPI,                                  unsigned cif4MPI, unsigned cif16MPI,                                  unsigned maxBitRate, int dir,                                  cb_StartReceiveChannel startReceiveChannel,                                 cb_StartTransmitChannel startTransmitChannel,                                 cb_StopReceiveChannel stopReceiveChannel,                                 cb_StopTransmitChannel stopTransmitChannel){   return ooCapabilityAddH263VideoCapability(NULL, sqcifMPI, qcifMPI, cifMPI,                                      cif4MPI, cif16MPI, maxBitRate,dir,                                     startReceiveChannel, startTransmitChannel,                                     stopReceiveChannel, stopTransmitChannel,                                      FALSE);}int ooH323EpEnableDTMFRFC2833(int dynamicRTPPayloadType){   return ooCapabilityEnableDTMFRFC2833(NULL, dynamicRTPPayloadType);}int ooH323EpDisableDTMFRFC2833(void){   return ooCapabilityDisableDTMFRFC2833(NULL);}int ooH323EpEnableDTMFH245Alphanumeric(){   return ooCapabilityEnableDTMFH245Alphanumeric(NULL);}int ooH323EpDisableDTMFH245Alphanumeric(){   return ooCapabilityDisableDTMFH245Alphanumeric(NULL);}int ooH323EpEnableDTMFH245Signal(){   return ooCapabilityEnableDTMFH245Signal(NULL);}int ooH323EpDisableDTMFH245Signal(){   return ooCapabilityDisableDTMFH245Signal(NULL);}int ooH323EpEnableDTMFQ931Keypad(){   return ooCapabilityEnableDTMFQ931Keypad(NULL);}int ooH323EpDisableDTMFQ931Keypad(){   return ooCapabilityDisableDTMFQ931Keypad(NULL);}int ooH323EpSetGkClientCallbacks(OOGKCLIENTCALLBACKS gkClientCallbacks){   if(gH323ep.gkClient)   {      return ooGkClientSetCallbacks(gH323ep.gkClient, gkClientCallbacks);   }else{      OOTRACEERR1("Error:Gk Client hasn't been initialized yet\n");      return OO_FAILED;   }}/* 0-1024 are reserved for well known services */int ooH323EpSetTCPPortRange(int base, int max){   if(base <= 1024)      gH323ep.tcpPorts.start = 1025;   else      gH323ep.tcpPorts.start = base;   if(max > 65500)      gH323ep.tcpPorts.max = 65500;   else       gH323ep.tcpPorts.max = max;   if(gH323ep.tcpPorts.max<gH323ep.tcpPorts.start)   {      OOTRACEERR1("Error: Failed to set tcp ports- "                  "Max port number less than Start port number\n");      return OO_FAILED;   }   gH323ep.tcpPorts.current = gH323ep.tcpPorts.start;           OOTRACEINFO1("TCP port range initialize - successful\n");   return OO_OK;}int ooH323EpSetUDPPortRange(int base, int max){   if(base <= 1024)      gH323ep.udpPorts.start = 1025;   else      gH323ep.udpPorts.start = base;   if(max > 65500)      gH323ep.udpPorts.max = 65500;   else       gH323ep.udpPorts.max = max;           if(gH323ep.udpPorts.max<gH323ep.udpPorts.start)   {      OOTRACEERR1("Error: Failed to set udp ports- Max port number"                  " less than Start port number\n");      return OO_FAILED;   }           gH323ep.udpPorts.current = gH323ep.udpPorts.start;           OOTRACEINFO1("UDP port range initialize - successful\n");   return OO_OK;}int ooH323EpSetRTPPortRange(int base, int max){   if(base <= 1024)      gH323ep.rtpPorts.start = 1025;   else      gH323ep.rtpPorts.start = base;   if(max > 65500)      gH323ep.rtpPorts.max = 65500;   else       gH323ep.rtpPorts.max = max;           if(gH323ep.rtpPorts.max<gH323ep.rtpPorts.start)   {      OOTRACEERR1("Error: Failed to set rtp ports- Max port number"                  " less than Start port number\n");      return OO_FAILED;   }           gH323ep.rtpPorts.current = gH323ep.rtpPorts.start;   OOTRACEINFO1("RTP port range initialize - successful\n");   return OO_OK;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?