[Asterisk-code-review] bridge softmix: Forward TEXT frames (asterisk[13])

George Joseph asteriskteam at digium.com
Thu Oct 5 12:09:20 CDT 2017


Hello Richard Mudgett, Jenkins2, Joshua Colp, 

I'd like you to reexamine a change. Please visit

    https://gerrit.asterisk.org/6614

to look at the new patch set (#5).

Change subject: bridge_softmix:  Forward TEXT frames
......................................................................

bridge_softmix:  Forward TEXT frames

res_pjsip_messaging queues TEXT frames to the channel when it
receives an in-dialog MESSAGE from an endpoint and chan_pjsip will
send an MESSAGE when it gets a TEXT frame.  On a normal
point-to-point call, the frames are forwarded between the two
correctly.  bridge_softmix was not though so messages weren't
getting forwarded to conference bridge participants.  Even if they were,
the bridging code had no way to tell the participants who sent the
message so it would look like it came from the bridge itself.

* The TEXT frame type doesn't allow storage of any meta data, such
as sender, on the frame so a new TEXT_DATA frame type was added that
uses the new ast_msg_data structure as its payload.  A channel
driver can queue a frame of that type when it receives a message
from outside.  A channel driver can use it for sending messages
by implementing the new send_text_data channel tech callback and
setting the new AST_CHAN_TP_SEND_TEXT_DATA flag in its tech
properties.  If set, the bridging/channel core will use it instead
of the original send_text callback and it will get the ast_msg_data
structure. Channel drivers aren't required to implement this.  Even
if a TEXT_DATA enabled driver uses it for incoming messages, an
outgoing channel driver that doesn't will still have it's send_text
callback called with only the message text just as before.

* res_pjsip_messaging now creates a TEXT_DATA frame for incoming
in-dialog messages and sets the "from" to the display name in the
"From" header, or if that's empty, the caller id name from the
channel.  This allows the chat client user to set a friendly name
for the chat.

* bridge_softmix now forwards TEXT and TEXT_DATA frames to all
participants (except the sender).

* A new function "ast_sendtext_data" was added to channel which
takes an ast_msg_data structure and calls a channel's
send_text_data callback, or if that's not defined, the original
send_text callback.

* bridge_channel now calls ast_sendtext_data for TEXT_DATA frame
types and ast_sendtext for TEXT frame types.

* chan_pjsip now uses the "from" name in the ast_msg_data structure
(if it exists) to set the "From" header display name on outgoing text
messages.

Change-Id: Idacf5900bfd5f22ab8cd235aa56dfad090d18489
---
M bridges/bridge_softmix.c
M channels/chan_pjsip.c
M funcs/func_frame_trace.c
M include/asterisk/channel.h
M include/asterisk/frame.h
M include/asterisk/message.h
M main/bridge_channel.c
M main/channel.c
M main/message.c
M res/res_pjsip_messaging.c
10 files changed, 268 insertions(+), 32 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/14/6614/5
-- 
To view, visit https://gerrit.asterisk.org/6614
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Idacf5900bfd5f22ab8cd235aa56dfad090d18489
Gerrit-Change-Number: 6614
Gerrit-PatchSet: 5
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171005/2470bbd1/attachment.html>


More information about the asterisk-code-review mailing list