Are you working off of the default.xml dialplan file? If so, it has an example condition already:<div><br></div><div><div><font class="Apple-style-span" face="'courier new', monospace"> <condition field="${sip_has_crypto}" expression="^(AES_CM_128_HMAC_SHA1_32|AES_CM_128_HMAC_SHA1_80)$" break="never"></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span><action application="set" data="sip_secure_media=true"/></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span><!-- Offer SRTP on outbound legs if we have it on inbound. --></font></div><div>
<font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span><!-- <action application="export" data="sip_secure_media=true"/> --></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> </condition></font></div><div><br></div><div>What exactly are you checking on in your scenario? Most likely there is an elegant way to do it. Give us the plain language description of the problem you're addressing and the community will no doubt have good suggestions for you.</div>
<div><br></div><div>-MC</div><br><div class="gmail_quote">On Thu, Jun 16, 2011 at 10:22 AM, Rob Hutton <span dir="ltr"><<a href="mailto:justlikeef@gmail.com">justlikeef@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Steven -<br>
<br>
Thanks for the help here...<br>
<br>
So there would have to be two dialplan entries for this number to work with<br>
either RTP or SRTP? (Maybe two devices registering to the same user?)<br>
<br>
Would it make more since to do this in a more global manner higher up in the<br>
dialplan in its own condition block?<br>
<div><div></div><div class="h5"><br>
<br>
On Thursday 16 June 2011 03:15:33 Steven Ayre wrote:<br>
> {ERR} mod_dialplan_xml.c:110 Nexted conditions are not allowed<br>
><br>
> That's because it shouldn't be nested. It's not missing a /, and the 1st<br>
> Should have the /. The extra indendation shouldn't be there on the 2nd.<br>
><br>
> It should look like this:<br>
><br>
> <extension name="incoming-fxs"><br>
> <condition field="destination_number" expression="^(202)$"/><br>
> <condition field="${sip_has_crypto}"<br>
> expression="^(AES_CM_128_HMAC_SHA1_32|AES_CM_128_HMAC_SHA1_80)$"<br>
> break="never"><br>
> <action application="set" data="sip_secure_media=true"/><br>
> <action application="bridge" data="openzap/1/1"/><br>
> </condition><br>
> </extension><br>
><br>
> The two conditions function as an AND, even though it's not nested. FS<br>
> stops checking the extension as soon as it sees a condition that's false<br>
> (at least by default and in the above case), so if the destination is not<br>
> 202 it'll never get to the 2nd condition.<br>
><br>
> -Steve<br>
><br>
> On 16 June 2011 03:10, Rob Hutton <<a href="mailto:justlikeef@gmail.com">justlikeef@gmail.com</a>> wrote:<br>
> > I think I have TLS and SRTP working at this point, but in the docs it<br>
> > says to use the following template for the dialplan:<br>
> ><br>
> > <a href="http://wiki.freeswitch.org/wiki/Secure_RTP" target="_blank">http://wiki.freeswitch.org/wiki/Secure_RTP</a>:<br>
> > <extension name="incoming-fxs"><br>
> ><br>
> > <condition field="destination_number" expression="^(202)$"/><br>
> ><br>
> > <condition field="${sip_has_crypto}"<br>
> ><br>
> > expression="^(AES_CM_128_HMAC_SHA1_32|AES_CM_128_HMAC_SHA1_80)$"<br>
> > break="never"><br>
> ><br>
> > <action application="set" data="sip_secure_media=true"/><br>
> > <action application="bridge" data="openzap/1/1"/><br>
> ><br>
> > </condition><br>
> ><br>
> > </extension<br>
> ><br>
> > 1) There is a missing > at the end of the close extension tag.<br>
> > 2) There is either a missing / at the end of the internal condition line,<br>
> > or a missing condition close tag somewhere<br>
> > 3) When I fix the interal condition, I get an error:<br>
> ><br>
> > {ERR} mod_dialplan_xml.c:110 Nexted conditions are not allowed<br>
> ><br>
> > All this, but a packet capture shows that SRTP is working based on what I<br>
> > did on:<br>
> ><br>
> > <a href="http://wiki.freeswitch.org/wiki/SIP_TLS" target="_blank">http://wiki.freeswitch.org/wiki/SIP_TLS</a><br>
> ><br>
> > Can someone give me some guidance on the Secure_RTP page and I will<br>
> > update whatever?<br>
> ><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>
_______________________________________________<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>
</div></div></blockquote></div><br></div>