Skip to content

Conversation

@wangzhenzhe
Copy link
Contributor

@wangzhenzhe wangzhenzhe commented Jun 22, 2020

Add support listening to incoming SIP text message

  • Move EventNewMessage from internal event as export event type to be used.
  • Add a new override function void onNewMessage(SIPMessageRequest msg) to interface. User should process the new incoming text message in this function.
  • Fix the problem that content length of SIP message was not calculated correctly when UTF-8 characters were met.
  • Modify the example to show the incoming text message on dial pad screen.

In the new example, send text message to registed client of the SIP UA, the message will be shown on dial pad screen. And the code handling incoming message looks like below in dialpad.dart.

void onNewMessage(SIPMessageRequest msg) {
//Save the incoming message to DB
String msgBody = msg.request.body as String;
setState(() {
receivedMsg = msgBody;
});
}

@cloudwebrtc
Copy link
Member

LGTM

@cloudwebrtc cloudwebrtc merged commit 9fe59dd into flutter-webrtc:master Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants