Thanks - it is helpful to have that starting point.
I’ve put the following together (see below) based on info on the page that you gave.
I can make calls. Problem: Not long after I hangup an incoming call I notice that incoming calls stop working and the voip.ms website reports “No registration found” (whereas before a call it reports the SIP connection “registered”)
Presumably I need to add something to pjsip.conf?
[simpletrans]
type=transport
protocol=udp
bind=0.0.0.0:5006 ; use a different port to help minimize exploits during setup!
The type=registration section should keep an outbound registration going. What version of Asterisk 13? As well - what happens if you do module reload res_pjsip_outbound_registration.so?
Many thanks for these suggestions. It appeared that the initial connection worked (“service asterisk restart” therefore got things going well), but the keeping alive attempt at 60 seconds would cause unregister - and indeed so would reloading the module.
I ended up using IAX2 to get things working temporarily, but I also asked the voip.ms guys, and as a result they have now published guidance specifically for PJSIP. Here:
Another user here trying to get pjsip running on voip.ms.
I followed the voip support instructions very carefully but I get a segfault when reading pjsip.conf.
Asterisk 13, revision 434725 via svn. Latest pjsip. openSUSE 13.2 with repo kernel for desktop.
Installation ok after correcting the issue in include/asterisk/autoconfig.h
(note: attempting to use cmd service to start asterisk is bad in this case since it just respawns with error continuously based on sounds from asterisk server and will not stop.)
On bash command “asterisk -vvvvvvc” extensive startup output terminates in:
Since asterisk will not start properly I can’t get to a CLI to do futher testing.
Note that in the output from asterisk startup, the attempt here to parse pjsip.conf is about the fourth or fifth note in the log, previous attempts to read the file have evidently succeeded so that eliminates a lot of possibilities, bad formatting etc.
What would be enormously helpful here is for someone who has this running to say what asterisk is trying to do when the segfault occurs. Output from kernel messages is:
2015-06-18T08:53:50.759624-04:00 linux-yrir kernel: [ 248.808589] asterisk[4089]: segfault at 1cc ip b59c8488 sp b6540f30 error 4 in res_pjsip_outbound_registration.so[b5997000+55000]
Suggestions appreciated, thanks. I will contact voip.ms with details.
I’ve seen that happen when the PJSIP install on the system is compromised in some fashion. Multiple installs, no shared libraries installed. That sort of thing. Getting a backtrace[1] would confirm it.
PJSIP was not built with shared library support, as a result each module has its own copy of the entire PJSIP stack running in an isolated fashion. This will cause crashes and not work at all. You’ll need to clean it out of the system and then reinstall PJSIP with shared library support. Recommended build arguments are documented here[1].
Thankyou. Asterisk working again, this time with pjsip and voip.ms. Progress!
I did read that file, but became overconfident I knew what I was doing. Mistake.
With respect to the topic of the OP regarding registry failures after a certain period of time has elapsed, I had the same problem. It appears to be related to the setting regarding temporary and permanent failures as explained in:
The default appears to be that as soon as there is a failure to renew a registration asterisk will instantly give up. I am experimenting with “auth_rejection_permanent=no”.
Edit: after a short time, asterisk thought it was properly registered, but calls would not go through the registered transport. So that’s not it.
Edit 2: looks like the timeout is about 5 minutes. Steps to reproduce:
start asterisk with pjsip active. Switch on pjsip logger
make calls from extension to my own DID, call is connected and my extensions ring.
within 3-4 minutes calls continue to be successful and events recorded on logger
after about 5 minutes calls are no longer connected. Silence as the number of rings times out, no extensions ring, then the voip.ms service offers to take a message. No sip events recorded in logger.
Edit 3:
After trying “expiration=300” for a while I find that about 50% of my attempts to call my DID fail. This is remarkable. It looks like an expiry of 3 minutes or less is required? I have no idea where the weakness is.