Monitoring SIP Trunk Status On Call By Call Basis

Home » Asterisk Users » Monitoring SIP Trunk Status On Call By Call Basis
Asterisk Users 2 Comments


I’m using Asterisk and adding a fail over trunk in case my primary goes down. I’m wondering what the best method of checking if the primary being up is.

Is DIALSTATUS suitable for this or is there any good SIP headers to look at after the Dial step?

Thanks in Advance


2 thoughts on - Monitoring SIP Trunk Status On Call By Call Basis

  • i think DIALSTATUS is not suitable for failover if trunk is down you get dialstatus after time out in dial string. it is too late for failover, you can use some script to check if destination host is up. if you want to do failover when destination host is up then dialstatus are good.

  • Well, the obvious start point might be ChanIsAvail() – that’ll at least weed out an upstream SIP peer that’s unavailable (assuming you’re using qualify) before you even get as far as Dial().

    However, one of the problems you might encounter when sending calls to a provider is an inability to distinguish between Congestion and Busy. Ideally, of course, you want to route the call to upstream2 if you get Congestion from upstream1, but not if the dialled number is Busy. There’s not always a good way around that.

    As others have said, the only real way around it is to send calls periodically to verify end to end operation – at least this way you’re testing both your upstream’s SIP connectivity and also their PSTN

    Kind regards,