Getting DIALSTATUS of a specific trunk before making call

Hi there;

I’m trying to implement LCR with asterisk.
This is done thru AGI, and i got the following question:

Once i’m dialing out thru the DIAL command i get a DIALSTATUS hich can be ANSWER, CONGESTION, ETC.

like: DIAL(SIP/MyTrunkProvider/PhoneNumber)

is there any way to know the DIALSTATUS of this specific channel/provider (MyTrunkProvider) right before making that call?

Like knowing if its “available” or if it will return CONGESTION, etc.

Thanks

how are you supposed to know if an external call is going to return CONGESTION without making the call ??

or perhaps you mean CLI> show application ChanIsAvail ??

What you’re saying it’s very reasonable.

Actually more than a channel, what i’m lokking for is to check the status of a trunk (connection) with a specific provider, the one who actually terminates the call for me.

you think that something like this will work?

exten => s,1,ChanIsAvail(SIP/MyProvidersTrunk)

Will it make the trick?

Thanks

[quote=“pepehammer”]What you’re saying it’s very reasonable.

Actually more than a channel, what i’m lokking for is to check the status of a trunk (connection) with a specific provider, the one who actually terminates the call for me.

you think that something like this will work?

exten => s,1,ChanIsAvail(SIP/MyProvidersTrunk)

Will it make the trick?

Thanks[/quote]

I would try SIPPEER function.
make sure you have quakify=yes in sip.conf for your peer.

why not try it and see ?? live dangerously sometimes.

voip-info.org/wiki-Asterisk+cmd+ChanIsAvail

Any other idea guys?

so what did you try already ?