title: how to choose and dial a random sip peer which is available in asterisk
body: <p>Hi i am new to asterisk and i like to dial to a random &amp; available sip peer. And here i tried some technique like choosing from a list of users with ChanIsAvail(SIP/user1&amp;SIP/user2&amp;SIP/user3,j). And i would like to choose the random users peer which is avail. </p>
  
  <pre><code>  exten =&gt; _XXXXXXX,1,ChanIsAvail(SIP/user1&amp;SIP/user2&amp;SIP/user3,j)
    exten =&gt; _XXXXXXX,n,Dial(${AVAILORIGCHAN})
  </code></pre>
  
  <p>and the sip users like </p>
  
  <pre><code>  [user1]
    type=peer
    username=user1
    secret=user1XX
    host=dynamic
    context=from-pstn
  
    [user2]
    type=peer
    username=user2
    secret=user2XX
    host=dynamic
    context=from-pstn
  
    [user3]
    type=peer
    username=user3
    secret=user3XX
    host=dynamic
    context=from-pstn
  
    .
    .
    .
  </code></pre>
  
  <p>how do i choose available(NOT BUSY) users from these..?</p>