File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,11 @@ @interface MXCall ()
6767 The date when the communication has been established.
6868 */
6969 NSDate *callConnectedDate;
70+
71+ /* *
72+ The date for gk.call.answer timestamp event
73+ */
74+ NSDate *answerConnectedDate;
7075
7176 /* *
7277 The total duration of the call. It is computed when the call ends.
@@ -968,7 +973,11 @@ - (NSUInteger)duration
968973
969974 if (MXCallStateConnected == _state)
970975 {
971- duration = [[NSDate date ] timeIntervalSinceDate: callConnectedDate] * 1000 ;
976+ if (answerConnectedDate) {
977+ duration = [[NSDate date ] timeIntervalSinceDate: answerConnectedDate] * 1000 ;
978+ } else {
979+ duration = [[NSDate date ] timeIntervalSinceDate: callConnectedDate] * 1000 ;
980+ }
972981 }
973982 else if (MXCallStateEnded == _state)
974983 {
@@ -1217,6 +1226,11 @@ - (void)handleCallAnswer:(MXEvent *)event
12171226{
12181227 MXLogDebug (@" [MXCall][%@ ] handleCallAnswer" , _callId)
12191228
1229+ if (_isGkCall) {
1230+ // reset call connected date
1231+ answerConnectedDate = [NSDate dateWithTimeIntervalSince1970: (event.originServerTs / 1000 )];
1232+ }
1233+
12201234 if ([self isMyEvent: event])
12211235 {
12221236 return ;
You can’t perform that action at this time.
0 commit comments