Skip to content

Commit 2ba90bd

Browse files
cloudwebrtczi6xuan趙金元
authored
Add extended header support (#235)
* hangup add the options hangup function increase self-determination option number of participants, expedient unity communication time notification * fix: Fix breaking changes. * Add extended header support Add extended header support, in order to carry custom information when calling Co-authored-by: zi6xuan <[email protected]> Co-authored-by: 趙金元 <[email protected]>
1 parent 3be8dc1 commit 2ba90bd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/src/sip_ua_helper.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,16 @@ class SIPUAHelper extends EventManager {
6969
}
7070

7171
Future<bool> call(String target,
72-
{bool voiceonly = false, MediaStream mediaStream = null}) async {
72+
{bool voiceonly = false,
73+
MediaStream mediaStream = null,
74+
List<String> headers = const []}) async {
7375
if (_ua != null && _ua.isConnected()) {
7476
Map<String, Object> options = buildCallOptions(voiceonly);
7577
if (mediaStream != null) {
7678
options['mediaStream'] = mediaStream;
7779
}
80+
List<dynamic> extHeaders = options['extraHeaders'];
81+
extHeaders.addAll(headers);
7882
_ua.call(target, options);
7983
return true;
8084
} else {
@@ -273,6 +277,7 @@ class SIPUAHelper extends EventManager {
273277

274278
Map<String, Object> _defaultOptions = <String, dynamic>{
275279
'eventHandlers': handlers,
280+
'extraHeaders': <dynamic>[],
276281
'pcConfig': <String, dynamic>{
277282
'sdpSemantics': 'unified-plan',
278283
'iceServers': _uaSettings.iceServers
@@ -391,6 +396,7 @@ class Call {
391396

392397
String get id => _id;
393398
RTCPeerConnection get peerConnection => _session.connection;
399+
RTCSession get session => _session;
394400
CallStateEnum state;
395401

396402
void answer(Map<String, Object> options, {MediaStream mediaStream = null}) {

0 commit comments

Comments
 (0)