<div>This is an example of scenario where i want to add diversion header if the user is busy, no answer, etc..</div><div>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</div><div>&lt;!DOCTYPE cpl SYSTEM &quot;/home/xxx/opensips-1.5.0-notls/modules/cpl-c/cpl-06.dtd&quot;&gt;</div>
<div>&lt;cpl&gt;</div><div>  &lt;subaction id=&quot;voicemail&quot; &gt;</div><div>    &lt;location url=&quot;tel:+336xxxxxxxxxx&quot; /&gt;</div><div>  &lt;/subaction&gt;</div><div>  &lt;incoming &gt;</div><div>  &lt;location url=&quot;tel:+336xxxxxxxxxxx&quot;&gt;</div>
<div>      &lt;proxy &gt;</div><div>        &lt;busy &gt;</div><div>          &lt;sub ref=&quot;voicemail&quot; /&gt;</div><div>        &lt;/busy&gt;</div><div>        &lt;noanswer &gt;</div><div>          &lt;sub ref=&quot;voicemail&quot; /&gt;</div>
<div>        &lt;/noanswer&gt;</div><div>        &lt;redirection &gt;</div><div>          &lt;sub ref=&quot;voicemail&quot; /&gt;</div><div>        &lt;/redirection&gt;</div><div>        &lt;failure &gt;</div><div>          &lt;sub ref=&quot;voicemail&quot; /&gt;</div>
<div>        &lt;/failure&gt;</div><div>        &lt;default &gt;</div><div>          &lt;sub ref=&quot;voicemail&quot; /&gt;</div><div>        &lt;/default&gt;</div><div>      &lt;/proxy&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>  &lt;/location&gt;</div>
<div> &lt;/incoming&gt;</div><div>&lt;/cpl&gt;</div><div><br></div><div>I would like to add diversion header if there is theses differents code </div><table class="MsoNormalTable" border="1" cellspacing="0" cellpadding="0" style="margin-left:.4pt;border-collapse:collapse;mso-table-layout-alt:fixed;
 border:none;mso-border-alt:solid windowtext 1.0pt;mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
 mso-border-insideh:.75pt solid windowtext;mso-border-insidev:.75pt solid windowtext">
 <tbody><tr style="mso-yfti-irow:0;mso-yfti-firstrow:yes">
  <td width="223" valign="top" style="width:167.0pt;border:solid windowtext 1.0pt;
  mso-border-alt:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext .75pt;
  padding:0cm 5.4pt 0cm 5.4pt">
  <p class="TableText"><span lang="EN-US">301</span></p>
  </td>
 </tr>
 <tr style="mso-yfti-irow:1">
  <td width="223" valign="top" style="width:167.0pt;border:solid windowtext 1.0pt;
  border-top:none;mso-border-top-alt:solid windowtext .75pt;mso-border-top-alt:
  .75pt;mso-border-left-alt:1.0pt;mso-border-bottom-alt:.75pt;mso-border-right-alt:
  1.0pt;mso-border-color-alt:windowtext;mso-border-style-alt:solid;padding:
  0cm 5.4pt 0cm 5.4pt">
  <p class="TableText"><span lang="EN-US">302</span></p>
  </td>
 </tr>
 <tr style="mso-yfti-irow:2">
  <td width="223" valign="top" style="width:167.0pt;border:solid windowtext 1.0pt;
  border-top:none;mso-border-top-alt:solid windowtext .75pt;mso-border-top-alt:
  .75pt;mso-border-left-alt:1.0pt;mso-border-bottom-alt:.75pt;mso-border-right-alt:
  1.0pt;mso-border-color-alt:windowtext;mso-border-style-alt:solid;padding:
  0cm 5.4pt 0cm 5.4pt">
  <p class="TableText"><span lang="EN-US">408</span></p>
  </td>
 </tr>
 <tr style="mso-yfti-irow:3">
  <td width="223" valign="top" style="width:167.0pt;border:solid windowtext 1.0pt;
  border-top:none;mso-border-top-alt:solid windowtext .75pt;mso-border-top-alt:
  .75pt;mso-border-left-alt:1.0pt;mso-border-bottom-alt:.75pt;mso-border-right-alt:
  1.0pt;mso-border-color-alt:windowtext;mso-border-style-alt:solid;padding:
  0cm 5.4pt 0cm 5.4pt">
  <p class="TableText"><span lang="EN-US">480</span></p>
  </td>
 </tr>
 <tr style="mso-yfti-irow:4">
  <td width="223" valign="top" style="width:167.0pt;border:solid windowtext 1.0pt;
  border-top:none;mso-border-top-alt:solid windowtext .75pt;mso-border-top-alt:
  .75pt;mso-border-left-alt:1.0pt;mso-border-bottom-alt:.75pt;mso-border-right-alt:
  1.0pt;mso-border-color-alt:windowtext;mso-border-style-alt:solid;padding:
  0cm 5.4pt 0cm 5.4pt">
  <p class="TableText"><span lang="EN-US">486</span></p>
  </td>
 </tr>
 <tr style="mso-yfti-irow:5">
  <td width="223" valign="top" style="width:167.0pt;border:solid windowtext 1.0pt;
  border-top:none;mso-border-top-alt:solid windowtext .75pt;mso-border-top-alt:
  .75pt;mso-border-left-alt:1.0pt;mso-border-bottom-alt:.75pt;mso-border-right-alt:
  1.0pt;mso-border-color-alt:windowtext;mso-border-style-alt:solid;padding:
  0cm 5.4pt 0cm 5.4pt">
  <p class="TableText"><span lang="EN-US">487</span></p>
  </td>
 </tr>
 <tr style="mso-yfti-irow:6">
  <td width="223" valign="top" style="width:167.0pt;border:solid windowtext 1.0pt;
  border-top:none;mso-border-top-alt:solid windowtext .75pt;mso-border-top-alt:
  .75pt;mso-border-left-alt:1.0pt;mso-border-bottom-alt:.75pt;mso-border-right-alt:
  1.0pt;mso-border-color-alt:windowtext;mso-border-style-alt:solid;padding:
  0cm 5.4pt 0cm 5.4pt">
  <p class="TableText"><span lang="EN-US">600</span></p>
  </td>
 </tr>
 <tr style="mso-yfti-irow:7;mso-yfti-lastrow:yes">
  <td width="223" valign="top" style="width:167.0pt;border:solid windowtext 1.0pt;
  border-top:none;mso-border-top-alt:solid windowtext .75pt;padding:0cm 5.4pt 0cm 5.4pt">
  <p class="TableText"><span lang="EN-US">603</span></p>
  </td>
 </tr></tbody></table><br><div>The probleme is t if i had a treatment in failure route </div><div><div><br></div><div>if (t_check_status(&quot;408&quot;)) {</div><div>                xlog(&quot;------------------------------- Erreur 408 -------------------------------&quot;);</div>
<div>                $ru=&quot;tel:+336xxxxxxxxxxx&quot;;</div><div>                add_diversion(&quot;no-answer&quot;);</div><div>                # do not set the missed call flag again</div><div>                t_relay();</div>
<div>        }</div></div><div>the Server sends the message two times (in the cpl file and in the config file) and i found one message with the great header and one without</div><div><br></div><div><br></div><div>Regards,</div>
<div><br></div><div><br></div><div>Mehdi BOUDOU</div>