Peers misteriously going offline [SOLVED]

OK,

This is my first post, I didn’t know how to search exatly for my problem then I couldn’t find the answer yet.
Sorry if this post is duplicated :wink:

I have Asterisk-1.8.12.0 compiled from source to work with postgresql-8.4.4, all in slackware64-13.1 with my own kernel-2.6.36.1.
The hardware is Intel motherboard with a xeon quad processor and 2 KHOMP K2E1-SPX boards, those boards are directly connected to 4 DDRs (Branch Direct Diling (portuguese)) from the local telephony operator from which we bought 800 branches (extensions).
Then, all the VoIP thing is only on Local Network withou NAT, and the external thing is done by the Operator analogicaly.

The scenario is, many peers in the city are connected to HUBs where they are bridged via VLAN to the main router which routes the peers to the asterisk server which authenticates them using a postgresql database on a third server.
Every peers use hardphones (Intelbras TIP-100 (TIP is Telephone IP).
Every groups of peers (by HUB) have one VLAN network bridged to the main router as their gateway.
I have 260 peers connected, but the flow is low (up to 5% simultaneous).

/etc/asterisk/iax.conf #commented lines removed

[code][general]
bandwidth=low
disallow=lpc10 ; Icky sound quality… Mr. Roboto.
jitterbuffer=no
forcejitterbuffer=no
autokill=yes

[guest]
type=user
context=default
callerid=“Guest IAX User”

[iaxtel]
type=user
context=default
auth=rsa
inkeys=iaxtel

[iaxfwd]
type=user
context=default
auth=rsa
inkeys=freeworlddialup

[demo]
type=peer
username=asterisk
secret=supersecret
host=216.207.245.47
[/code]
/etc/asterisk/sip.conf #commented lines removed

[code][general]
context=piratuba ; Default context for incoming calls
allowguest=no ; Allow or reject guest calls (default is yes)
allowoverlap=no ; Disable overlap dialing support. (Default is yes)
udpbindaddr=0.0.0.0 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
tcpenable=no ; Enable server for incoming TCP connections (default is no)
tcpbindaddr=0.0.0.0 ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
srvlookup=yes ; Enable DNS SRV lookups on outbound calls
language=pt_BR ; Default language setting for all users/peers
authfailureevents=yes ; generate manager “peerstatus” events when peer can’t
rtcachefriends=yes ; Cache realtime friends by adding them to the internal list
rtupdate=yes ; Send registry updates to database using realtime? (yes|no)
rtautoclear=180 ; Auto-Expire friends created on the fly on the same schedule
ignoreregexpire=no ; Enabling this setting has two functions:

[authentication]
[/code]
/etc/asterisk/extensions.conf #complete

[code][general]
static=yes
writeprotect=no
autofallthrough=yes
; priorityjumping=yes

[globals]

[interior0]
include => khomp-00-00
include => from-pbx00

[interior1]
include => khomp-01-01
include => from-pbx11

[prefeitura0]
include => khomp-00-01
include => from-pbx01

[prefeitura1]
include => khomp-01-00
include => from-pbx10

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[from-pbx00]
exten => _9090.,1,Dial(khomp/b0l0/${EXTEN})
exten => _9090.,2,Busy(5)
exten => _9090.,3,Hangup()

exten => _9014.,1,Dial(khomp/b0l0/${EXTEN})
exten => _9014.,2,Busy(5)
exten => _9014.,3,Hangup()

exten => _0800.,1,Dial(khomp/b0l0/${EXTEN})
exten => _0800.,2,Busy(5)
exten => _0800.,3,Hangup()

exten => _0300.,1,Dial(khomp/b0l0/${EXTEN})
exten => _0300.,2,Busy(5)
exten => _0300.,3,Hangup()

exten => _1052,1,Dial(khomp/b0l0/${EXTEN})
exten => _1052,2,Busy(5)
exten => _1052,3,Hangup()

exten => _1XX,1,Dial(khomp/b0l0/${EXTEN})
exten => _1XX,2,Busy(5)
exten => _1XX,3,Hangup()

; Chamadas locais fixo
exten => _[1-5]XXXXXXX,1,Goto(to-pstn-00,${EXTEN},1)
exten => _[1-5]XXXXXXX,2,Busy(5)
exten => _[1-5]XXXXXXX,3,Hangup()

; Chamadas Celular VC1 - OI
exten => _[6-9]XXXXXXX,1,Goto(to-pstn-00,${EXTEN},1)
exten => _[6-9]XXXXXXX,2,Busy(5)
exten => _[6-9]XXXXXXX,3,Hangup()

; Chamadas DDD fixo - Telfree
exten => _014XX[1-5]XXXXXXX,1,NoOp(${CALLERID(num)})
exten => _014XX[1-5]XXXXXXX,2,Goto(to-pstn-00,${EXTEN},1)
exten => _014XX[1-5]XXXXXXX,3,Busy(5)
exten => _014XX[1-5]XXXXXXX,4,Hangup()

; Chamadas DDD Movel - Tellfree
exten => _014XX[6-9]XXXXXXX,1,NoOp(${CALLERID(num)})
exten => _014XX[6-9]XXXXXXX,2,Goto(to-pstn-00,${EXTEN},1)
exten => _014XX[6-9]XXXXXXX,3,Busy(5)
exten => _014XX[6-9]XXXXXXX,4,Hangup()

; Chamadas Internacional - Tellfree
exten => _0014XX.,1,NoOp(${CALLERID(num)})
exten => _0014XX.,2,GotoIfTime(19:30-07:00,,,*?to-pstn-00,${EXTEN},3)
exten => _0014XX.,3,Goto(to-pstn-00,${EXTEN},1)
exten => _0014XX.,4,Busy(3)
exten => _0014XX.,5,Hangup()

[from-pbx10]
exten => _9090.,1,Dial(khomp/b1l0/${EXTEN})
exten => _9090.,2,Busy(5)
exten => _9090.,3,Hangup()

exten => _9014.,1,Dial(khomp/b1l0/${EXTEN})
exten => _9014.,2,Busy(5)
exten => _9014.,3,Hangup()

exten => _0800.,1,Dial(khomp/b1l0/${EXTEN})
exten => _0800.,2,Busy(5)
exten => _0800.,3,Hangup()

exten => _0300.,1,Dial(khomp/b1l0/${EXTEN})
exten => _0300.,2,Busy(5)
exten => _0300.,3,Hangup()

exten => _1052,1,Dial(khomp/b1l0/${EXTEN})
exten => _1052,2,Busy(5)
exten => _1052,3,Hangup()

exten => _1XX,1,Dial(khomp/b1l0/${EXTEN})
exten => _1XX,2,Busy(5)
exten => _1XX,3,Hangup()

; Chamadas locais fixo
exten => _[1-5]XXXXXXX,1,Goto(to-pstn-10,${EXTEN},1)
exten => _[1-5]XXXXXXX,2,Busy(5)
exten => _[1-5]XXXXXXX,3,Hangup()

; Chamadas Celular VC1 - OI
exten => _[6-9]XXXXXXX,1,Goto(to-pstn-10,${EXTEN},1)
exten => _[6-9]XXXXXXX,2,Busy(5)
exten => _[6-9]XXXXXXX,3,Hangup()

; Chamadas DDD fixo - Telfree
exten => _014XX[1-5]XXXXXXX,1,NoOp(${CALLERID(num)})
exten => _014XX[1-5]XXXXXXX,2,Goto(to-pstn-10,${EXTEN},1)
exten => _014XX[1-5]XXXXXXX,3,Busy(5)
exten => _014XX[1-5]XXXXXXX,4,Hangup()

; Chamadas DDD Movel - Tellfree
exten => _014XX[6-9]XXXXXXX,1,NoOp(${CALLERID(num)})
exten => _014XX[6-9]XXXXXXX,2,Goto(to-pstn-10,${EXTEN},1)
exten => _014XX[6-9]XXXXXXX,3,Busy(5)
exten => _014XX[6-9]XXXXXXX,4,Hangup()

; Chamadas Internacional - Tellfree
exten => _0014XX.,1,NoOp(${CALLERID(num)})
exten => _0014XX.,2,GotoIfTime(19:30-07:00,,,*?to-pstn-10,${EXTEN},3)
exten => _0014XX.,3,Goto(to-pstn-10,${EXTEN},1)
exten => _0014XX.,4,Busy(3)
exten => _0014XX.,5,Hangup()

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[from-pbx01]
exten => _9090.,1,Dial(khomp/b0l1/${EXTEN})
exten => _9090.,2,Busy(5)
exten => _9090.,3,Hangup()

exten => _9014.,1,Dial(khomp/b0l1/${EXTEN})
exten => _9014.,2,Busy(5)
exten => _9014.,3,Hangup()

exten => _0800.,1,Dial(khomp/b0l1/${EXTEN})
exten => _0800.,2,Busy(5)
exten => _0800.,3,Hangup()

exten => _0300.,1,Dial(khomp/b0l1/${EXTEN})
exten => _0300.,2,Busy(5)
exten => _0300.,3,Hangup()

exten => _1052,1,Dial(khomp/b0l1/${EXTEN})
exten => _1052,2,Busy(5)
exten => _1052,3,Hangup()

exten => _1XX,1,Dial(khomp/b0l1/${EXTEN})
exten => _1XX,2,Busy(5)
exten => _1XX,3,Hangup()

; Chamadas locais fixo
exten => _[1-5]XXXXXXX,1,Goto(to-pstn-01,${EXTEN},1)
exten => _[1-5]XXXXXXX,2,Busy(5)
exten => _[1-5]XXXXXXX,3,Hangup()

; Chamadas Celular VC1 - OI
exten => _[6-9]XXXXXXX,1,Goto(to-pstn-01,${EXTEN},1)
exten => _[6-9]XXXXXXX,2,Busy(5)
exten => _[6-9]XXXXXXX,3,Hangup()

; Chamadas DDD fixo - Telfree
exten => _014XX[1-5]XXXXXXX,1,NoOp(${CALLERID(num)})
exten => _014XX[1-5]XXXXXXX,2,Goto(to-pstn-01,${EXTEN},1)
exten => _014XX[1-5]XXXXXXX,3,Busy(5)
exten => _014XX[1-5]XXXXXXX,4,Hangup()

; Chamadas DDD Movel - Tellfree
exten => _014XX[6-9]XXXXXXX,1,NoOp(${CALLERID(num)})
exten => _014XX[6-9]XXXXXXX,2,Goto(to-pstn-01,${EXTEN},1)
exten => _014XX[6-9]XXXXXXX,3,Busy(5)
exten => _014XX[6-9]XXXXXXX,4,Hangup()

; Chamadas Internacional - Tellfree
exten => _0014XX.,1,NoOp(${CALLERID(num)})
exten => _0014XX.,2,GotoIfTime(19:30-07:00,,,*?to-pstn-01,${EXTEN},3)
exten => _0014XX.,3,Goto(to-pstn-01,${EXTEN},1)
exten => _0014XX.,4,Busy(3)
exten => _0014XX.,5,Hangup()

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[from-pbx11]
exten => _9090.,1,Dial(khomp/b1l1/${EXTEN})
exten => _9090.,2,Busy(5)
exten => _9090.,3,Hangup()

exten => _9014.,1,Dial(khomp/b1l1/${EXTEN})
exten => _9014.,2,Busy(5)
exten => _9014.,3,Hangup()

exten => _0800.,1,Dial(khomp/b1l1/${EXTEN})
exten => _0800.,2,Busy(5)
exten => _0800.,3,Hangup()

exten => _0300.,1,Dial(khomp/b1l1/${EXTEN})
exten => _0300.,2,Busy(5)
exten => _0300.,3,Hangup()

exten => _1052,1,Dial(khomp/b1l1/${EXTEN})
exten => _1052,2,Busy(5)
exten => _1052,3,Hangup()

exten => _1XX,1,Dial(khomp/b1l1/${EXTEN})
exten => _1XX,2,Busy(5)
exten => _1XX,3,Hangup()

; Chamadas locais fixo
exten => _[1-5]XXXXXXX,1,Goto(to-pstn-11,${EXTEN},1)
exten => _[1-5]XXXXXXX,2,Busy(5)
exten => _[1-5]XXXXXXX,3,Hangup()

; Chamadas Celular VC1 - OI
exten => _[6-9]XXXXXXX,1,Goto(to-pstn-11,${EXTEN},1)
exten => _[6-9]XXXXXXX,2,Busy(5)
exten => _[6-9]XXXXXXX,3,Hangup()

; Chamadas DDD fixo - Telfree
exten => _014XX[1-5]XXXXXXX,1,NoOp(${CALLERID(num)})
exten => _014XX[1-5]XXXXXXX,2,Goto(to-pstn-11,${EXTEN},1)
exten => _014XX[1-5]XXXXXXX,3,Busy(5)
exten => _014XX[1-5]XXXXXXX,4,Hangup()

; Chamadas DDD Movel - Tellfree
exten => _014XX[6-9]XXXXXXX,1,NoOp(${CALLERID(num)})
exten => _014XX[6-9]XXXXXXX,2,Goto(to-pstn-11,${EXTEN},1)
exten => _014XX[6-9]XXXXXXX,3,Busy(5)
exten => _014XX[6-9]XXXXXXX,4,Hangup()

; Chamadas Internacional - Tellfree
exten => _0014XX.,1,NoOp(${CALLERID(num)})
exten => _0014XX.,2,GotoIfTime(19:30-07:00,,,*?to-pstn-11,${EXTEN},3)
exten => _0014XX.,3,Goto(to-pstn-11,${EXTEN},1)
exten => _0014XX.,4,Busy(3)
exten => _0014XX.,5,Hangup()

[to-pstn-00]
; LIGACOES LOCAIS
exten => _X.,1,Set(__TRANSFER_CONTEXT=khomp-00-00)
exten => _X.,2,NoOp(${CALLERID(num)})
exten => _X.,3,Dial(khomp/b0l0/${EXTEN},60,TtWw)
exten => _X.,4,Goto(s-${DIALSTATUS},1)
exten => _X.,5,Busy(5)
exten => _X.,6,Hangup()

exten => s-CONGESTION,1,Busy(5)
exten => s-CONGESTION,2,Hangup()
exten => s-CANCEL,1,Busy(5)
exten => s-CANCEL,2,Hangup()
exten => s-BUSY,1,Busy(5)
exten => s-BUSY,2,Hangup()
exten => s-CHANUNAVAIL,1,Busy(5)
exten => s-CHANUNAVAIL,2,Hangup()
exten => s-NOANSWER,1,Busy(5)
exten => s-NOANSWER,2,Hangup()

[to-pstn-10]
; LIGACOES LOCAIS
exten => _X.,1,Set(__TRANSFER_CONTEXT=khomp-01-00)
exten => _X.,2,NoOp(${CALLERID(num)})
exten => _X.,3,Dial(khomp/b1l0/${EXTEN},60,TtWw)
exten => _X.,4,Goto(s-${DIALSTATUS},1)
exten => _X.,5,Busy(5)
exten => _X.,6,Hangup()

exten => s-CONGESTION,1,Busy(5)
exten => s-CONGESTION,2,Hangup()
exten => s-CANCEL,1,Busy(5)
exten => s-CANCEL,2,Hangup()
exten => s-BUSY,1,Busy(5)
exten => s-BUSY,2,Hangup()
exten => s-CHANUNAVAIL,1,Busy(5)
exten => s-CHANUNAVAIL,2,Hangup()
exten => s-NOANSWER,1,Busy(5)
exten => s-NOANSWER,2,Hangup()

[to-pstn-01]
; LIGACOES LOCAIS
exten => _X.,1,Set(__TRANSFER_CONTEXT=khomp-00-01)
exten => _X.,2,NoOp(${CALLERID(num)})
exten => _X.,3,Dial(khomp/b0l1/${EXTEN},60,TtWw)
exten => _X.,4,Goto(s-${DIALSTATUS},1)
exten => _X.,5,Busy(5)
exten => _X.,6,Hangup()

exten => s-CONGESTION,1,Busy(5)
exten => s-CONGESTION,2,Hangup()
exten => s-CANCEL,1,Busy(5)
exten => s-CANCEL,2,Hangup()
exten => s-BUSY,1,Busy(5)
exten => s-BUSY,2,Hangup()
exten => s-CHANUNAVAIL,1,Busy(5)
exten => s-CHANUNAVAIL,2,Hangup()
exten => s-NOANSWER,1,Busy(5)
exten => s-NOANSWER,2,Hangup()

[to-pstn-11]
; LIGACOES LOCAIS
exten => _X.,1,Set(__TRANSFER_CONTEXT=khomp-01-01)
exten => _X.,2,NoOp(${CALLERID(num)})
exten => _X.,3,Dial(khomp/b1l1/${EXTEN},60,TtWw)
exten => _X.,4,Goto(s-${DIALSTATUS},1)
exten => _X.,5,Busy(5)
exten => _X.,6,Hangup()

exten => s-CONGESTION,1,Busy(5)
exten => s-CONGESTION,2,Hangup()
exten => s-CANCEL,1,Busy(5)
exten => s-CANCEL,2,Hangup()
exten => s-BUSY,1,Busy(5)
exten => s-BUSY,2,Hangup()
exten => s-CHANUNAVAIL,1,Busy(5)
exten => s-CHANUNAVAIL,2,Hangup()
exten => s-NOANSWER,1,Busy(5)
exten => s-NOANSWER,2,Hangup()

[khomp-00-00]
exten => _6XXX,1,Answer()
exten => _6XXX,n,Dial(Sip/${EXTEN},60,Tt)
exten => _6XXX,n,Busy(3)
exten => _6XXX,n,Hangup()

[khomp-01-00]
exten => _6XXX,1,Answer()
exten => _6XXX,n,Dial(Sip/${EXTEN},60,Tt)
exten => _6XXX,n,Busy(3)
exten => _6XXX,n,Hangup()

[khomp-00-01]
exten => _6XXX,1,Answer()
exten => _6XXX,n,Dial(Sip/${EXTEN},60,Tt)
exten => _6XXX,n,Busy(3)
exten => _6XXX,n,Hangup()

[khomp-01-01]
exten => _6XXX,1,Answer()
exten => _6XXX,n,Dial(Sip/${EXTEN},60,Tt)
exten => _6XXX,n,Busy(3)
exten => _6XXX,n,Hangup()
[/code]

I have it all working with asterisk-1.4.22.x, but since it is no longer suported I upgraded to 1.8.
The problem I have now is that some peers get offline (Host = Unspecified) after a couple of minutes. In the end of the first hour after I restart asterisk I get 30 peers offline whose stay like this till I restart again.
When they are offline they still can make calls but can’t receive calls.
The error on the asterisk CLI is that known:

They can only receive calls on the first minutes when asterisk started (before their host turns to unspecified), it didn’t happen before with asterisk-1.4.

What may be causing them to go offline?
How can I fix it?

Sorry for the long post, and thanks in advance.

Well,

More than 24 hours had passed (according to the forum rules) and I had no reply :frowning:

I know I have a pretty complex network and it is hard to keep it working, but if any one have had a thing like this (peers going offline) with asterisk-1.8 and have solved it. Comment on…

PS.: I visited some peers today, and rebooted their hardphones with a “more specific” configuration and they got stable till now. I’ll try more tomorrow and post the solution if I find it on my own.

PSS.: I’ve been reading and I realised that the DDR I mentioned on the first post is what you call DID (at least I think so);

Thanks again… 8)

