|
|
@@ -2162,39 +2162,39 @@ void CSIPPhoneSession::Handle_MakeCall( SpReqAnsContext<PhoneService_MakeCall_Re
|
|
|
cmd->strUri = ctx->Req.call_uri;
|
|
|
///////////重新初始化sip话机,防止断网导致IP改变//////////////////
|
|
|
|
|
|
- if (m_pEntity->m_pEndpoint)
|
|
|
- {
|
|
|
- Dbg("%s:%d m_pEndpoint is not null and it's addr is 0x%0x,destroy it.", __FUNCTION__, __LINE__, m_pEntity->m_pEndpoint);
|
|
|
- endpoint_destroy(m_pEntity->m_pEndpoint);
|
|
|
- m_pEntity->m_pEndpoint = NULL;
|
|
|
- }
|
|
|
- CSimpleStringA strUri = m_pEntity->MakeUri(m_pEntity->staticInfo.strTerminalID);
|
|
|
- if (strUri.GetLength() > 0) {
|
|
|
- strcpy(m_pEntity->conf.uri, strUri);
|
|
|
- m_pEntity->conf.media_start_port = REC_COMMON_AUDIO_PORT_START;
|
|
|
- m_pEntity->conf.media_stop_port = REC_COMMON_AUDIO_PORT_STOP;
|
|
|
- Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
- m_pEntity->m_pEndpoint = endpoint_create(m_pEntity, &m_pEntity->conf, m_pEntity->m_iPickupPhoneState);
|
|
|
- if (!m_pEntity->m_pEndpoint) {
|
|
|
- LOG_TRACE("create endpoint failed!");
|
|
|
- }
|
|
|
- else {
|
|
|
- Dbg("%s:%d endpoint_create m_pEndpoint addr is 0x%0x.", __FUNCTION__, __LINE__, m_pEntity->m_pEndpoint);
|
|
|
- }
|
|
|
+ if (m_pEntity->m_pEndpoint){
|
|
|
+ Dbg("%s:%d m_pEndpoint is not null and it's addr is 0x%0x,destroy it.", __FUNCTION__, __LINE__, m_pEntity->m_pEndpoint);
|
|
|
+ endpoint_destroy(m_pEntity->m_pEndpoint);
|
|
|
+ m_pEntity->m_pEndpoint = NULL;
|
|
|
+ }
|
|
|
+ CSimpleStringA strUri = m_pEntity->MakeUri(m_pEntity->staticInfo.strTerminalID);
|
|
|
+ if (strUri.GetLength() > 0) {
|
|
|
+ strcpy(m_pEntity->conf.uri, strUri);
|
|
|
+ m_pEntity->conf.media_start_port = REC_COMMON_AUDIO_PORT_START;
|
|
|
+ m_pEntity->conf.media_stop_port = REC_COMMON_AUDIO_PORT_STOP;
|
|
|
+ Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
+ m_pEntity->m_pEndpoint = endpoint_create(m_pEntity, &m_pEntity->conf, m_pEntity->m_iPickupPhoneState);
|
|
|
+ if (!m_pEntity->m_pEndpoint) {
|
|
|
+ LOG_TRACE("create endpoint failed!");
|
|
|
}
|
|
|
else {
|
|
|
- LOG_TRACE("strUri length equals zero!");
|
|
|
+ Dbg("%s:%d endpoint_create m_pEndpoint addr is 0x%0x.", __FUNCTION__, __LINE__, m_pEntity->m_pEndpoint);
|
|
|
}
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ LOG_TRACE("strUri length equals zero!");
|
|
|
+ }
|
|
|
|
|
|
- ErrorCodeEnum Error = m_pEntity->GetLocalIP();
|
|
|
- if (Error != 0) {
|
|
|
- LOG_TRACE("get local ip failed!");
|
|
|
- }
|
|
|
+ ErrorCodeEnum Error = m_pEntity->GetLocalIP();
|
|
|
+ if (Error != 0) {
|
|
|
+ LOG_TRACE("get local ip failed!");
|
|
|
+ ctx->Answer(Error_TimeOut);
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- if (m_pEntity->m_eDeviceType == eMobilePadType) {
|
|
|
- m_pEntity->m_stVideoParam.nUpDynamicFps = 3;
|
|
|
- }
|
|
|
-
|
|
|
+ if (m_pEntity->m_eDeviceType == eMobilePadType) {
|
|
|
+ m_pEntity->m_stVideoParam.nUpDynamicFps = 3;
|
|
|
+ }
|
|
|
|
|
|
///////////重新初始化sip话机,防止断网导致IP改变//////////////////
|
|
|
if (m_pEntity->GetEndpoint()) {
|