示例#1
0
void AutoAcceptCallbackProc(SIPX_CALL hCall,
                            SIPX_LINE hLine,
							SIPX_CALLSTATE_MAJOR eMajor,
							SIPX_CALLSTATE_MINOR eMinor,
							void* pUser)
{
    char szBuffer[128] ;
    char* szEventDesc = sipxCallEventToString(eMajor, eMinor, szBuffer, sizeof(szBuffer)) ;
	if(eMinor == NEW_CALL_NORMAL)
	{
		if(sipxCallAccept(hCall) == SIPX_RESULT_SUCCESS)
		{
			printf("Call with ID %d has been accepted.\n", hCall);
		}
		else
		{
			printf("Call with ID %d failed to be accepted.\n", hCall);
		}
	}
	else if(eMinor == DISCONNECTED_NORMAL)
	{
		sipxCallDestroy(hCall);
	}
	
    
}
示例#2
0
void EventRecorder::addCompareEvent(SIPX_LINE hLine, SIPX_CALLSTATE_EVENT eMajor, SIPX_CALLSTATE_CAUSE eMinor) 
{
    char szBuffer[256] ;
    char szBuffer2[256];
    
    sipxCallEventToString((SIPX_CALLSTATE_MAJOR)(int)eMajor,
        (SIPX_CALLSTATE_MINOR)(int)eMinor,
        szBuffer, sizeof(szBuffer));
    sprintf(szBuffer2, "hLine-%d: %s", hLine, szBuffer);
    m_compareEvents[m_numCompareEvents++] = strdup(szBuffer2) ;
}
示例#3
0
UtlString* EventValidator::allocCallStateEntry(SIPX_CALL hCall,
                                               SIPX_LINE hLine,
                                               SIPX_CALLSTATE_EVENT event,
                                               SIPX_CALLSTATE_CAUSE cause)
{
   char szBuffer[256];
   char szBuffer2[256];


   sipxCallEventToString(
      event, 
      cause, 
      szBuffer, 
      sizeof(szBuffer));

   sprintf(szBuffer2, "<CALL> hLine=%d, hCall=%d: %s", 
      hLine, 
      hCall,
      szBuffer);

   return new UtlString(szBuffer2);
}
void AutoRedirectCallbackProc(SIPX_CALL hCall,
                              SIPX_LINE hLine,
							  SIPX_CALLSTATE_MAJOR eMajor,
                              SIPX_CALLSTATE_MINOR eMinor,
						      void* pUser)
{
    char szBuffer[128] ;
    char* szEventDesc = sipxCallEventToString(eMajor, eMinor, szBuffer, sizeof(szBuffer)) ;
	if(eMinor == OFFERING_ACTIVE)
	{
		if(sipxCallRedirect(hCall, ((const char*)pUser)) == SIPX_RESULT_SUCCESS)
		{
			printf("Call with ID %d has been redirected.\n", hCall);
		}
		else
		{
			printf("Call with ID %d failed to be redirected.\n", hCall);
		}
	}
	else if(eMajor == DISCONNECTED)
	{
		sipxCallDestroy(hCall);
	}
}