-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathTestStartCallSpeed.cpp
More file actions
56 lines (42 loc) · 1.18 KB
/
TestStartCallSpeed.cpp
File metadata and controls
56 lines (42 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "TestSipUserAgent.h"
void TestStartCallSpeed( int argc, char * argv[] )
{
if( argc != 3 )
{
printf( "[Usage] %s speed {count}\n", argv[0] );
return;
}
int iLoopCount = atoi( argv[2] );
CSipUserAgent clsUserAgent;
CSipStackSetup clsSetup;
CSipServerInfo clsServerInfo;
GetLocalIp( clsSetup.m_strLocalIp );
clsServerInfo.m_strUserId = "1000";
clsServerInfo.m_strPassWord = "1234";
clsServerInfo.m_strIp = "192.168.150.10";
clsUserAgent.InsertRegisterInfo( clsServerInfo );
if( clsUserAgent.Start( clsSetup, NULL ) == false )
{
printf( "clsUserAgent.Start() error\n" );
return;
}
CSipCallRtp clsRtp;
CSipCallRoute clsRoute;
std::string strCallId;
clsRtp.m_iCodec = 0;
clsRtp.m_strIp = clsSetup.m_strLocalIp;
clsRtp.m_iPort = 6000;
clsRoute.m_strDestIp = "192.168.0.1";
clsRoute.m_iDestPort = 5060;
DWORD dwStart = GetTickCount();
for( int i = 0; i < iLoopCount; ++i )
{
if( clsUserAgent.StartCall( "1000", "1001", &clsRtp, &clsRoute, strCallId ) == false )
{
printf( "clsUserAgent.StartCall() error\n" );
return;
}
}
DWORD dwEnd = GetTickCount();
printf( "%d ms\n", dwEnd - dwStart );
}