Skip to content
Snippets Groups Projects
  • George Joseph's avatar
    4fb7967c
    bridge_softmix: Forward TEXT frames · 4fb7967c
    George Joseph authored
    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
    4fb7967c
    History
    bridge_softmix: Forward TEXT frames
    George Joseph authored
    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