📄 osptokeninfo.c
字号:
/**########################################################################*########################################################################*########################################################################** COPYRIGHT (c) 1998, 1999 by TransNexus, LLC * * This software contains proprietary and confidential information * of TransNexus, LLC. Except as may be set forth in the license * agreement under which this software is supplied, use, disclosure, * or reproduction is prohibited without the prior, express, written* consent of TransNexus, LLC. * *******#########################################################################*#########################################################################*#########################################################################*//* * osptokeninfo.c - OSP token info functions */#include "osp.h"#include "osperrno.h"#include "ospbfr.h"#include "osplist.h"#include "ospxmlattr.h"#include "ospxmlelem.h"#include "ospmsgattr.h"#include "ospmsgelem.h"#include "osptokeninfo.h"#include "ospusage.h"#include "osputils.h"#ifdef OSPC_DEBUG/**//*-----------------------------------------------------------------------* * OSPPTokenInfoSetSourceNumber() - set the source number *-----------------------------------------------------------------------*/void /* nothing returned */OSPPTokenInfoSetSourceNumber( OSPTTOKENINFO *ospvTokenInfo, /* token info to set */ const unsigned char *ospvSourceNumber /* source number to set to */){ if (ospvTokenInfo != OSPC_OSNULL) { if (ospvSourceNumber != OSPC_OSNULL) { OSPM_STRNCPY((ospvTokenInfo)->ospmTokenInfoSourceNumber, (ospvSourceNumber), OSPC_E164NUMSIZE-1); } } return;}/**//*-----------------------------------------------------------------------* * OSPPTokenInfoGetSourceNumber() - returns the source number for token info *-----------------------------------------------------------------------*/unsigned char *OSPPTokenInfoGetSourceNumber( OSPTTOKENINFO *ospvTokenInfo /* token info */){ unsigned char *ospvSourceNumber = OSPC_OSNULL; if (ospvTokenInfo != OSPC_OSNULL) { ospvSourceNumber = ospvTokenInfo->ospmTokenInfoSourceNumber; } return ospvSourceNumber;}/**//*-----------------------------------------------------------------------* * OSPPTokenInfoSetDestNumber() - set the destination number *-----------------------------------------------------------------------*/void /* nothing returned */OSPPTokenInfoSetDestNumber( OSPTTOKENINFO *ospvTokenInfo, /* token info to set */ const unsigned char *ospvDestNumber /* destination number to set to */){ if (ospvTokenInfo != OSPC_OSNULL) { if (ospvDestNumber != OSPC_OSNULL) { OSPM_STRNCPY((ospvTokenInfo)->ospmTokenInfoDestNumber, (ospvDestNumber), OSPC_E164NUMSIZE-1); } } return;}/**//*-----------------------------------------------------------------------* * OSPPTokenInfoGetDestNumber() - returns the destination number for a token info *-----------------------------------------------------------------------*/unsigned char *OSPPTokenInfoGetDestNumber( OSPTTOKENINFO *ospvTokenInfo /* token info */){ unsigned char *ospvDestNumber = OSPC_OSNULL; if (ospvTokenInfo != OSPC_OSNULL) { ospvDestNumber = ospvTokenInfo->ospmTokenInfoDestNumber; } return ospvDestNumber;}/**//*-----------------------------------------------------------------------* * OSPPTokenInfoHasCallId() - is the call id set ? *-----------------------------------------------------------------------*/unsigned /* returns non-zero if number exists */OSPPTokenInfoHasCallId( OSPTTOKENINFO *ospvTokenInfo /* Token Info effected */){ unsigned ospvHasCallId = OSPC_FALSE; if (ospvTokenInfo != OSPC_OSNULL) { ospvHasCallId = ((ospvTokenInfo)->ospmTokenInfoCallId != OSPC_OSNULL); } return ospvHasCallId;}/**//*-----------------------------------------------------------------------* * OSPPTokenInfoSetCallId() - set the call id *-----------------------------------------------------------------------*/void /* nothing returned */OSPPTokenInfoSetCallId( OSPTTOKENINFO *ospvTokenInfo, /* token info to set */ OSPTCALLID *ospvCallId /* call id to set to */){ if (ospvTokenInfo != OSPC_OSNULL) { if ((ospvCallId) != OSPC_OSNULL) { if ((ospvTokenInfo)->ospmTokenInfoCallId != OSPC_OSNULL) { OSPPCallIdDelete(&((ospvTokenInfo)->ospmTokenInfoCallId)); } (ospvTokenInfo)->ospmTokenInfoCallId = OSPPCallIdNew((ospvCallId)->ospmCallIdLen, (ospvCallId)->ospmCallIdVal); } }}/**//*-----------------------------------------------------------------------* * OSPPTokenInfoGetCallId() - returns the call id for a token info *-----------------------------------------------------------------------*/OSPTCALLID * OSPPTokenInfoGetCallId( OSPTTOKENINFO *ospvTokenInfo /* token info */ ){ OSPTCALLID *ospvCallId = OSPC_OSNULL; if (ospvTokenInfo != OSPC_OSNULL) { ospvCallId = ospvTokenInfo->ospmTokenInfoCallId; } return ospvCallId;}/**//*-----------------------------------------------------------------------* * OSPPTokenInfoGetCallIdValue() - returns the call id for a token info *-----------------------------------------------------------------------*/unsigned char * OSPPTokenInfoGetCallIdValue( OSPTTOKENINFO *ospvTokenInfo /* token info */ ){ unsigned char *ospvCallIdValue = OSPC_OSNULL; if (ospvTokenInfo != OSPC_OSNULL) { ospvCallIdValue = OSPPCallIdGetValue(((ospvTokenInfo)->ospmTokenInfoCallId)); } return(ospvCallIdValue);}/**//*-----------------------------------------------------------------------* * OSPPTokenInfoHasValidAfter() - Does TokenInfo have a valid after time? *-----------------------------------------------------------------------*/unsigned /* returns non-zero if time */OSPPTokenInfoHasValidAfter( OSPTTOKENINFO *ospvTokenInfo /* TokenInfo in question */){ unsigned ospvHasValidAfter = OSPC_FALSE; if (ospvTokenInfo != OSPC_OSNULL) { ospvHasValidAfter = ((ospvTokenInfo)->ospmTokenInfoValidAfter != OSPC_TIMEMIN); } return(ospvHasValidAfter);}/**//*-----------------------------------------------------------------------* * OSPPTokenInfoSetValidAfter() - sets the valid after time *-----------------------------------------------------------------------*/void /* nothing returned */OSPPTokenInfoSetValidAfter( OSPTTOKENINFO *ospvTokenInfo, OSPTTIME ospvTime){ if (ospvTokenInfo != OSPC_OSNULL) { (ospvTokenInfo)->ospmTokenInfoValidAfter = (ospvTime); }}/**//*-----------------------------------------------------------------------* * OSPPTokenInfoGetValidAfter() - returns valid after time *-----------------------------------------------------------------------*/OSPTTIME /* returns the time value */ OSPPTokenInfoGetValidAfter( OSPTTOKENINFO *ospvTokenInfo /* TokenInfo in question */ ){ OSPTTIME ospvValidAfter = 0; if (ospvTokenInfo != OSPC_OSNULL) { ospvValidAfter = (ospvTokenInfo)->ospmTokenInfoValidAfter; } return(ospvValidAfter);}/**//*-----------------------------------------------------------------------* * OSPPTokenInfoSetValidUntil() - sets valid until time *-----------------------------------------------------------------------*/void /* nothing returned */OSPPTokenInfoSetValidUntil( OSPTTOKENINFO *ospvTokenInfo, /* TokenInfo in question */ OSPTTIME ospvTime /* time to set */){ if (ospvTokenInfo != OSPC_OSNULL) { (ospvTokenInfo)->ospmTokenInfoValidUntil = (ospvTime); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -