res_pjsip/config_transport: Allow reloading transports.
authorGeorge Joseph <george.joseph@fairview5.com>
Thu, 11 Feb 2016 17:01:05 +0000 (10:01 -0700)
committerGeorge Joseph <george.joseph@fairview5.com>
Sat, 20 Feb 2016 00:57:55 +0000 (18:57 -0600)
commitba8adb4ce3ac15198b0dfe38df890d4283ad9bc8
treeb739fd5001c12ae8d33c72a20203d65857676c9f
parent6fc57b3e1f401fd18e3e4d4462f973094dd0908c
res_pjsip/config_transport: Allow reloading transports.

The 'reload' mechanism actually involves closing the underlying
socket and calling the appropriate udp, tcp or tls start functions
again.  Only outbound_registration, pubsub and session needed work
to reset the transport before sending requests to insure that the
pjsip transport didn't get pulled out from under them.

In my testing, no calls were dropped when a transport was changed
for any of the 3 transport types even if ip addresses or ports were
changed. To be on the safe side however, a new transport option was
added (allow_reload) which defaults to 'no'.  Unless it's explicitly
set to 'yes' for a transport, changes to that transport will be ignored
on a reload of res_pjsip.  This should preserve the current behavior.

Change-Id: I5e759850e25958117d4c02f62ceb7244d7ec9edf
CHANGES
configs/samples/pjsip.conf.sample
contrib/ast-db-manage/config/versions/3bcc0b5bc2c9_add_allow_reload_to_ps_transports.py [new file with mode: 0644]
include/asterisk/res_pjsip.h
res/res_pjsip.c
res/res_pjsip/config_transport.c
res/res_pjsip_outbound_registration.c
res/res_pjsip_pubsub.c
res/res_pjsip_session.c