<div><div><div>On Thu, Nov 18, 2010 at 11:20 AM, Arnaldo Giacomitti Junior <span dir="ltr">&lt;<a href="mailto:arnaldo.junior@cits.br">arnaldo.junior@cits.br</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div lang="PT-BR" link="blue" vlink="purple"><div><p class="MsoNormal"><span lang="EN-US">There is a way to change the disconnect cause of a call in dialplan? </span></p><p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">/* Disconnect causes */</span></p><p class="MsoNormal"><span lang="EN-US">typedef enum {</span></p><p class="MsoNormal"><span lang="EN-US">        OR2_CAUSE_BUSY_NUMBER,</span></p><p class="MsoNormal">
<span lang="EN-US">        OR2_CAUSE_NETWORK_CONGESTION,</span></p><p class="MsoNormal"><span lang="EN-US">        OR2_CAUSE_UNALLOCATED_NUMBER,</span></p><p class="MsoNormal"><span lang="EN-US">        OR2_CAUSE_OUT_OF_ORDER,</span></p>
<p class="MsoNormal"><span lang="EN-US">        OR2_CAUSE_UNSPECIFIED,</span></p><p class="MsoNormal"><span lang="EN-US">        OR2_CAUSE_NO_ANSWER,</span></p><p class="MsoNormal"><span lang="EN-US">        OR2_CAUSE_NORMAL_CLEARING,</span></p>
<p class="MsoNormal"><span lang="EN-US">        OR2_CAUSE_COLLECT_CALL_REJECTED,</span></p><p class="MsoNormal"><span lang="EN-US">        OR2_CAUSE_FORCED_RELEASE,</span></p><p class="MsoNormal"><span lang="EN-US">        OR2_CAUSE_NUMBER_CHANGED</span></p>
<p class="MsoNormal"><span lang="EN-US">} openr2_call_disconnect_cause_t;</span></p><p class="MsoNormal"><span lang="EN-US"></span></p></div></div></blockquote><div><br></div><div><meta charset="utf-8">By default the cause provided by Asterisk will be mapped to a valid R2 cause. If you want to override that behaviour you need to set MFCR2_CAUSE variable in the dialplan. It is undocumented however the values for that variable. The value must be an integer according to Asterisk causes (see include/asterisk/causes.h):<div>
<br></div><div>For example:</div><div>MFCR2_CAUSE=17 is user busy</div><div><br></div><div>AST_CAUSE_USER_BUSY (integer value 17)</div><div><div><br></div><div>This work in latest Asterisk 1.6.2, not sure if I added that to previous versions.<br clear="all">
<br></div><div>However the mapping will ultimately decide which openr2 cause will be used. If you want to granularly control exactly which openr2 cause to use, we need a new variable MFCR2_EXPLICIT_CAUSE=&lt;openr2 cause string&gt;</div>
<div><br><div>Moises Silva<br>Senior Software Engineer<br>Sangoma Technologies Inc. | 100 Renfrew Drive, Suite 100, Markham ON L3R 9R6 Canada<br>t. 1 905 474 1990 x128 | e. <a href="mailto:moy@sangoma.com" target="_blank">moy@sangoma.com</a></div>
</div></div></div></div></div></div></div>