I did read your emails, and I thought the Lua script idea was nice. The ESL was more complicated, but also good. But, you didn't accept either. So, I was wondering, is this "bind_long_DTMF" something that allows you to capture DTMF during the full length of the call, i.e. even after bridge? Is that what you wished to accomplish?<div>
<br></div><div>Regards</div><div>HASSAN</div><div><br></div><div><br><br><div class="gmail_quote">On Fri, Aug 27, 2010 at 15:03, Tihomir Culjaga <span dir="ltr"><<a href="mailto:tculjaga@gmail.com">tculjaga@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">as usual we are alone here ...<br>I just lost my patience and did it directly in code!<br><br><br>Once rewriting according to FS requirements done , will provide a patch if anyone interested.<br>
<br><br><br>-----------------<-snip->-----------------------<br>
/*it's hardcoded but who cares at that point :))*/<br> if (dtmf->digit == '#') {<br> int ok = 0;<br> *digit = dtmf->digit;<br> dval = atoi(digit);<br>
dval=0; /* temporary fake the bind key */<br> if (direction == SWITCH_DTMF_RECV && (md->sr[direction].map[dval].bind_flags & SBF_DIAL_ALEG)) {<br> ok = 1;<br>
} else if (direction == SWITCH_DTMF_SEND && (md->sr[direction].map[dval].bind_flags & SBF_DIAL_BLEG)) {<br> ok = 1;<br> }<br><br> if (ok && md->sr[direction].map[dval].app) {<br>
uint32_t flags = md->sr[direction].map[dval].flags;<br><br> if ((md->sr[direction].map[dval].bind_flags & <br> SBF_EXEC_OPPOSITE)) { if (direction == <br>
SWITCH_DTMF_SEND) { flags |= SMF_ECHO_ALEG; } <br> else { flags |= SMF_ECHO_BLEG; } } else if ((md-<br> >sr[direction].map[dval].bind_flags & <br>
SBF_EXEC_SAME)) { if (direction == <br> SWITCH_DTMF_SEND) { flags |= SMF_ECHO_BLEG; } <br> else { flags |= SMF_ECHO_ALEG; } } else if ((md-<br>
>sr[direction].map[dval].bind_flags & <br> SBF_EXEC_ALEG)) { flags |= SMF_ECHO_ALEG; } else <br> if ((md->sr[direction].map[dval].bind_flags & <br>
SBF_EXEC_BLEG)) { flags |= SMF_ECHO_BLEG; } else <br> { flags |= SMF_ECHO_ALEG; }<br><br> if ((md->sr[direction].map[dval].bind_flags & SBF_EXEC_INLINE)) {<br>
flags |= SMF_EXEC_INLINE;<br> }<br><br> switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Processing meta digit '%c' [%s]\n",<br>
switch_channel_get_name(channel), dtmf->digit, md->sr[direction].map[dval].app);<br><br> if (switch_channel_test_flag(channel, CF_PROXY_MODE)) {<br>
broadcast_in_thread(session, md->sr[direction].map[dval].app, flags | SMF_REBRIDGE);<br> } else {<br> switch_ivr_broadcast(switch_core_session_get_uuid(session), md->sr[direction].map[dval].app, flags);<br>
}<br> if ((md->sr[direction].map[dval].bind_flags & SBF_ONCE)) {<br> memset(&md->sr[direction].map[dval], 0, sizeof(md->sr[direction].map[dval]));<br>
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Unbinding meta digit '%c'\n",<br> switch_channel_get_name(channel), dtmf->digit);<br>
}<br> } else {<br> switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s Ignoring meta digit '%c' not mapped\n",<br>
switch_channel_get_name(channel), dtmf->digit);<br> }<br> <br> <br>/* return SWITCH_STATUS_SUCCESS; */<br>
return SWITCH_STATUS_FALSE;<br><br> }<br> <br><br><br>-----------------<-snip->-----------------------<br><br><br><br>usage in DP:<br><br><action application="bind_long_dtmf" data="0 a s transfer::myExtension XML myContext"/><br>
<br><br><br>in myExtension you do your stuff!<div><div></div><div class="h5"><br><br><br><br><br><br><br><br><br><br><div class="gmail_quote">On Wed, Aug 25, 2010 at 10:14 PM, Tihomir Culjaga <span dir="ltr"><<a href="mailto:tculjaga@gmail.com" target="_blank">tculjaga@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><div><br><br><div class="gmail_quote">On Wed, Aug 25, 2010 at 7:47 PM, Nigel Kent <span dir="ltr"><<a href="mailto:ktngl@yahoo.co.uk" target="_blank">ktngl@yahoo.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font:inherit" valign="top">Have you tried using the event socket library <a href="http://wiki.freeswitch.org/wiki/Esl" target="_blank">http://wiki.freeswitch.org/wiki/Esl</a> <br>
<br></td></tr></tbody></table></blockquote></div><br></div>well, i could have used esl from the start but thats and external application controling FS... and its totally a different approach from where im now:(.<br>I have everything up & running except this feature ..<br>
<br>so is there any chance to run a lua script in background (by allowing the normal callflow to go on) to collect a special DTMF event ?<br><br>something like this:<div><br><action application="set" data="api_result=${lua(script.lua)}"/><br>
<br></div>?<br><font color="#888888"><br>T.<br><div><br><br></div><br>
</font></blockquote></div><br>
</div></div><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>