PJ_ENOMEM errors (not enough memory)

At some point, I keep getting this…anyone ever run into this issue? My endpoints all quit working after this happens, and I have to restart Asterisk. Clearly a deadlock. I’ve got over 2GB of free memory too when this happens. If I run sorcery memory cache stale in CLI, Asterisk completely restarts. I’m running Asterisk 13.6.

[2015-12-28 19:24:08] WARNING[5688] pjsip: tsx0x7fdf79b4c .Failed to send Request msg OPTIONS/cseq=64534 (tdta0x7fdf7c0cb4d0)! err=70007 (Not enough memory (PJ_ENOMEM)) [2015-12-28 19:24:10] VERBOSE[30521] res_pjsip/pjsip_configuration.c: Contact 101/e4329421a87fe750c2763b2b063ee b5f has been deleted [2015-12-28 19:25:08] WARNING[2953] pjsip: tsx0x7fdf74035 .Failed to send Request msg OPTIONS/cseq=19705 ( tdta0x7fdf7c0af6e0)! err=70007 (Not enough memory (PJ_ENOMEM))

I had a similar issue with freepbx 13 even on asterisk 11.20 after I upgraded from freepbx 12. The next day there were about 20 modules updates and I installed them all and haven’t had the issue since. Are your modules all up to date?

Every time I get notified of module updates, I install them. So yes, I’m completely up-to-date. This issue started happening since 6.12.65-27, and even on a brand-new install, I can’t seem to figure out why this keeps happening…

I should mention that I’m using all TLS transports, and that I followed the Asterisk Secure Calling tutorial on their wiki to a “T”. Again, I had no problems until I updated to FPBX 6.12.65-27. Even on FPBX 13, I have nothing but trouble. TLS transports had worked perfectly before.

Hmm, different issue then. I had not using TLS transports except for WebRTC where it is basically required but no problems there other than the expected issues due to inconsistencies in how browsers handle WebRTC. Anyway, I suspect my issue had more to do with RestApps leaking memory until all the required modules were updated which seems to have fixed it. In your case, I’m not sure. Have your logs been of any help? Any clue as to calls not completely terminating or anything like that? Any additional info would be helpful.

Well that’s just it; I haven’t made any calls at all. This is just in regards to registering endpoints. At some point, it breaks. When the problem happens, that’s all the logs say (above). Bria throws 503 errors, and that’s all I get. I can telnet into the port, so firewall is no issue.

Are all endpoints the same model? Have you tried registering just one endpoint and watching the system to see what is happening? Could very well be an issue between the version of software on the pbx and enpoint firmware. Does the endpoint successfully register or do they bang away trying until the system is out of resources? How long does this take to happen?

I have Bria softphones and Yealink hardware phones. It basically happens when I’m switching from Wi-Fi to LTE on my iPhone. You would think that would be a consideration with VoIP needing to be on smartphones. But again, I had no trouble before 6.12.65-27 came along; that just killed everything, and I’ve been stuck for several months without a solution. The time for this to happen varies; sometimes it’s right after I restart Asterisk…other times it takes the entire day before it happens.

All my endpoints successfully register with no issues. I’ve monitored one single endpoint registration, and it doesn’t seem like anything is out of the ordinary. But I do get this quite a bit:

[2015-12-28 03:23:10] ERROR[32568] pjsip: tlsc0x7fdf7818 TLS connect() error: Connection timed out [code=120110]

Were you using pjsip before you upgaded?

Indeed I had been. Still using it now. Trying to keep with the future since I’m (relatively) new to Asterisk and would prefer not to redo my setup when it’s time to say goodbye to CHAN_SIP. Plus I need multiple endpoints to the same extension, which is clearly not supported in CHAN_SIP.

maybe, you have to modify the pjsip PJ_POOL_SIZE and try.

Where is that? Google points to source code…I can’t rebuild Asterisk in the FreePBX distro…otherwise I would’ve already run core show locks

For anyone following this, apparently it’s a symptom of another bug in Asterisk 13.6 and below. Appears to have been corrected on Asterisk 13.7; I’m testing rc2 on a custom-built FreePBX install, no issues yet…will report back if there is.

Waiting for FreePBX distro to be released whenever 13.7 actually comes out…any day now, right?

Digium has said this week. When that happens you will have it shortly thereafter.