diff options
author | George Joseph <george.joseph@fairview5.com> | 2016-02-11 10:01:05 -0700 |
---|---|---|
committer | George Joseph <george.joseph@fairview5.com> | 2016-02-19 17:56:27 -0700 |
commit | d2a1457e0b4ecdd512fe58fdb55ecc07fd141bea (patch) | |
tree | db97ca4b365f3bd4bad2110c69a0e4ff9fe268a7 /include | |
parent | b4fdf93d06753c580b4ef7e34fe07670a8e4aff4 (diff) |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/res_pjsip.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/asterisk/res_pjsip.h b/include/asterisk/res_pjsip.h index bea469ffd..fc921c879 100644 --- a/include/asterisk/res_pjsip.h +++ b/include/asterisk/res_pjsip.h @@ -185,6 +185,8 @@ struct ast_sip_transport { unsigned int cos; /*! Write timeout */ int write_timeout; + /*! Allow reload */ + int allow_reload; }; #define SIP_SORCERY_DOMAIN_ALIAS_TYPE "domain_alias" @@ -2260,4 +2262,26 @@ struct ast_sip_transport_state *ast_sip_get_transport_state(const char *transpor */ struct ao2_container *ast_sip_get_transport_states(void); +/*! + * \brief Sets pjsip_tpselector from ast_sip_transport + * \since 13.8.0 + * + * \param transport The transport to be used + * \param selector The selector to be populated + * \retval 0 success + * \retval -1 failure + */ +int ast_sip_set_tpselector_from_transport(const struct ast_sip_transport *transport, pjsip_tpselector *selector); + +/*! + * \brief Sets pjsip_tpselector from ast_sip_transport + * \since 13.8.0 + * + * \param transport_name The name of the transport to be used + * \param selector The selector to be populated + * \retval 0 success + * \retval -1 failure + */ +int ast_sip_set_tpselector_from_transport_name(const char *transport_name, pjsip_tpselector *selector); + #endif /* _RES_PJSIP_H */ |