A missing header will be treated as an empty string<div><br></div><div>The expression=&quot;.&quot; regex will work better. That will match any character, therefore any nonempty string. Simpler than yours, faster (it only needs to check the first character not the entire string) and will match many yours will not (anything with non-alphanumerics, such as whitespace)<br>
<div><br></div><br><br>On Wednesday, September 18, 2013, Grant Bagdasarian  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple">
<div><p class="MsoNormal">Hello,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">In the dialplan, how would I check if a header is present?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Should I just check if it has a value like below?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">        &lt;condition field=&quot;${sip_h_X-MyHeader }&quot; expression=&quot;^[a-zA-Z0-9]+$ &quot; break=&quot;never&quot;&gt;<u></u><u></u></p>
<p class="MsoNormal">          <u></u><u></u></p><p class="MsoNormal">        &lt;/condition&gt;<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Regards,<u></u><u></u></p><p class="MsoNormal">
<u></u> <u></u></p><p class="MsoNormal">Grant<u></u><u></u></p></div></div></blockquote></div>