title: Asterisk how check if a number is busy before dialing it
body: <p>As a beginner that just installed his first asterix server I came across a small issue. i want to check if a number that i dial is busy or not before actually dialing it.</p>
  
  <p>So for example I would call 0904 => number busy => redirect to 0905</p>
  
  <p>However I don't want it to dial 0904 first if its busy but just instantly redirect it to 0905 instead. </p>
  
  <p>I have a very basic setup with just 3 users. 2 of them are in a queue "support" one of them is in the queue "admin"</p>
  
  <p>I have seen and read a little about checking if a channel is available but i didn't fully understand that and I'm not sure if it could be done easier.</p>
  
  <p>Here is my simple dialplan, if i call *12 my simple python script will just execute the Dial command to the 0904.</p>
  
  <pre><code>exten =&gt; *12,1,Answer()
  same =&gt; n,set(PHONE_EXTEN=0904)
  same =&gt; n,AGI(test-agi.py,${PHONE_EXTEN})
  same =&gt; n,Hangup()
  </code></pre>