Hi, I am registering my Asterisk boxes to a SIP provider for outgoing calls. My "outgoing" dialplan context tries to dial out in sequence, starting with the SIP provider then ISDN lines and finally analog lines. So the idea is that if the SIP trunk fails then all calls are dialed out via ISDN and analog. I noticed however that if I switch my DSL connection off (ie. no internet access to my SIP provider), Asterisk still tries to send calls out to the SIP provider and it doesn't fail over to the other trunks (at least not in an appropriate time lapse). When the DSL is down I get: "sip show registry": Host Username Refresh State Reg. Time sip.provider.com:5060 xxxxxxxxxx 105 Request Sent Tue, 23 Feb 2010 18:06:42 I've read about the sip registerattempts = Number option but: a) is this the option I'm really looking for? b) what happens if the DSL lines come back up? does Asterisk re-attempt registration automatically? Thanks, Vieri
Philipp von Klitzing
2010-Feb-23 18:18 UTC
[asterisk-users] SIP provider registration attempts
Hi!> My "outgoing" dialplan context tries to dial out in sequence, starting > with the SIP provider then ISDN lines and finally analog lines. > [...] > When the DSL is down I get: > > "sip show registry": > > Host Username Refresh State > Reg. Time sip.provider.com:5060 xxxxxxxxxx 105 > Request Sent Tue, > 23 Feb 2010 18:06:42Up front: Call routing has as such nothing to do with SIP registration. Look at qualify= for sip.conf, and consider to extend your diaplan for a better routing decision with a snippet like this: exten => _00.,n,Set(VOIPCHECK=0) exten => _00.,n,NoOp(-- ${PEERCHECK1} status: ${SIPPEER(${PEERCHECK1}:status)} --) exten => _00.,n,ExecIf($["${SIPPEER(${PEERCHECK1}:status):0:2}" = "OK"]|Set|VOIPCHECK=1) where PEERCHECK1 corresponds to the provider section in sip.conf that you would like to monitor. Philipp
--- On Tue, 2/23/10, Philipp von Klitzing <klitzing at pool.informatik.rwth-aachen.de> wrote:> Look at qualify= for sip.conf, and consider to extend your > diaplan for a > better routing decision with a snippet like this: > > exten => _00.,n,Set(VOIPCHECK=0) > exten => _00.,n,NoOp(-- ${PEERCHECK1} status: > ${SIPPEER(${PEERCHECK1}:status)} --) > exten => > _00.,n,ExecIf($["${SIPPEER(${PEERCHECK1}:status):0:2}" = > "OK"]|Set|VOIPCHECK=1) > > where PEERCHECK1 corresponds to the provider section in > sip.conf that you > would like to monitor.Thanks Philipp! Do you suggest I use qualify=yes (default 1 or 2 seconds?) or should I specify a value in ms?