Question : VC++ mfc "passing values for a server connection"

Hello,
I'm writing  progarm in VC++ mfc to connect a server (SIP(Session initiation protocol)server). Think as normal server. Don't consider much about that(SIP).  I was able to open the port. But I can't pass the data to connect the server.
                                           because,
PortSIP_refer(m_SIPLib, 0, "sip:[email protected]3.59:5060"), method not work properly.

bool PortSIP_refer(HANDLE SIPCoreLib, long sessionId, const char * referTo);
Refer the call to another one.
Parameters
SIPCoreLib - Handle to the SIP Core SDK object. The PortSIP_initialize
function returns this handle.
sessionId - Session ID of the call.
referTo - Target of the refer, its must likes sip:[email protected]
Reture Value:
If the function succeeds, the return value is true, otherwise is false.
Remark:
Example: transfer the call to sip:[email protected].com:8000
PortSIP_refer(mSIPLib, sessionId, sip:[email protected]p.com:8000);
Or transfer the call to sip:[email protected]:
PortSIP_refer(mSIPLib, sessionId, sip:[email protected]);

if you know any other method to pass  that code "sip:[email protected]3.59:5060" without using above method, please tell me in detail. Port is opened and I only want to pass the data.

The output  is "test connection failed" in lower message box.

Code Snippet:
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:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
void Ctest10Dlg::OnBnClickedOk()
{
	// TODO: Add your control notification handler code here
#define SIPPORT_MIN	5000
	
		//HANDLE m_SIPLib;
//		ZeroMemory(m_SIPLib);
	UpdateData(TRUE);
	HANDLE m_DeviceManager;
	m_DeviceManager = Device_initialize();
 
	char localIP[64] = { 0 };
	Device_getLocalIP(m_DeviceManager, 0, localIP, 64);
 
	int nums = Device_getAudioOutputDeviceNums(m_DeviceManager);
	char deviceName[1024] = { 0 };
	for (int i=0; iThis is the code use //for server connection

Answer : VC++ mfc "passing values for a server connection"

Did you try enabling the logs and see what really went wrong? Why it falied.
voidPortSIP_enableLog(....)
Random Solutions  
 
programming4us programming4us