equal
deleted
inserted
replaced
66 { |
66 { |
67 gint ret(TMS_RESULT_SUCCESS); |
67 gint ret(TMS_RESULT_SUCCESS); |
68 TRACE_PRN_FN_ENT; |
68 TRACE_PRN_FN_ENT; |
69 iSession = new TMSCallProxy(); |
69 iSession = new TMSCallProxy(); |
70 |
70 |
71 TRACE_PRN_FN_ENT; |
71 if (iSession) |
72 if (!iSession) |
72 { |
73 { |
73 if (iSession->Connect() != TMS_RESULT_SUCCESS) |
74 ret = TMS_RESULT_INSUFFICIENT_MEMORY; |
74 { |
75 } |
|
76 RET_REASON_IF_ERR(ret); |
|
77 |
|
78 if (iSession->Connect() != TMS_RESULT_SUCCESS) |
|
79 { |
|
80 delete iSession; |
|
81 iSession = NULL; |
|
82 ret = TMS_RESULT_FATAL_ERROR; |
|
83 } |
|
84 else |
|
85 { |
|
86 ret = iSession->CreateCall(TMS_CALL_IP); |
|
87 if (ret != TMS_RESULT_SUCCESS && ret != TMS_RESULT_ALREADY_EXIST) |
|
88 { |
|
89 iSession->Close(); |
|
90 delete iSession; |
75 delete iSession; |
91 iSession = NULL; |
76 iSession = NULL; |
92 ret = TMS_RESULT_FATAL_ERROR; |
77 ret = TMS_RESULT_FATAL_ERROR; |
93 } |
78 } |
94 } |
79 else |
95 RET_REASON_IF_ERR(ret); |
80 { |
|
81 ret = iSession->CreateCall(TMS_CALL_IP); |
|
82 if (ret != TMS_RESULT_SUCCESS && ret != TMS_RESULT_ALREADY_EXIST) |
|
83 { |
|
84 iSession->Close(); |
|
85 delete iSession; |
|
86 ret = TMS_RESULT_FATAL_ERROR; |
|
87 } |
|
88 } |
|
89 } |
|
90 else |
|
91 { |
|
92 ret = TMS_RESULT_INSUFFICIENT_MEMORY; |
|
93 } |
96 TRACE_PRN_FN_EXT; |
94 TRACE_PRN_FN_EXT; |
97 return ret; |
95 return ret; |
98 } |
96 } |
99 |
97 |
100 TMSCallType TMSIPCallBodyImpl::GetCallType() |
98 TMSCallType TMSIPCallBodyImpl::GetCallType() |
101 { |
99 { |
102 return TMS_CALL_IP; |
100 TMSCallType ctype(TMS_CALL_IP); |
|
101 return ctype; |
103 } |
102 } |
104 |
103 |
105 gint TMSIPCallBodyImpl::GetCallContextId(guint& ctxid) |
104 gint TMSIPCallBodyImpl::GetCallContextId(guint& ctxid) |
106 { |
105 { |
107 gint ret(TMS_RESULT_FEATURE_NOT_SUPPORTED); |
106 gint ret(TMS_RESULT_FEATURE_NOT_SUPPORTED); |
126 if (ret == TMS_RESULT_SUCCESS) |
125 if (ret == TMS_RESULT_SUCCESS) |
127 { |
126 { |
128 ret = AddStreamToList(strm); |
127 ret = AddStreamToList(strm); |
129 } |
128 } |
130 //TODO:Need longer term fix to not destory everything |
129 //TODO:Need longer term fix to not destory everything |
131 //if more than one stream is trying to be created. |
130 //if more the one stream is trying to be created. |
132 else if (ret == TMS_RESULT_ALREADY_EXIST) |
131 else if (ret == TMS_RESULT_ALREADY_EXIST) |
133 { |
132 { |
134 break; |
133 break; |
135 } |
134 } |
136 else |
135 else |
192 } |
191 } |
193 } |
192 } |
194 |
193 |
195 if (itStrm) |
194 if (itStrm) |
196 { |
195 { |
197 // Remove stream object from the vector. After removing, the iterator |
|
198 // will point to the next item (if available); so, do NOT attempt |
|
199 // deleting itStrm here! (Will result in KERN-EXEC) |
|
200 iStreamsVector.erase(itStrm); // Remove from array |
196 iStreamsVector.erase(itStrm); // Remove from array |
|
197 // Don't delete itStrm as the iterator advanced to the next |
|
198 // item on the list |
201 ret = TMSStreamImpl::Delete(strm); |
199 ret = TMSStreamImpl::Delete(strm); |
202 } |
200 } |
203 TRACE_PRN_FN_EXT; |
201 TRACE_PRN_FN_EXT; |
204 return ret; |
202 return ret; |
205 } |
203 } |