Summary:ASTERISK-08797: ChanIsAvail returns positive ${AVAILORIGCHAN} if checking non existent IAX peer
Reporter:pj (pj)Labels:
Date Opened:2007-02-13 14:32:01.000-0600Date Closed:2007-02-16 09:31:39.000-0600
Versions:Frequency of
Description:when checking existency of channel before dial() with ChanIsAvail(IAX/233) it return IAX/233 in ${AVAILORIGCHAN} variable, but this peer does not exist in my config!
look at the console debug, weird is also  "Hungup 'IAX2/", it looks like IP address.
as workaround ChanIsAvail is working as expected if configured with "s" option, i.e: ChanIsAvail(IAX/233|s)


   -- Executing [233@from-bill:2] ChanIsAvail("IAX2/bill-gw-29", "SIP/233&IAX2/233") in new stack
[Feb 13 21:19:58] WARNING[13340]: chan_sip.c:2866 create_addr: No such host: 233
   -- Hungup 'IAX2/'
   -- Executing [233@from-bill:3] NoOp("IAX2/bill-gw-29", "status ... IAX2/ ... IAX2/233 ... 0") in new stack
   -- Executing [233@from-bill:4] GotoIf("IAX2/bill-gw-29", "0?5:7") in new stack
   -- Goto (from-bill,233,7)
   -- Executing [233@from-bill:7] Dial("IAX2/bill-gw-29", "IAX2/233") in new stack
   -- Called 233
Comments:By: pj (pj) 2007-02-13 14:34:16.000-0600

relevant dialplan example:

context from-bill {
 _ZXX => {
       NoOP(status ... ${AVAILCHAN} ... ${AVAILORIGCHAN} ... ${AVAILSTATUS});
       if (${ISNULL(${AVAILORIGCHAN})})
       else {

By: Joshua C. Colp (jcolp) 2007-02-15 19:36:20.000-0600

Fixed in trunk as of revision 54749.

By: pj (pj) 2007-02-16 04:10:57.000-0600

I'm confirming, that original issue was fixed, thanks
another small thing is, that ChanIsAvail() shoud not generate any warning about non existent peers.
In attached log, I'm checking SIP/777&IAX2/777 (none of this exist, that is correctly recognized), but warning is generated for SIP/777, I think it shoud be avoided.

   -- Executing [777@from-bill:2] ChanIsAvail("IAX2/bill-gw-33", "SIP/777&IAX2/777") in new stack
[Feb 16 11:03:07] WARNING[6632]: chan_sip.c:3004 create_addr: No such host: 777
   -- Executing [777@from-bill:3] NoOp("IAX2/bill-gw-33", "status ...  ...  ... 3") in new stack

By: pj (pj) 2007-02-16 05:28:57.000-0600

the message "244 ast_get_ip_or_srv: Unable to lookup... " is also new for me...

   -- Executing [203@from-bill:2] ChanIsAvail("IAX2/bill-gw-31", "SIP/203&IAX2/203") in new stack
[Feb 16 12:27:37] WARNING[6632]: chan_sip.c:3004 create_addr: No such host: 203
[Feb 16 12:27:37] WARNING[6632]: acl.c:244 ast_get_ip_or_srv: Unable to lookup '203'
[Feb 16 12:27:37] WARNING[6632]: chan_iax2.c:2694 create_addr: No such host: 203
   -- Executing [203@from-bill:3] NoOp("IAX2/bill-gw-31", "status ...  ...  ... 3") in new stack

By: Joshua C. Colp (jcolp) 2007-02-16 09:31:38.000-0600

The messages come from the respective channel driver. Since there is no peer found it tries to do a DNS lookup which also fails. This is not something that ChanIsAvail can control and not something that will be changed in the channel drivers.