Changing the SIP channel back to chan_sip

PJSIP never releases the memory, and after a few hours, even with zero calls open, it draws to a halt.
Unless somebody can figure out what’s going on.

So using FreePBX how do go back and change the SIP engine back to chan_sip?

rasterisk -x “memory show allocations” |sort -t" " -n -k1 | tail -20
25192 bytes allocated by sip_options_contact_statuses_alloc() line 415 of res_pjsip/pjsip_options.c
25216 bytes allocated by ast_res_pjsip_init_options_handling() line 2946 of res_pjsip/pjsip_options.c
26496 bytes allocated by load_module() line 155 of codec_resample.c
32720 bytes allocated by acf_retrieve_docs() line 359 of pbx_functions.c
65488 bytes allocated by acf_retrieve_docs() line 359 of pbx_functions.c
65488 bytes allocated by ast_register_application2() line 157 of pbx_app.c
68000 bytes allocated by default_block_alloc() line 46 of …/src/pj/pool_policy_malloc.c
68000 bytes allocated by default_block_alloc() line 46 of …/src/pj/pool_policy_malloc.c
524408 bytes allocated by load_objects() line 14840 of chan_iax2.c
524408 bytes allocated by load_objects() line 14846 of chan_iax2.c
524800 bytes allocated by default_block_alloc() line 46 of …/src/pj/pool_policy_malloc.c
524800 bytes allocated by default_block_alloc() line 46 of …/src/pj/pool_policy_malloc.c
703967 bytes in deferred free large allocations
718236 bytes in deferred free allocations
1052000 bytes allocated by default_block_alloc() line 46 of …/src/pj/pool_policy_malloc.c
2100000 bytes allocated by default_block_alloc() line 46 of …/src/pj/pool_policy_malloc.c
20972000 bytes allocated by default_block_alloc() line 46 of …/src/pj/pool_policy_malloc.c
41054128 bytes allocated (9224 in caches) in 82929 selected allocations
41054128 bytes in all allocations
41772364 bytes in all allocations and deferred free allocations

What version of Asterisk are you using?

Changing protocols is really a matter of just making sure that they are enabled and listening/bound to the port that you want them to listen to. So if you are replacing pjsip with sip you’d swap the ports that are assigned to them and then make sure that all the extensions are set/changed to the appropriate tech.

Is there a video by any chance?
I am using asterisk 16.30.1, FreePBX 16

Others have not reported this issue. Perhaps you have a trunk with unusual settings, a device making unusual requests, an attacker targeting your system in an unusual way, etc. It would be useful to find the bug and get it fixed. Running on chan_sip will become ever more difficult on newer Asterisk versions.

Your post shows only 41 MB allocated. I assume that you have at least 500 MB available to start. Looking at memory allocations after the system has been up a couple of hours may give a clue. Or, there may be repeated error messages in the Asterisk log. Or, when the system does crash, the routine that fails to allocate memory may be the one leaking it.

You may be able to track down the problem by (for example), disabling all trunks and seeing whether it still leaks. Or, disable half the extensions and look at the leak rate. If it’s about half, that suggests that each extension is contributing. If it drops to zero, one of the disabled ones is the culprit. If it stays the same, one of the ones still enabled is the problem.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.