summaryrefslogtreecommitdiff
path: root/res/res_pjsip_outbound_publish.c
AgeCommit message (Collapse)Author
2017-12-12res_pjsip: Assign support levels to a few modulesSean Bright
Change-Id: I51f6945c4023cb93fc7b87be5ab4c50e9e6ee27d
2017-11-02Add missing menuselect dependencies.Corey Farrell
This adds menuselect dependencies for modules that use symbols of other modules. ASTERISK-27390 Change-Id: Ia2d2849f5b87a72af7324a82edc3f283eafb5385
2017-09-14res_pjsip: Filter out non SIP(S) requestsGeorge Joseph
Incoming requests with non sip(s) URIs in the Request, To, From or Contact URIs are now rejected with PJSIP_SC_UNSUPPORTED_URI_SCHEME (416). This is performed in pjsip_message_filter (formerly pjsip_message_ip_updater) and is done at pjproject's "TRANSPORT" layer before a request can even reach the distributor. URIs read by res_pjsip_outbound_publish from pjsip.conf are now also checked for both length and sip(s) scheme. Those URIs read by outbound registration and aor were already being checked for scheme but their error messages needed to be updated to include scheme failure as well as length failure. Change-Id: Ibb2f9f1d2dc7549da562af4cbd9156c44ffdd460
2017-04-12modules: change module LOAD_FAILUREs to LOAD_DECLINESGeorge Joseph
In all non-pbx modules, AST_MODULE_LOAD_FAILURE has been changed to AST_MODULE_LOAD_DECLINE. This prevents asterisk from exiting if a module can't be loaded. If the user wishes to retain the FAILURE behavior for a specific module, they can use the "require" or "preload-require" keyword in modules.conf. A new API was added to logger: ast_is_logger_initialized(). This allows asterisk.c/check_init() to print to the error log once the logger subsystem is ready instead of just to stdout. If something does fail before the logger is initialized, we now print to stderr instead of stdout. Change-Id: I5f4b50623d9b5a6cb7c5624a8c5c1274c13b2b25
2017-02-24config: Improve documentation and behavior of outbound_proxy option.Joshua Colp
This change updates the documentation for the outbound_proxy option to ensure it is consistently stated that a full SIP URI must be provided for the option. The res_pjsip_outbound_registration module has also been changed so that the provided outbound_proxy value is checked to ensure it is a URI and if not an error is output stating so. ASTERISK-26782 Change-Id: I6c239a32274846fd44e65b44ad9bf6373479b593
2017-02-21Merge "res_pjsip: Record the serializer earlier on the tdata." into 13zuul
2017-02-20res_pjsip: Update authentication realm documentation.Richard Mudgett
Using the same auth section for inbound and outbound authentication is not recommended. There is a difference in meaning for an empty realm setting between inbound and outbound authentication uses. An empty inbound auth realm represents the global section's default_realm value when the authentication object is used to challenge an incoming request. An empty outgoing auth realm is treated as a don't care wildcard when the authentication object is used to respond to an incoming authentication challenge. ASTERISK-26799 Change-Id: Id3952f7cfa1b6683b9954f2c5d2352d2f11059ce
2017-02-20res_pjsip: Record the serializer earlier on the tdata.Richard Mudgett
When PJPROJECT needs to do a DNS resolution and there is not a cached entry available, the SIP request message goes out on the PJSIP monitor thread instead of the original serializer thread. Thus when the response comes back it does not get processed by the original sending serializer. This patch records the serializer on tdata before passing a request message to PJPROJECT where it can in Asterisk code. There are several places in PJPROJECT for outbound registration and publishing support that would need to record the serializer. Unfortunately, without replacing the PJPROJECT DNS resolver as was done in v14 we cannot fix those without modifying PJPROJECT. Even if we backported the DNS resolver from v14, the outbound registration refresh timer does not go out on a serializer thread but the PJSIP monitor thread. Fortunately, Asterisk's outbound publish support doesn't use the auto refresh timer that would also not go out under the serializer thread. This patch is v13 only. ASTERISK-26669 ASTERISK-26738 Change-Id: I9997b9ed6dbcebd2c37d6a67dc6dcee9c78914a4
2016-08-04res_pjsip_outbound_publish: Use a serializer shutdown group for unload.Joshua Colp
This change replaces the custom unload process for the outbound publish module with the common serializer shutdown group. ASTERISK-25217 #close Change-Id: I280a0384d860c486202d87d2d674394cca77ffb6
2016-05-19Merge "res_pjsip_outbound_publishing: After unloading the library won't load ↵Joshua Colp
again" into 13
2016-05-19Merge "res_pjsip_outbound_publish: Ref leak in off nominal callback paths" ↵Joshua Colp
into 13
2016-05-19Merge "res_pjsip_outbound_publish: state potential dropped on ↵Joshua Colp
reloads/realtime fetches" into 13
2016-05-19Merge "res_pjsip_outbound_publish: Potential crash due to off nominal path" ↵Joshua Colp
into 13
2016-05-11res_pjsip_outbound_publish: state potential dropped on reloads/realtime fetchesKevin Harwell
When reloading, or fetching realtime data, if the "apply" failed for any numerous reasons the current state object would not be maintained. This potentially resulted in publishes being stopped for some states/clients when they should not have been. This patch makes it so the current state object is kept upon any type of reload/ fetch failures. Change-Id: Iab6020c116d628ed2ae81183e987e2eaa3c90b30
2016-05-11res_pjsip_outbound_publish: Potential crash due to off nominal pathKevin Harwell
It was possible for the explicit publish destroy function to be called without the pjsip client ever being initialized. This fix checks to make sure there is a client to destroy before attempting. Change-Id: I8eea1bfa3bd472149bfc255310be2a6248688f5c
2016-05-11res_pjsip_outbound_publishing: After unloading the library won't load againKevin Harwell
The same thing was happening in res_pjsip_publish_asterisk. When the library was unloaded it did not unregister the object type from sorcery. Subsequent loads resulted in a failed load due to the sorcery type already existing. Change-Id: Ifdc25e94e4cd40bc5a19eb4d0a00b86c2e9fedc9
2016-05-11res_pjsip_outbound_publish: Ref leak in off nominal callback pathsKevin Harwell
There were a few spots where the client object's reference was being leaked in sip_outbound_publish_callback. This patch cleans up those leaks. Change-Id: I485d0bc9335090f373026f77c548042e258461df
2016-05-11res_pjsip_outbound_publish: Won't unload if condition wait times outKevin Harwell
When res_pjsip_outbound_publish unloads it has to wait for all current publishing objects to get done. However if the wait condition times out then it does not fail the unload. This sometimes results in an infinite loop check while unloading. This patch now fails the unload operation if the condition times out. Change-Id: Id57b8cbed9d61222690fcba1e4f18e259df4c7ec
2016-04-28res_pjsip_outbound_publish.c: Remove redundant flag check.Richard Mudgett
Change-Id: I0da80a3c3e0eae0c52ff27e7412ba027d6f52353
2016-04-08res_pjsip_outbound_publish: Add transport for outbound PUBLISHAlexei Gradinari
The first available transport of the appropriate type is used now. This patch adds new config option 'transport' for outbound-publish. If transport is set then outbound PUBLISH requests will use this transport. ASTERISK-25901 #close Change-Id: Ib389130489b70e36795b0003fa5fd386e2680151
2016-02-18res_pjsip_outbound_publish: Fix processing 412 responseAlexei Gradinari
When Asterisk receives a 412 (Conditional Request Failed) response it has to recreate publish session. There is bug in res_pjsip_outbound_publish.c The function sip_outbound_publish_client_alloc is called with wrong object while processing 412 (Conditional Request Failed) response. This patch fixes it. ASTERISK-25229 #close Change-Id: I3b62f2debf6bb1e5817cde7b13ea39ef2bf14359
2015-01-30res_pjsip_outbound_publish: eventually crashes when no response is ever receivedKevin Harwell
When Asterisk attempts to send SIP outbound publish information and no response is ever received (no 200 okay, 412, 423) the system eventually crashes. A response is never received because the system Asterisk is attempting to send publish information to is not available. The underlying pjsip framework attempts to send publish information. After several attempts it calls back into the Asterisk outbound publish code. At this point if the "client->queue" is empty Asterisk attempts to schedule a refresh which utilizes "rdata" and since no response was received the given "rdata" struture is NULL. Attempting to dereference a NULL object of course results in a crash. The fix here removes the dependency on rdata for schedule_publish_refresh. Instead param->expiration is now passed to it as this is set to -1 if no response is received. Also added a notification when no response is received. ASTERISK-24635 #close Reported by: Marco Paland Review: https://reviewboard.asterisk.org/r/4384/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@431490 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-14Prevent slow graceful shutdown when outbound publications never started.Mark Michelson
The code was missing the case for explicitly destroying an outbound publication when Asterisk had never actually published anything. The result was that Asterisk would hang for a while on a graceful shutdown. With this change, the case is taken into account, and on a graceful shutdown, these publications are destroyed without the need to actually send a PUBLISH request. ASTERISK-24655 #close Reported by Kevin Harwell Review: https://reviewboard.asterisk.org/r/4325 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@430608 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-12Fix crash for sorcery misconfigsDavid M. Lee
res_pjsip_outbound_publish was missing the CHECK_PJSIP_MODULE_LOADED() call in load_module, and would crash with a segfault if res_pjsip declined to load. Review: https://reviewboard.asterisk.org/r/4258/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@429457 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-09res_pjsip_outbound_publish: stack overflow when using non-default sorcery wizardKevin Harwell
When using a non-default sorcery wizard (in this instance realtime) for outbound publishes Asterisk will crash after a stack overflow occurs due to the code infinitely recursing. The fix entails removing the outbound publish state dependency from the outbound publish sorcery object and instead keeping an in memory container that can be used to lookup the state when needed. ASTERISK-24514 #close Reported by: Mark Michelson Review: https://reviewboard.asterisk.org/r/4178/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@429175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-07res_pjsip_outbound_publish: Add module which provides outbound PUBLISH support.Joshua Colp
This module implements the core parts required for doing outbound PUBLISH. It takes care of configuration, lifetime management, and authentication. Additional modules implement the specific events that are published. Review: https://reviewboard.asterisk.org/r/3780/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420314 65c4cc65-6c06-0410-ace0-fbb531ad65f3