<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16008">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_dtmf_info: Hook flash<br><br>Adds hook flash recognition support<br>for application/hook-flash.<br><br>ASTERISK-29460<br><br>Change-Id: I1d060fa89a7cf41244c98f892fff44eb1c9738ea<br>---<br>A doc/CHANGES-staging/res_pjsip_dtmf.txt<br>M res/res_pjsip_dtmf_info.c<br>2 files changed, 11 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/08/16008/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/doc/CHANGES-staging/res_pjsip_dtmf.txt b/doc/CHANGES-staging/res_pjsip_dtmf.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..4dc2088</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/res_pjsip_dtmf.txt</span><br><span>@@ -0,0 +1,5 @@</span><br><span style="color: hsl(120, 100%, 40%);">+res_pjsip_dtmf_info: Hook flash</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+Adds recognition for application/</span><br><span style="color: hsl(120, 100%, 40%);">+hook-flash as a hook flash event.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/res/res_pjsip_dtmf_info.c b/res/res_pjsip_dtmf_info.c</span><br><span>index 3d1223d..bd85288 100644</span><br><span>--- a/res/res_pjsip_dtmf_info.c</span><br><span>+++ b/res/res_pjsip_dtmf_info.c</span><br><span>@@ -87,7 +87,7 @@</span><br><span>        char *line;</span><br><span>  char event = '\0';</span><br><span>   unsigned int duration = 100;</span><br><span style="color: hsl(0, 100%, 40%);">-    char is_dtmf;</span><br><span style="color: hsl(120, 100%, 40%);">+ char is_dtmf, is_dtmf_relay, is_flash;</span><br><span>       int res;</span><br><span> </span><br><span>         if (!session->channel) {</span><br><span>@@ -95,8 +95,10 @@</span><br><span>     }</span><br><span> </span><br><span>        is_dtmf = is_media_type(rdata, "dtmf");</span><br><span style="color: hsl(120, 100%, 40%);">+     is_dtmf_relay = is_media_type(rdata, "dtmf");</span><br><span style="color: hsl(120, 100%, 40%);">+       is_flash = is_media_type(rdata, "hook-flash");</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    if (!is_dtmf && !is_media_type(rdata, "dtmf-relay")) {</span><br><span style="color: hsl(120, 100%, 40%);">+      if (!is_flash && !is_dtmf && !is_dtmf_relay) {</span><br><span>               return 0;</span><br><span>    }</span><br><span> </span><br><span>@@ -116,7 +118,7 @@</span><br><span>  if (is_dtmf) {</span><br><span>               /* directly use what is in the message body */</span><br><span>               event = get_event(cur);</span><br><span style="color: hsl(0, 100%, 40%);">- } else { /* content type = application/dtmf-relay */</span><br><span style="color: hsl(120, 100%, 40%);">+  } else if (is_dtmf_relay) { /* content type = application/dtmf-relay */</span><br><span>              while ((line = strsep(&cur, "\r\n"))) {</span><br><span>                        char *c;</span><br><span> </span><br><span>@@ -137,7 +139,7 @@</span><br><span>           }</span><br><span>    }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   if (event == '!') {</span><br><span style="color: hsl(120, 100%, 40%);">+   if (event == '!' || is_flash) {</span><br><span>              struct ast_frame f = { AST_FRAME_CONTROL, { AST_CONTROL_FLASH, } };</span><br><span>          ast_queue_frame(session->channel, &f);</span><br><span>        } else if (event != '\0') {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16008">change 16008</a>. To unsubscribe, or for help writing mail filters, 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/c/asterisk/+/16008"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I1d060fa89a7cf41244c98f892fff44eb1c9738ea </div>
<div style="display:none"> Gerrit-Change-Number: 16008 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>