I guess regex on the result of sofia_gateway_data and then testing the result is not empty would do it.<br><br><a href="http://wiki.freeswitch.org/wiki/Mod_commands#regex">http://wiki.freeswitch.org/wiki/Mod_commands#regex</a><br>

<br>-Steve<br><br><br><div class="gmail_quote">On 4 February 2011 09:02, David Ponzone <span dir="ltr">&lt;<a href="mailto:david.ponzone@ipeva.fr">david.ponzone@ipeva.fr</a>&gt;</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 style="word-wrap: break-word;">Thanks Steven, that&#39;s actually a different approach, and quite straight-forward. I will use that.<div>I was actually not aware I could include API commands in ${}.</div><div><br></div>

<div>Nevertheless, so I can update the wiki, anyone knows how to use sofia_gateway_data ?</div><div><div class="im"><br><div>
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div style="word-wrap: break-word;">

<div><font face="&#39;Helvetica Neue&#39;"><font color="#1c00ff">David Ponzone  </font><font color="#000000" size="3"><span style="font-size: 12px;">Direction Technique</span></font></font></div><div><font face="&#39;Helvetica Neue&#39;"><font size="3"><span style="font-size: 13px;">email: <a href="mailto:david.ponzone@ipeva.fr" target="_blank">david.ponzone@ipeva.fr</a></span></font></font></div>

<div><font face="&#39;Helvetica Neue&#39;"><font size="3"><span style="font-size: 13px;">tel:      01 74 03 18 97</span></font></font></div><div><font face="&#39;Helvetica Neue&#39;"><font size="3"><span style="font-size: 13px;">gsm:   06 66 98 76 34</span></font></font></div>

<div><font face="&#39;Helvetica Neue&#39;"><br></font></div><div><font color="#1c00ff" face="&#39;Helvetica Neue&#39;">Service Client<span> </span></font><font face="&#39;Helvetica Neue&#39;"><font color="#ff0000">IP</font></font><font color="#1c00ff" face="&#39;Helvetica Neue&#39;">eva</font></div>

<div><font color="#1c00ff" face="&#39;Helvetica Neue&#39;"><span style="color: rgb(0, 0, 0); font-family: Helvetica;"><div><font face="&#39;Helvetica Neue&#39;"><font size="3"><span style="font-size: 13px;">tel:      0811 46 26 26</span></font></font></div>

<div><font face="&#39;Helvetica Neue&#39;" size="3"><span style="font-size: 13px;"><div style="margin: 0px; color: rgb(0, 34, 243);"><span style="text-decoration: underline;"><a>www.ipeva.fr</a></span><span style="color: rgb(101, 104, 149);">  -   <span style="color: rgb(0, 34, 243); text-decoration: underline;"><a>www.ipeva-studio.com</a></span></span></div>

<div style="margin: 0px; color: rgb(0, 34, 243);"><span style="text-decoration: underline;"><br></span></div><div style="margin: 0px; color: rgb(0, 34, 243);"><span><div style="margin: 0px; text-align: justify; color: rgb(192, 192, 192);">

<i>Ce message et toutes les pièces jointes sont confidentiels et établis à l&#39;intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d&#39;altération. </i><b><i>IPeva</i></b><i> décline toute responsabilité au titre de ce message s&#39;il a été altéré, déformé ou falsifié. Si vous n&#39;êtes pas destinataire de ce message, merci de le détruire immédiatement et d&#39;avertir l&#39;expéditeur.</i></div>

<div style="text-decoration: underline; text-align: justify;"><font color="#c0c0c0"><i><br></i></font></div></span></div></span></font></div></span></font></div></div></span><br></span><br>
</div>
<br></div><div><div>Le 04/02/2011 à 09:45, Steven Ayre a écrit :</div><div><div></div><div class="h5"><br><blockquote type="cite">API commands:<br>sofia profile &lt;name&gt; gwlist up<br>sofia profile &lt;name&gt; gwlist down<br>

<br>List the up/down gateways (names separated by space). You can do a regex on that result from dialplan. For example this will only execute if the gateway is up:<br>

