<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=Windows-1252">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>using ChanIsAvail</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Hi</FONT>
</P>

<P><FONT SIZE=2>I am trying to use ChanIsAvail to decide if a particular extension is available in the sip channel</FONT>
</P>

<P><FONT SIZE=2>I am using MySQL to hold my SIP friends.</FONT>

<BR><FONT SIZE=2>and wy cvs version shows Asterisk CVS-08/02/04</FONT>
</P>

<P><FONT SIZE=2>my intention is, that if the extension is not available in Sip channel, I will send the call somewhere else</FONT>
</P>

<P><FONT SIZE=2>my extensions file contains the following:</FONT>
</P>

<P><FONT SIZE=2>exten =&gt; _[123]XX,1,ChanIsAvail(sip/${EXTEN})</FONT>

<BR><FONT SIZE=2>exten =&gt; _[123]XX,2,dial(sip/${EXTEN},30)</FONT>

<BR><FONT SIZE=2>exten =&gt; _[123]XX,102,Dial(IAX2/sip01-xxxxxx:xxxxxxx@xxxxxxxxxxxx/${EXTEN})</FONT>
</P>
<BR>

<P><FONT SIZE=2>if I understand ChanIsAvail correctly this should give med following:</FONT>
</P>

<P><FONT SIZE=2>if i dial extension 111, and that is a local extension, it dials the sip channel</FONT>

<BR><FONT SIZE=2>on the other hand, if extension 111 is not avaliable in the local sip channel, it dials on IAX2</FONT>
</P>

<P><FONT SIZE=2>But it does not work, if 111 is not a local extension the dial in priority 2 returns with -1, in my opinion it should never have been executed</FONT></P>
<BR>

<P><FONT SIZE=2>when I have all SIP frinds in sip.conf it works, but it does not when using MySQL</FONT>
</P>

<P><FONT SIZE=2>is this a bug, or is ChanIsAvail not intended to work when SIP frinds are in MySQL ??</FONT>
</P>

<P><FONT SIZE=2>Kind regards</FONT>
</P>

<P><FONT SIZE=2>Poul Pedersen</FONT>
</P>

</BODY>
</HTML>