Check if lines are busy before Dial

Hello,

We have Elastix 2.4.0, asterisk 1.8, with FXO cards. We want to check if there is available lines before dial the whole number. In other words, we want to dial any digit ( 9 for example), get a dial tone in case there is an available line then dial the whole number. Otherwise, get a busy tone than hang up.

Thanks and Regards,
Sarkis

ChanIsAvail()
Indicates whether the specified channel is available.
ChanIsAvail(technology1/resource1[&technology2/resource2…][,options])
Verifies that the one or more of the queried channels is available, in the order specified. Returns 0 on success or -1 on failure.
If the s (state) option is given, Asterisk will treat the channel as unavailable if it is in use, even if it is capable of taking another call. Option j sets priority jumping to n+101 if the channel is unavailable

the-asterisk-book.com/1.6/applik … avail.html

Hello,

Thanks. My outbound route was “9” (prefix) and “.” (match pattern). I just deleted the “.” and it worked :smile: