For that i am doing the following steps at Intialization
RTCClient->put_ListenForIncomingSessions(RTCLM_DYNAMIC);
BSTR InternalLocalAddr = SysAllocString(LocalIpAdrr);
long InternalLocalPort = 7100;
IRTCClientPortManagement *ClientPortMan = NULL;
RTCClient->QueryInterface(IID_IRTCClientPortManagement,(void **)
&ClientPortMan ); pClientPortManagement-
>StartListenAddressAndPort(InternalLocalAddr ,
InternalLocalPort);
After that i have derived a class from IRTCPortManager
and implemented
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void
**ppvObject);
ULONG STDMETHODCALLTYPE AddRef(void);
ULONG STDMETHODCALLTYPE Release(void);
HRESULT STDMETHODCALLTYPE GetMapping(BSTR
bstrRemoteAddress,RTC_PORT_TYPE enPortType, BSTR
*pbstrInternalLocalAddress,long *plInternalLocalPort, BSTR
*pbstrExternalLocalAddress,long *plExternalLocalPort) ;
HRESULT STDMETHODCALLTYPE UpdateRemoteAddress(BSTR
bstrRemoteAddress,BSTR bstrInternalLocalAddress,long
lInternalLocalPort, BSTR bstrExternalLocalAddress,long
lExternalLocalPort);
HRESULT STDMETHODCALLTYPE ReleaseMapping( BSTR
bstrInternalLocalAddress,long lInternalLocalPort, BSTR
bstrExternalLocalAddress,long lExternalLocalPort);
In Makecall i did the steps as follows
RTCClient->CreateSession(RTCST_PC_TO_PC, NULL, NULL, NULL, &Session);
IRTCSessionPortManagement *SPortManagement = NULL;
Session->QueryInterface(IID_IRTCSessionPortManagement, (void **)
&SPortManagement);
PortManager = new CCPortManager();//derived class name
IRTCPortManager *pPortManager = NULL;
PortManager->QueryInterface(IID_IRTCPortManager,
(void**)&pPortManager);
SPortManagement->SetPortManager(pPortManager);
after this RTC is calling my implentation of Getmapping automatically
not calling manually
My implementation for Getmapping is as follows
HRESULT STDMETHODCALLTYPE CPortManager::GetMapping(BSTR RemoteAddr,
RTC_PORT_TYPE PortType,
BSTR *InternLocalAddr,long *ILocalPort, BSTR *ELocalAddr,long
*ELocalPort)
{
HRESULT Result = S_OK;
char ILocalIp[20];
WCHAR ILocalIpAdrr[20];
BSTR InternalLocalAddr = SysAllocString("1.1.1.1");//Internal Local
Ip addr
InternLocalAddr = &InternalLocalAddr;
ExternalLocalAddr = &Remote;// Remoteaddress
switch(PType)
{
case RTCPT_AUDIO_RTP:
*ILocalPort = 20000;
*ELocalPort = 30000;
break;
case RTCPT_AUDIO_RTCP:
*ILocalPort = 40100;
*ELocalPort = 50100;
break;
case RTCPT_SIP:
*ILocalPort = 7101;
*ELocalPort = 9001;
break;
} return Result;
}
After Getmapping returns i call the
Session->AddParticipant(Destination, NULL, NULL);
but it is returning with error E_POINTER
but i am getting the Session from createsession correctly
Can any one help me on this issue
Thanks in advance
At a quick glace:
a. You should check the return code of the RTC functions as it tells
you if the function succeeded.
hr = m_pClient->CreateSession(
enType,
NULL,
NULL,
RTCCS_FORCE_PROFILE, // | RTCCS_FAIL_ON_REDIRECT,
&pSession
);
if (FAILED(hr))
{
// CreateSession failed
DEBUG_PRINT(("CreateSession failed %x", hr ));
return hr;
}
b. To be on the safe side do:
PortManager = new CCPortManager();//derived class name
IRTCPortManager *pPortManager = PortManager;
// PortManager->QueryInterface(IID_IRTCPortManager,
(void**)&pPortManager);
SPortManagement->SetPortManager(pPortManager);
Tell me if my 'hunch' was correct.
Michael
Hi michael,
Thanks for yr response
I have checked the error condition as u said in CreateSession
i am getting the session correctly
and i did as u told but still it showing the same error in
addparticipant as i mention above
can u help me to solve it any other way
Regards
Rakesh
I have seen your block on net for softphone.
I have also develop softphone using MS RTC Client API 1.3.
It's working fine for direct number i.e any mobile or landline number.
But when we are dailing at that number which has required extension number.
i.e. system generated voice please dial extension number.
How we can handle this and make call on that extension number.
If you have any solution please help me as soon as possible.
Thanks
Regards:
Sharad
Email:shar...@gmail.com