&lt;extension&gt;<br>  &lt;condition field=&quot;${sofia profile gwlist up}&quot; expression=&quot;\bgw001\b&quot;&gt;<br>    &lt;action application=&quot;bridge&quot; data=&quot;sofia/gateway/gw001/${destination_number}&quot;/&gt;<br>



  &lt;condition&gt;<br>&lt;extension&gt;<br><br>\b matches word boundary, so will match both the start of word (both at start of string and after space) and the end of the word (at the end of a string or before a space).<br>



<br>-Steve<br><br><br><div class="gmail_quote">On 4 February 2011 08:05, David Ponzone <span dir="ltr">&lt;<a href="mailto:david.ponzone@ipeva.fr" target="_blank">david.ponzone@ipeva.fr</a>&gt;</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 style="word-wrap: break-word;"><div>All,</div><div><br></div>I am still trying to reroute a call in case a gateway is down, but I decided to do that another way.<div>I&#39;d like to detect my gateway is down, and I was trying to use sofia_gateway_data function for that purpose.</div>



<div>But I can&#39;t figure out the expected args.</div><div><br></div><div>I try:</div><div>sofia_gateway_data &lt;gatewayname&gt; var Status</div><div><div>or ivar/ovar instead of var</div><div><br></div><div>I tried with both a gateway I register to, and an IP-auth-based gateway I ping regularly.</div>



<div><br></div><div>So I am stuck now, and I can&#39;t find any info anywhere on how to detect a gateway is flagged as DOWN.</div><div><br></div><div>TIA</div><div><br></div><div>
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div style="word-wrap: break-word;">



<div><font face="&#39;Helvetica Neue&#39;"><font color="#1c00ff">David Ponzone  </font><font color="#000000" size="3"><span style="font-size: 12px;">Direction Technique</span></font></font></div><div><font face="&#39;Helvetica Neue&#39;"><font size="3"><span style="font-size: 13px;">email: <a href="mailto:david.ponzone@ipeva.fr" target="_blank">david.ponzone@ipeva.fr</a></span></font></font></div>



<div><font face="&#39;Helvetica Neue&#39;"><font size="3"><span style="font-size: 13px;">tel:      01 74 03 18 97</span></font></font></div><div><font face="&#39;Helvetica Neue&#39;"><font size="3"><span style="font-size: 13px;">gsm:   06 66 98 76 34</span></font></font></div>



<div><font face="&#39;Helvetica Neue&#39;"><br></font></div><div><font color="#1c00ff" face="&#39;Helvetica Neue&#39;">Service Client<span> </span></font><font face="&#39;Helvetica Neue&#39;"><font color="#ff0000">IP</font></font><font color="#1c00ff" face="&#39;Helvetica Neue&#39;">eva</font></div>



<div><font color="#1c00ff" face="&#39;Helvetica Neue&#39;"><span style="color: rgb(0, 0, 0); font-family: Helvetica;"><div><font face="&#39;Helvetica Neue&#39;"><font size="3"><span style="font-size: 13px;">tel:      0811 46 26 26</span></font></font></div>



<div><font face="&#39;Helvetica Neue&#39;" size="3"><span style="font-size: 13px;"><div style="margin: 0px; color: rgb(0, 34, 243);"><span style="text-decoration: underline;"><a>www.ipeva.fr</a></span><span style="color: rgb(101, 104, 149);">  -   <span style="color: rgb(0, 34, 243); text-decoration: underline;"><a>www.ipeva-studio.com</a></span></span></div>



<div style="margin: 0px; color: rgb(0, 34, 243);"><span style="text-decoration: underline;"><br></span></div><div style="margin: 0px; color: rgb(0, 34, 243);"><span><div style="margin: 0px; text-align: justify; color: rgb(192, 192, 192);">



<i>Ce message et toutes les pièces jointes sont confidentiels et établis à l&#39;intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d&#39;altération. </i><b><i>IPeva</i></b><i> décline toute responsabilité au titre de ce message s&#39;il a été altéré, déformé ou falsifié. Si vous n&#39;êtes pas destinataire de ce message, merci de le détruire immédiatement et d&#39;avertir l&#39;expéditeur.</i></div>



<div style="text-decoration: underline; text-align: justify;"><font color="#c0c0c0"><i><br></i></font></div></span></div></span></font></div></span></font></div></div></span><br></span><br>
</div>
<br></div></div><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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>
_______________________________________________<br>FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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>

</blockquote></div></div></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>