Reload Endpoint Runtime

I’ve added endpoint to pjsip.conf during runtime but when I tries to reload it via command…
module reload res_pjsip.so
it gives me an error

plus my endpoint state becomes unavailable test789

How can I reload pjsip.conf when I add endpoint during runtime without restarting or rebooting.
If I have client on the phones, I dont want the calls to drop.

The message you reference is not an error, it’s a notice. It states that you can’t reload the “system” type. Other types are reloaded and doing “module reload res_pjsip.so” will reload the endpoints.

When I add an endpoint, it loads it but why does the state says “unavailable” instead of "Not in use?"
When I restart Asterisk, then it changes to “Not in use.”

What is the precise configuration for it?

[transport-udp-nat]
	type=transport                                ; Transport may  be used by configuration objects/sections
	protocol=udp                                  ; Use the UDP protocol
	bind=0.0.0.0                                  ; Communicate over most appropriate available interfaces
	local_net=192.168.1.0/24                      ; IP network that we want to consider our local network
	local_net=127.0.0.1/32                        ; Alias IP network that we want to consider our local network
	external_media_address=111.111.111.111          ; External IP address for  RTP handling
	external_signaling_address=111.111.111.111      ; External IP address for SIP signaling

[device_template](!)
	type=endpoint
	transport=transport-udp-nat
	context=callspool
	dtmf_mode=auto
	disallow=all
	allow=ulaw
	aors=anveodirect_aor
	from_domain=sbc.anveo.com

[device_aor](!)
	type=aor
	contact=sip:sbc.anveo.com:5060
	
;//&
[test123](device_template)
[test123](device_aor) 
;//&
[test456](device_template)
[test456](device_aor)
;//&
[test789](device_template)
[test789](device_aor)

basically Im trying to add queue members dynamically via ami and
add endpoint manually to pjsip.conf programmatically via NodeJS
then reload pjsip but it doesnt load correctly unless I restart asterisk completely

You appear to be experiencing an issue that has already been filed[1].

[1] https://issues.asterisk.org/jira/browse/ASTERISK-25466

Im hitting a dead end now. Would you be able to help.
I would like to add queue members dynamically but apparently I cant use the same generic endpoint interface from in pjsip.conf because the “current state” of each “queue member” isn’t properly recognize. After the first call, each queue member will stay in “In Use” state.

What version of Asterisk are you using? There was an issue in some older ones where the queue member was marked as being in a call when it really wasn’t. Otherwise you’d need to show things and perhaps someone could help further.

Asterisk 13.17.1 built by root @ ASTERISK on a x86_64 running Linux on 2017-09-03 05:29:32 UTC

I’m not aware of any queue specific issues to cause that, so further investigation (and probably labbing up) would need to be done to try to isolate what in your particular use case causes it.

I create another topic earlier specially to this issue via


but because I couldnt find a fix, I tried to add endpoint programically but I couldnt reload res.pjsip.so

Please help, not sure what else i can do.

Not sure if anyone else have a problem with this but I did find a work around if anyone is interested.

I’ve done some research and it appears each queue member need their own endpoint to provide a state when answering queues accordingly which I needed to reload res_pjsip.so during runtime.

Failed Attempts:
I thought I found a quick solution by running the command pjsip qualify (endpoint added) but it only ran once then it wouldn’t work again unless I change the endpoints “aor contact” in pjsip.conf

Reason:
What I notice is pjsip doesn’t want to update information it saved already in its cache then I learn another technique which is very cumbersome.

Solution:
I removed all my endpoints except the template,
then run command “pjsip reload res_pjsip.so” which force asterisk to re-cache all new information.
then re-add the endpoints plus the new endpoint I wanted
then run command “pjsip reload res_pjsip.so” again
then asterisk will try to reach all endpoint again.

Proof:
I got my endpoint status from Unavailable to Not in Use which is needed for queues to work properly.
While the endpoint are in unavailable, they wouldnt answer clients in queues

Etc:
I also set AOR to qualify_frequency=1
Documentation stated qualify_frequency is interval between attempt to reach endpoint but it only tries once if it succeed
All my queues members connected via cell phone

Alternative:
I could have statically add all the endpoints I needed for queues to work but you need to restart asterisk to make all queue members work.

Currently I have an interface which can add queue members dynamically so I desperately needed a way to add members dynamically without restart asterisk

image

Reference:
https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Configuration_res_pjsip

CLI Commands:
pjsip list endpoints
queue show support
pjsip reload res_pjsip.so
pjsip qualify (endpoint added)