I think your DDR corresponds to the traditional meaning of DID or DDI in English.

The pure VoIP people tend to use it to refer to a DID number at the, out-sourced, PSTN gateway, which may or may not carry routing digits when it reaches the VoIP system.

Hi

Ok firstly , if your newwork worked on 1.4 just because it was out of LTS was no reason to upgrade. If you want fast response to an issue take out a support agreement with Digium.

As to the issue, it sounds like an issue with qualify and the peers not holding their natted routes open. a sip trace would have helped you diagnose the issue. I would set the registration times on the peers to say 3 minutes and see what happens.

Well, thanks for the tip. Iwas really ready to downgrade if necessary…

Sorry, I don’t want fast response. I just posted down on my post to keep it up, and I waited the 24 hours to do it according to the forum rules (which I did read before post).

It is the same thing I though, than I came to the city where I have this network yesterday and visited some clients. And they are still working today.
They have no NAT, but the 3 minutes NOTIFY and NO-REAUTH that I checked on the IP phones seemed to solve my problem.

The thing is, I have 230 peers working without this specific configuration but 30 of them need it.

It looks like the asterisk-1.8 is more rigorous with their qualify/notify/keep-alive thing.

Well,

I downgraded do asterisk-1.4.42 until I can solve this problem.

It looks like the 30 offline peers kept changing randomly, then I’ll have to visit the 260 peers (clients) to change their configuration and teach the tecnicians to to the same on new peers.

Till then I’ll keep the 1.4,

Thanks…