Chanisavail cannot check the network status

When I use SIP phone (Phone A:SIP/ another phone(Phone B:SIP/ through asterisk,if the network is now broken,the chanisavail() function cannot check the status of channels of SIP/,the return value of chanisavail(SIP/ is that the channel can be use.How can I get the real status of current channels to determinate whether hanging up it or call it by another way?

thanks alot.