asterisk/funcs
George Joseph 4fb7967c73 bridge_softmix: Forward TEXT frames
Core bridging and, more specifically, bridge_softmix have been
enhanced to relay received frames of type TEXT or TEXT_DATA to all
participants in a softmix bridge.  res_pjsip_messaging and
chan_pjsip have been enhanced to take advantage of this so when
res_pjsip_messaging receives an in-dialog MESSAGE message from a
user in a conference call, it's relayed to all other participants
in the call.

res_pjsip_messaging already 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
2018-04-17 10:30:23 -06:00
..
Makefile Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_aes.c loader: Add dependency fields to module structures. 2018-01-15 13:25:51 -05:00
func_base64.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_blacklist.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_callcompletion.c loader: Convert reload_classes to built-in modules. 2018-03-14 05:20:12 -04:00
func_callerid.c func_callerid: Initialize app argument structures. 2017-12-18 20:35:12 -05:00
func_cdr.c loader: Convert reload_classes to built-in modules. 2018-03-14 05:20:12 -04:00
func_channel.c func_channel: Delete dead CHANNEL_TRACE code 2018-03-20 15:58:38 +01:00
func_config.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_curl.c Remove redundant module checks and references. 2018-01-24 13:37:29 -05:00
func_cut.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_db.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_devstate.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_dialgroup.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
func_dialplan.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_enum.c loader: Convert reload_classes to built-in modules. 2018-03-14 05:20:12 -04:00
func_env.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
func_extstate.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_frame_trace.c bridge_softmix: Forward TEXT frames 2018-04-17 10:30:23 -06:00
func_global.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_groupcount.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_hangupcause.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
func_holdintercept.c modules: change module LOAD_FAILUREs to LOAD_DECLINES 2017-04-12 15:57:21 -06:00
func_iconv.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_jitterbuffer.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_lock.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_logic.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_math.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
func_md5.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_module.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
func_odbc.c BuildSystem: Depend not implicitly but explicitly on external libraries. 2018-03-06 14:33:14 +01:00
func_periodic_hook.c Remove redundant module checks and references. 2018-01-24 13:37:29 -05:00
func_periodic_hook.exports.in Fix error loading res_monitor. 2014-04-23 15:02:39 +00:00
func_pitchshift.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_pjsip_aor.c loader: Add dependency fields to module structures. 2018-01-15 13:25:51 -05:00
func_pjsip_contact.c loader: Add dependency fields to module structures. 2018-01-15 13:25:51 -05:00
func_pjsip_endpoint.c loader: Add dependency fields to module structures. 2018-01-15 13:25:51 -05:00
func_presencestate.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_rand.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_realtime.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
func_sha1.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_shell.c AST-2017-006: Fix app_minivm application MinivmNotify command injection 2017-08-30 18:43:38 +00:00
func_sorcery.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_speex.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_sprintf.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_srv.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_strings.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_sysinfo.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_talkdetect.c modules: change module LOAD_FAILUREs to LOAD_DECLINES 2017-04-12 15:57:21 -06:00
func_timeout.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_uri.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_version.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_vmcount.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
func_volume.c Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00