Skip to content

Commit 46f74b0

Browse files
committed
Fixed bug for incoming call.
1 parent 224d14d commit 46f74b0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

lib/src/rtc_session.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -675,11 +675,11 @@ class RTCSession extends EventManager {
675675
this._failed('system', null, null, null, 500,
676676
DartSIP_C.causes.CONNECTION_ERROR, 'Transport Error');
677677
});
678-
} catch (error) {
678+
} catch (error, s) {
679679
if (this._status == C.STATUS_TERMINATED) {
680680
return;
681681
}
682-
logger.error('Failed to answer(): ${error.toString()}');
682+
logger.error('Failed to answer(): ${error.toString()}', error, s );
683683
}
684684
}
685685

@@ -1635,7 +1635,7 @@ class RTCSession extends EventManager {
16351635
if (candidate != null) {
16361636
this.emit(EventIceCandidate(candidate, ready));
16371637
if (!finished) {
1638-
ready();
1638+
//ready();
16391639
}
16401640
}
16411641
};
@@ -2693,14 +2693,15 @@ class RTCSession extends EventManager {
26932693
* @param {IncomingRequest} request
26942694
* @param {Array} responseExtraHeaders Extra headers for the 200 response.
26952695
*/
2696-
_handleSessionTimersInIncomingRequest(request, responseExtraHeaders) {
2696+
_handleSessionTimersInIncomingRequest(IncomingRequest request, responseExtraHeaders) {
26972697
if (!this._sessionTimers.enabled) {
26982698
return;
26992699
}
27002700

27012701
var session_expires_refresher;
27022702

2703-
if (request.session_expires > 0 &&
2703+
if (request.session_expires != null &&
2704+
request.session_expires > 0 &&
27042705
request.session_expires >= DartSIP_C.MIN_SESSION_EXPIRES) {
27052706
this._sessionTimers.currentExpires = request.session_expires;
27062707
session_expires_refresher = request.session_expires_refresher ?? 'uas';

lib/src/transports/websocket_interface.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class WebSocketInterface implements Socket {
4242
throw new AssertionError('Invalid argument: ${url}');
4343
} else {
4444
var port = parsed_url.port != null ? ':${parsed_url.port}' : '';
45-
this._sip_uri = 'sip:${parsed_url.host}${port};transport=ws';
45+
this._sip_uri = 'sip:${parsed_url.host}${port};transport=${parsed_url.scheme}';
4646
logger.debug('SIP URI: ${this._sip_uri}');
4747
this._via_transport = parsed_url.scheme.toUpperCase();
4848
}

0 commit comments

Comments
 (0)