cancel
Showing results for 
Search instead for 
Did you mean: 

Asterisk server dropping connection

gsnet
Dabbler
Posts: 13
Registered: 14-10-2008

Asterisk server dropping connection

I have an asterisk server running on an NSLU2. I have turned on the email on the plusnet sip server that sends an email whenever the phone goes offline. My inbox has been filling up with emails, at 1 to 2 hour intervals telling me the phone has gone offline. It dials ok and plusnet believe it is not anything they are doing.
I have SJPhone on my PDA and leaving this connected to the plus net sip server (with asterisk disconnected) I do not get any lost connection emails so it looks to me like it is asterisk.
Both setup (asterisk or SJPhone) dial ok.
Is there an option in asterisk to do with how long to keep connection and when to refresh or does anyone else have any idea what is happening.
Thanks
GS
17 REPLIES
pd
Grafter
Posts: 235
Registered: 09-05-2008

Re: Asterisk server dropping connection

Quote from: gsnet
Is there an option in asterisk to do with how long to keep connection and when to refresh or does anyone else have any idea what is happening.

You set the registration period (in seconds) with the  defaultexpiry=  variable in the [general] section of sip.conf
Asterisk, by default, will attempt to re-register 15secs before the current registration expires and this has been the cause of some problems.
pd
RichSmol
Grafter
Posts: 709
Registered: 29-10-2007

Re: Asterisk server dropping connection

gsnet - let me know if you continue to have some issues, i made some tweaks to other asterisk user accounts and things seem to of improved for those users. Send me a PM if you need some assistance anyway.
gsnet
Dabbler
Posts: 13
Registered: 14-10-2008

Re: Asterisk server dropping connection

PD,
thanks for the information. I will try this out. Also if the reconnection is attempted 15 seconds prior to the loss of connection, is there a way to make this longer prior to the expected loss of connection, say 1 minute?
Ged
RichSmol
Grafter
Posts: 709
Registered: 29-10-2007

Re: Asterisk server dropping connection

gsnet - you've now been added to the PBX12 instance - please update your SIP domain/realm setting from sip.plus.net to lon-pbx-12.plus.net. You'll probably need to force a new registration (reboot your equipment) for the settings to propogate.
cheers
Rich
pd
Grafter
Posts: 235
Registered: 09-05-2008

Re: Asterisk server dropping connection

Quote from: gsnet
...if the reconnection is attempted 15 seconds prior to the loss of connection, is there a way to make this longer prior to the expected loss of connection, say 1 minute?

You would need to alter the source code and re-compile asterisk but you really don't need to do this. The 15secs is more than ample to ensure that you stay connected.  You will notice a favourable difference once you move to the lon-pbx-12.
pd
gsnet
Dabbler
Posts: 13
Registered: 14-10-2008

Re: Asterisk server dropping connection

Rich
thanks for the help.
I tried adding lon-pbx-12.plus.net but it failed because DNS did not lookup. I changed it to lon-pbx-12.gradwell.net and it still did not connect although I can do a dnslookup and ping lon-pbx-12.gradwell.net but can't on lon-pbx-12.plus.net.
When I use sjphone it will connect to lon-pbx-12.gradwell.net but within less than a minute becomes not registered. SJPhone will connect to sip.plus.net
Given this wasn't working I changed my asterisk server back to the sip.plus.net settings. I deactivated sjphone and now the sip.plus.net settings didn't work on the asterisk server and connect either.
Following your pm about the proxy I worked out the line for outbound proxy in the contexts in sip.conf, natproxy.plus.net under 'outboundproxy=natproxy.plus.net' but still no joy.
I will leave it trying to connect overnight and see what happens
I am at a complete loss as to what is going on.
Any ideas.
GS
RichSmol
Grafter
Posts: 709
Registered: 29-10-2007

Re: Asterisk server dropping connection

hmmm....sounds a bit odd, the PBX12 platform config definitely works without any issues - at the very least you should be able to auth against it. I suspect that there may be some rogue config somewhere within your asterisk setup, unfortunately i'm no help on asterisk so hopefully some other kind asterisk users on this forum can help you out. I know 'pd' is using asterisk and the PBX12 setting (will be setting up my asterisk box soon so i'll be on here for pointers when you do get it working!)
gsnet
Dabbler
Posts: 13
Registered: 14-10-2008

Re: Asterisk server dropping connection

Rich
thanks for the reply but the PBX12 issue is not just with asterisk. I was not able to log in and stay logged in for more than 30 seconds even when using a softphone that will log in to sip.plus.net. Admittedly registering at all with the softphone, for however brief a period, was more than I managed with asterisk and now my asterisk settings that previously worked with sip.plus.net will not work.
Is there some special login needed for PBX12 or is just my sip ID and password?
Ged
RichSmol
Grafter
Posts: 709
Registered: 29-10-2007

Re: Asterisk server dropping connection

Yeh you should only need to change the SIP proxy setting. I'll get in touch with Gradwell and get them to confirm that theres nothing wrong with the account before we continue. I cant see anything wrong from this side but we only get a limited view of diagnostic tools.
RichSmol
Grafter
Posts: 709
Registered: 29-10-2007

Re: Asterisk server dropping connection

just running some tests on your account - i've had to change the password to be able to do the testing so hope you dont mind! I can change it back afterwards if you wish.
RichSmol
Grafter
Posts: 709
Registered: 29-10-2007

Re: Asterisk server dropping connection

I've reset your password and can auth on SJPhone now using the new nat proxy and the PBX12 setting (with and without both) so please give that new password a try and see how you get on- looks like the password might of become locked at some point.
pd
Grafter
Posts: 235
Registered: 09-05-2008

Re: Asterisk server dropping connection

Quote from: Rich
I suspect that there may be some rogue config somewhere within your asterisk setup, unfortunately i'm no help on asterisk so hopefully some other kind asterisk users on this forum can help you out. I know 'pd' is using asterisk and the PBX12 setting (will be setting up my asterisk box soon so i'll be on here for pointers when you do get it working!)

In the good old Blue Peter tradition Click Here for one I did earlier - you will need to change references to sip2.plus.net to lon-pbx-12.gradwell.net
pd
gsnet
Dabbler
Posts: 13
Registered: 14-10-2008

Re: Asterisk server dropping connection

PD
Thanks for the file. I made really simple sip.conf file and it connected immediately so it is clear I have set up something wrong. Working my way through to find out what.
I have a couple of questions about your sip.conf file if you don't mind answering.
you have set srvlookup=no, won't this stop asterisk registering by domain name rather than ip address?
Also you have left a couple of things out I thought were neccesary. Since your file works and mine no longer does I presume these are in fact not required. One of these is bindport. I thought this was needed but clearly not.
Went through and removed a lot of things and it all worked. I have no idea what was wrong but I must have changed something because it worked previously.
Ged
gsnet
Dabbler
Posts: 13
Registered: 14-10-2008

Re: Asterisk server dropping connection

I am adding to this post to try and get some more advice. My connection is now connecting but looks like is dropping every 1.5 hours for about 25 to 45 minutes. I am getting to the point where I don't expect the service to work.
I changed my settings from PDs file so that the default min expiry time was 120 seconds in case for some reason asterisk was failing to connect. I plan to let it run another 24hours with that as the setting to see how it goes but if anyone else has an ideas what I should be doing I'd be grateful
GS