From f3c7b9217990687dc96229b9b3bc351d40b2c020 Mon Sep 17 00:00:00 2001 From: zi6xuan Date: Sat, 11 Sep 2021 23:15:37 +0900 Subject: [PATCH 1/3] hangup add the options hangup function increase self-determination option number of participants, expedient unity communication time notification --- lib/src/sip_ua_helper.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/sip_ua_helper.dart b/lib/src/sip_ua_helper.dart index 477571fb..2fc0c40a 100644 --- a/lib/src/sip_ua_helper.dart +++ b/lib/src/sip_ua_helper.dart @@ -412,9 +412,9 @@ class Call { refer.on(EventReferFailed(), (EventReferFailed data) {}); } - void hangup() { + void hangup(Map options) { assert(_session != null, 'ERROR(hangup): rtc session is invalid!'); - _session.terminate(); + _session.terminate(options); } void hold() { From 0e17fe67eea39d829b72876f72fc635027d1b893 Mon Sep 17 00:00:00 2001 From: cloudwebrtc Date: Sun, 19 Sep 2021 09:27:16 +0800 Subject: [PATCH 2/3] fix: Fix breaking changes. --- lib/src/sip_ua_helper.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/sip_ua_helper.dart b/lib/src/sip_ua_helper.dart index 2fc0c40a..93654602 100644 --- a/lib/src/sip_ua_helper.dart +++ b/lib/src/sip_ua_helper.dart @@ -412,7 +412,7 @@ class Call { refer.on(EventReferFailed(), (EventReferFailed data) {}); } - void hangup(Map options) { + void hangup([Map options]) { assert(_session != null, 'ERROR(hangup): rtc session is invalid!'); _session.terminate(options); } From 017ab497b88923289e375d32830035aae7a36c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=99=E9=87=91=E5=85=83?= Date: Tue, 12 Oct 2021 21:46:42 +0900 Subject: [PATCH 3/3] Add extended header support Add extended header support, in order to carry custom information when calling --- lib/src/sip_ua_helper.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/src/sip_ua_helper.dart b/lib/src/sip_ua_helper.dart index 8723ffe2..0fc7af7b 100644 --- a/lib/src/sip_ua_helper.dart +++ b/lib/src/sip_ua_helper.dart @@ -69,12 +69,16 @@ class SIPUAHelper extends EventManager { } Future call(String target, - {bool voiceonly = false, MediaStream mediaStream = null}) async { + {bool voiceonly = false, + MediaStream mediaStream = null, + List headers = const []}) async { if (_ua != null && _ua.isConnected()) { Map options = buildCallOptions(voiceonly); if (mediaStream != null) { options['mediaStream'] = mediaStream; } + List extHeaders = options['extraHeaders']; + extHeaders.addAll(headers); _ua.call(target, options); return true; } else { @@ -273,6 +277,7 @@ class SIPUAHelper extends EventManager { Map _defaultOptions = { 'eventHandlers': handlers, + 'extraHeaders': [], 'pcConfig': { 'sdpSemantics': 'unified-plan', 'iceServers': _uaSettings.iceServers @@ -391,6 +396,7 @@ class Call { String get id => _id; RTCPeerConnection get peerConnection => _session.connection; + RTCSession get session => _session; CallStateEnum state; void answer(Map options, {MediaStream mediaStream = null}) {