<p>Richard Mudgett has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8137">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_confbridge: ConfbridgeList event has standard channel shapshot headers.<br><br>* Made the AMI ConfbridgeList action's ConfbridgeList events output all<br>the standard channel snapshot headers instead of a few hand-coded channel<br>snapshot headers.  The benefit is that the CallerIDName gets disruptive<br>characters like CR, LF, Tab, and a few others escaped.  However, an empty<br>CallerIDName is now output as "<unknown>" instead of "<no name>".<br><br>ASTERISK-27651<br><br>Change-Id: Iaf7d54a9d40194c2db060bc9b4979fab6720d977<br>---<br>M CHANGES<br>M UPGRADE.txt<br>M apps/app_confbridge.c<br>3 files changed, 102 insertions(+), 18 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/37/8137/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/CHANGES b/CHANGES<br>index a6351be..27cc326 100644<br>--- a/CHANGES<br>+++ b/CHANGES<br>@@ -23,6 +23,12 @@<br>  * Added the Muted header to the ConfbridgeJoin AMI event to indicate the<br>    participant's starting mute status.<br> <br>+ * Made the AMI ConfbridgeList action's ConfbridgeList events output all<br>+   the standard channel snapshot headers instead of a few hand-coded channel<br>+   snapshot headers.  The benefit is that the CallerIDName gets disruptive<br>+   characters like CR, LF, Tab, and a few others escaped.  However, an empty<br>+   CallerIDName is now output as "<unknown>" instead of "<no name>".<br>+<br> app_followme<br> ------------------<br>  * Added a new prompt, connecting-prompt, which will be played<br>diff --git a/UPGRADE.txt b/UPGRADE.txt<br>index 5d5cf8d..630c696 100644<br>--- a/UPGRADE.txt<br>+++ b/UPGRADE.txt<br>@@ -23,6 +23,14 @@<br> <br> From 13.19.0 to 13.20.0:<br> <br>+app_confbridge<br>+------------------<br>+ * Made the AMI ConfbridgeList action's ConfbridgeList events output all<br>+   the standard channel snapshot headers instead of a few hand-coded channel<br>+   snapshot headers.  The benefit is that the CallerIDName gets disruptive<br>+   characters like CR, LF, Tab, and a few others escaped.  However, an empty<br>+   CallerIDName is now output as "<unknown>" instead of "<no name>".<br>+<br> res_pjsip<br> ------------------<br>  * Users who are matching endpoints by SIP header need to reevaluate their<br>diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c<br>index 1380d3c..ba6bb29 100644<br>--- a/apps/app_confbridge.c<br>+++ b/apps/app_confbridge.c<br>@@ -69,6 +69,7 @@<br> #include "asterisk/test.h"<br> #include "asterisk/stasis.h"<br> #include "asterisk/stasis_bridges.h"<br>+#include "asterisk/stasis_channels.h"<br> #include "asterisk/json.h"<br> #include "asterisk/format_cache.h"<br> #include "asterisk/taskprocessor.h"<br>@@ -228,6 +229,62 @@<br>                         ConfbridgeListComplete.</para><br>          </description><br>  </manager><br>+     <managerEvent language="en_US" name="ConfbridgeList"><br>+              <managerEventInstance class="EVENT_FLAG_REPORTING"><br>+                  <synopsis>Raised as part of the ConfbridgeList action response list.</synopsis><br>+                  <syntax><br>+                               <parameter name="Conference"><br>+                                        <para>The name of the Confbridge conference.</para><br>+                              </parameter><br>+                           <parameter name="Admin"><br>+                                     <para>Identifies this user as an admin user.</para><br>+                                      <enumlist><br>+                                             <enum name="Yes"/><br>+                                           <enum name="No"/><br>+                                    </enumlist><br>+                            </parameter><br>+                           <parameter name="MarkedUser"><br>+                                        <para>Identifies this user as a marked user.</para><br>+                                      <enumlist><br>+                                             <enum name="Yes"/><br>+                                           <enum name="No"/><br>+                                    </enumlist><br>+                            </parameter><br>+                           <parameter name="WaitMarked"><br>+                                        <para>Must this user wait for a marked user to join?</para><br>+                                      <enumlist><br>+                                             <enum name="Yes"/><br>+                                           <enum name="No"/><br>+                                    </enumlist><br>+                            </parameter><br>+                           <parameter name="EndMarked"><br>+                                 <para>Does this user get kicked after the last marked user leaves?</para><br>+                                        <enumlist><br>+                                             <enum name="Yes"/><br>+                                           <enum name="No"/><br>+                                    </enumlist><br>+                            </parameter><br>+                           <parameter name="Waiting"><br>+                                   <para>Is this user waiting for a marked user to join?</para><br>+                                     <enumlist><br>+                                             <enum name="Yes"/><br>+                                           <enum name="No"/><br>+                                    </enumlist><br>+                            </parameter><br>+                           <parameter name="Muted"><br>+                                     <para>The current mute status.</para><br>+                                    <enumlist><br>+                                             <enum name="Yes"/><br>+                                           <enum name="No"/><br>+                                    </enumlist><br>+                            </parameter><br>+                           <parameter name="AnsweredTime"><br>+                                      <para>The number of seconds the channel has been up.</para><br>+                              </parameter><br>+                           <channel_snapshot/><br>+                    </syntax><br>+              </managerEventInstance><br>+        </managerEvent><br>         <manager name="ConfbridgeListRooms" language="en_US"><br>               <synopsis><br>                      List active conferences.<br>@@ -3443,15 +3500,26 @@<br>     .read = func_confbridge_info,<br> };<br> <br>-static void action_confbridgelist_item(struct mansession *s, const char *id_text, struct confbridge_conference *conference, struct confbridge_user *user, int waiting)<br>+static int action_confbridgelist_item(struct mansession *s, const char *id_text, struct confbridge_conference *conference, struct confbridge_user *user, int waiting)<br> {<br>+   struct ast_channel_snapshot *snapshot;<br>+       struct ast_str *snap_str;<br>+<br>+ snapshot = ast_channel_snapshot_get_latest(ast_channel_uniqueid(user->chan));<br>+     if (!snapshot) {<br>+             return 0;<br>+    }<br>+<br>+ snap_str = ast_manager_build_channel_state_string(snapshot);<br>+ if (!snap_str) {<br>+             ao2_ref(snapshot, -1);<br>+               return 0;<br>+    }<br>+<br>  astman_append(s,<br>              "Event: ConfbridgeList\r\n"<br>                 "%s"<br>                "Conference: %s\r\n"<br>-               "CallerIDNum: %s\r\n"<br>-              "CallerIDName: %s\r\n"<br>-             "Channel: %s\r\n"<br>           "Admin: %s\r\n"<br>             "MarkedUser: %s\r\n"<br>                "WaitMarked: %s\r\n"<br>@@ -3459,19 +3527,23 @@<br>               "Waiting: %s\r\n"<br>           "Muted: %s\r\n"<br>             "AnsweredTime: %d\r\n"<br>+             "%s"<br>                "\r\n",<br>             id_text,<br>              conference->name,<br>-         S_COR(ast_channel_caller(user->chan)->id.number.valid, ast_channel_caller(user->chan)->id.number.str, "<unknown>"),<br>-              S_COR(ast_channel_caller(user->chan)->id.name.valid, ast_channel_caller(user->chan)->id.name.str, "<no name>"),<br>-          ast_channel_name(user->chan),<br>-             ast_test_flag(&user->u_profile, USER_OPT_ADMIN) ? "Yes" : "No",<br>-           ast_test_flag(&user->u_profile, USER_OPT_MARKEDUSER) ? "Yes" : "No",<br>-              ast_test_flag(&user->u_profile, USER_OPT_WAITMARKED) ? "Yes" : "No",<br>-              ast_test_flag(&user->u_profile, USER_OPT_ENDMARKED) ? "Yes" : "No",<br>-               waiting ? "Yes" : "No",<br>-          user->muted ? "Yes" : "No",<br>-           ast_channel_get_up_time(user->chan));<br>+             AST_YESNO(ast_test_flag(&user->u_profile, USER_OPT_ADMIN)),<br>+           AST_YESNO(ast_test_flag(&user->u_profile, USER_OPT_MARKEDUSER)),<br>+              AST_YESNO(ast_test_flag(&user->u_profile, USER_OPT_WAITMARKED)),<br>+              AST_YESNO(ast_test_flag(&user->u_profile, USER_OPT_ENDMARKED)),<br>+               AST_YESNO(waiting),<br>+          AST_YESNO(user->muted),<br>+           ast_channel_get_up_time(user->chan),<br>+              ast_str_buffer(snap_str));<br>+<br>+        ast_free(snap_str);<br>+  ao2_ref(snapshot, -1);<br>+<br>+    return 1;<br> }<br> <br> static int action_confbridgelist(struct mansession *s, const struct message *m)<br>@@ -3505,12 +3577,10 @@<br> <br>        ao2_lock(conference);<br>         AST_LIST_TRAVERSE(&conference->active_list, user, list) {<br>-             total++;<br>-             action_confbridgelist_item(s, id_text, conference, user, 0);<br>+         total += action_confbridgelist_item(s, id_text, conference, user, 0);<br>         }<br>     AST_LIST_TRAVERSE(&conference->waiting_list, user, list) {<br>-            total++;<br>-             action_confbridgelist_item(s, id_text, conference, user, 1);<br>+         total += action_confbridgelist_item(s, id_text, conference, user, 1);<br>         }<br>     ao2_unlock(conference);<br>       ao2_ref(conference, -1);<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8137">change 8137</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8137"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Iaf7d54a9d40194c2db060bc9b4979fab6720d977 </div>
<div style="display:none"> Gerrit-Change-Number: 8137 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>