Skip to content

Commit af1d6e5

Browse files
Add sendMessage to Call (#361)
* Add sendMessage to Call * Add body to options if key is not setted * Fix error message on sendMessage method * Upgrading intl dependency --------- Co-authored-by: EduardoAlberti <eduardo.alberti.d@gmail.com>
1 parent 4bfffd8 commit af1d6e5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/src/sip_ua_helper.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,15 @@ class Call {
507507
_session.sendInfo(contentType, body, options);
508508
}
509509

510+
void sendMessage(String body, [Map<String, dynamic>? options]) {
511+
assert(_session != null, 'ERROR(sendMessage): rtc session is invalid');
512+
513+
options?.putIfAbsent('body', () => body);
514+
515+
_session.sendRequest(DartSIP_C.SipMethod.MESSAGE,
516+
options ?? <String, dynamic>{'body': body});
517+
}
518+
510519
String? get remote_display_name {
511520
assert(_session != null,
512521
'ERROR(get remote_identity): rtc session is invalid!');

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dependencies:
1010
collection: ^1.15.0
1111
crypto: ^3.0.0
1212
flutter_webrtc: ^0.9.25
13-
intl: ^0.17.0
13+
intl: ^0.18.1
1414
logger: ^1.0.0
1515
parser_error: ^0.2.0
1616
path: ^1.6.4

0 commit comments

Comments
 (0)