header image
Home arrow Technical Notes arrow Tech Notes arrow Checking Trunk registrations
Checking Trunk registrations PDF Print E-mail

We got a call today from a customer who uses skype trunks for some international incoming numbers. We have found that these lose registration on a regular basis, We could let them be set try and register indefinitely but this can have performance effects on the server. 

This is not our only customer with this problem, We have also of late noticed a similar problem with Voip-unlimited where registration times out every day at 8pm, we have noted this on ours and other dealers servers.

So what to do?

Well we have written a quick script to check registration details and reload if not correct.

#!/bin/bash


HITS=`asterisk -r -x "sip show registry" | grep Registered |grep $1| wc -l`


if [ $HITS != $2 ]; then

        echo "Incorrect number of $1 trunks are registered, we wanted $2 :-) "

        echo "We will now reload asterisk "

        asterisk -r -x "reload chan_sip.so"

        exit 0

else

        echo "$HITS $1 trunks are registered, we wanted $2 :-) ALL OK"

        exit 0

fi

 

the syntax for running the script is

 

script_name.sh hostname 2

with hostname being part of the string you get when doing a sip show registry.

and the number is the number of registered trunks you expect with that name.

if all is well:

"2 sipgate trunks are registered, we wanted 2 :-) ALL OK"

and nothing happens

if not correct number then:

"Incorrect number of sipgate trunks are registered, we wanted 2 :-)

"We will now reload asterisk"

we only relaod the sip channel driver as thsi is enough to sort the problem normally





 

Sip attacks are on the increase, Read or article on Sip security and look at the ITSPA document as well to make sure you are secure

images/stories/gaplogoweb.jpg

Skype Me™!

EFM Broadband
Number Porting
Asterisk
Technical Notes
User Guides
Case studies
System Monitoring
Suppliers
Blog