summaryrefslogtreecommitdiff
path: root/res/res_pjsip/pjsip_options.c
AgeCommit message (Collapse)Author
2014-10-06res_pjsip/pjsip_options: Do not 404 an OPTIONS request not sent to an endpointMatthew Jordan
An OPTIONS request that is sent to Asterisk but not to a specific endpoint is currently sent a 404 in response. This is because, not surprisingly, an empty extension is never going to be found in the dialplan. This patch makes it so that we only attempt to look up the endpoint in the dialplan if it is specified in the OPTIONS request URI. #SIPit31 ASTERISK-24370 #close Reported by: Matt Jordan ........ Merged revisions 424624 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 424625 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-24pjsip_options.c: Fix race condition stopping periodic out of dialog OPTIONS ↵Richard Mudgett
request. The crash on the issues is a result of an invalid transport configuration change when asterisk is restarted. The attempt to send the qualify request fails and we cleaned up. However, the callback is also called which results in a double unref of the objects involved. * Put a wrapper around pjsip_endpt_send_request() to detect when the passed in callback is called because of an error so callers can know to not cleanup. * Made send_request_cb() able to handle repeated challenges (Up to 10). * Fix periodic endpoint qualify OPTIONS sched deletion race by avoiding it. The sched entry will no longer self stop and must be externally stopped. * Added REF_DEBUG description tags to struct sched_data in pjsip_options.c. * Fix some off-nominal ref leaks in schedule_qualify(), qualify_and_schedule(). * Reordered pjsip_options.c module start/stop code to cleanup better on error. ASTERISK-24295 #close Reported by: Rogger Padilla Review: https://reviewboard.asterisk.org/r/3954/ ........ Merged revisions 423866 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 423867 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423868 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-18res_pjsip: ami: Fix error in AMI output when an endpoint has no transportGeorge Joseph
When no transport is associated to an endpoint, the AMI output for PJSIPShowEndpoint indicates an error instead of silently ignoring the missing transport. This patch causes the error to appear only if a transport was specified on the endpoint and the transport doesn't exist. It also fixes an issue with counting the objects that were actually found. ASTERISK-24161 #close ASTERISK-24331 #close Tested by: George Joseph Review: https://reviewboard.asterisk.org/r/3998/ ........ Merged revisions 423282 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 423284 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423285 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-28res/res_pjsip/pjsip_options.c: Eliminate excessive RAII_VAR usage.Richard Mudgett
* Fix off nominal ref leak in find_or_create_contact_status(). * Add missing NULL check of status in update_contact_status() and init_start_time(). ........ Merged revisions 422214 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 422215 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-01Add ContactStatusDetail to PJSIPShowEndpoint AMI output.Mark Michelson
Now when running PJSIPShowEndpoint, you will receive a ContactStatusDetail for each bound contact that Asterisk is qualifying. This information includes the URI of the contact, current reachability, and roundtrip time. AFS-91 #close Reported by Mark Michelson Review: https://reviewboard.asterisk.org/r/3797 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-17res_pjsip: Handle reloading when permanent contacts exist and qualify is ↵Joshua Colp
configured. This change fixes a problem where permanent contacts being qualified were not being updated. This was caused by the permanent contacts getting a uuid and not a known identifier, causing an inability to look them up when updating in the qualify code. A bug also existed where the new configuration may not be available immediately when updating qualifies. (closes issue ASTERISK-23514) Reported by: Richard Mudgett Review: https://reviewboard.asterisk.org/r/3448/ ........ Merged revisions 412551 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-25res_pjsip: Fix contact authenticate_qualify endpoint lookup when qualifing a ↵Richard Mudgett
contact. * Fixed bad use of ao2_find() in on_endpoint(). * Replaced use of find_endpoints() with find_an_endpoint() since only the first found endpoint is ever needed. * Fixed qualify_contact_cb() to update the contact with the aor authenticate_qualify setting. Otherwise, permanent contacts in the aor type sections would have a config line order dependancy. * Fixed off nominal path contact ref leak in qualify_contact(). The comment saying the unref is not needed was wrong. * Fixed off nominal path use of the endpoint parameter if it is NULL in send_out_of_dialog_request(). * Added missing off nominal path unref of pjsip tdata in send_out_of_dialog_request(). * Fixed off nominal path failing to call the callback in send_request_cb() when the request is challenged for authentication. * Eliminated silly RAII_VAR() use in qualify_contact_cb(). * Updated ast_sip_send_request() doxygen to better reflect reality. (closes issue ASTERISK-23254) Reported by: rmudgett Review: https://reviewboard.asterisk.org/r/3381/ ........ Merged revisions 411141 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-10AST-2014-003: res_pjsip: When handling 401/407 responses don't assume a ↵Joshua Colp
request will have an endpoint. This change removes the assumption that an outgoing request will always have an endpoint and makes the authenticate_qualify option work once again. (closes issue ASTERISK-23210) Reported by: Joshua Colp ........ Merged revisions 410306 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-06res_pjsip: Updates and adds more PJSIP CLI commands.Richard Mudgett
* Adds identify, transport, and registration support to the PJSIP CLI. * Creates three additional callbacks, one for an iterator, one for a comparator, and one for a container. This eliminates the link dependency from higher level modules to lower level ones. * Eliminates duplicate sorting in PJSIP CLI commands. * Cleans up PJSIP CLI output formatting. * Pushes CLI command registration down to the implementing source file. * Adds several ast_sip_destroy_sorcery functions to complement existing ast_sip_sorcery_initialize functions. The destroy functions unregister PJSIP CLI commands and PJSIP CLI formatters. Reported by: George Joseph Review: https://reviewboard.asterisk.org/r/3104/ ........ Merged revisions 407568 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-16res_pjsip: AOR option qualify_frequency not respected on startupKevin Harwell
If an endpoint had previously dynamically registered a contact and the contact information was successfully stored in astdb then upon restart the qualify notifications would not be sent out if the qualify_frequency was set. This was due to the fact that only permanent contacts were being checked and scheduled for qualifies on startup. Modified the code to check and schedule all registered contacts at startup. (closes issue ASTERISK-23062) Reported by: Rusty Newton Review: https://reviewboard.asterisk.org/r/3124/ ........ Merged revisions 405748 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-15PJSIP: Add Path header supportKinsey Moore
This adds Path support to chan_pjsip in res_pjsip_path.c with minimal additions in res_pjsip_registrar.c to store the path and additions in res_pjsip_outbound_registration.c to enable advertisement of path support to registrars and intervening proxies. Path information is stored on contacts and is enabled via Address of Record (AoRs) and Registration configuration sections. While adding path support, it became necessary to be able to add SIP supplements that handled messages outside of sessions, so a framework for handling these types of hooks was added in parallel to the already-existing session supplements and several senders of out-of-dialog requests were refactored as a result. (closes issue ASTERISK-21084) Review: https://reviewboard.asterisk.org/r/3050/ ........ Merged revisions 405565 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405566 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-14res_pjsip: Apply outbound proxy to all SIP requests.Joshua Colp
Objects which are involved in SIP request creation and sending now allow an outbound proxy to be specified. For cases where an endpoint is used the outbound proxy specified there will be applied. (closes issue ASTERISK-22673) Reported by: Antti Yrjola Review: https://reviewboard.asterisk.org/r/3022/ ........ Merged revisions 403811 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403812 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-03sorcery, bucket: Change observer remove calls to take const callbacks struct.Richard Mudgett
* Make ast_sorcery_observer_remove() accept a const callbacks struct. * Make ast_sorcery_observer_remove() tolerant of the sorcery parameter being NULL. Now it can be called within a module unload routine if the sorcery initialization fails. * Fix ast_sorcery_observer_add() to fail if the container link fails. ........ Merged revisions 403324 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-01res_pjsip_transport_websocket: Fix security events and simplify implementation.Joshua Colp
Transport type determination for security events has been simplified to use the type present on the message itself instead of searching through configured transports to find the transport used. The actual WebSocket transport has also been simplified. It now leverages the existing PJSIP transport manager for finding the active WebSocket transport for outgoing messages. This removes the need for res_pjsip_transport_websocket to store a mapping itself. (closes issue ASTERISK-22897) Reported by: Max E. Reyes Vera J. Review: https://reviewboard.asterisk.org/r/3036/ ........ Merged revisions 403256 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403257 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-08Push CLI qualify into the threadpool.Mark Michelson
If you run Asterisk in the background and then connect to it through a separate console, the thread that runs CLI commands is not registered with PJLIB. Thus PJLIB does not like it when you attempt to send OPTIONS requests from that thread. So now we push the task into the threadpool, which we know to be registered with PJLIB. Thanks to Antti Yrjola for reporting this. ........ Merged revisions 400680 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-23Update config framework/sorcery with types/options without documentationMatthew Jordan
There are times when a configuration option should not have documentation. 1. Some options are registered with a particular object merely as a warning to users. These options aren't even really 'deprecated' - which has its own separate API call - they are actually provided by a different configuration file. The options are merely registered so that the user gets a warning that a different configuration file provides the item. 2. Some object types - most notably some used by modules that use sorcery - are completely internal and should never be shown to the user. 3. Sorcery itself has several 'hidden' fields that should never be shown to a user. This patch updates the configuration framework and sorcery with additional API calls that allow a module to register types as internal and options as not requiring documentation. This bypasses the XML documentation checking. This patch also re-enables the strict XML documentation checking in trunk, as well as updates some documentation that was missing. Review: https://reviewboard.asterisk.org/r/2785/ (closes issue ASTERISK-22359) Reported by: Matt Jordan (closes issue ASTERISK-22112) Reported by: Rusty Newton git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397524 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-02Add CLI/AMI commands to force chan_pjsip actionsKinsey Moore
For chan_pjsip, this introduces CLI/AMI remote unregistration commands, reworks CLI syntax for sending NOTIFYs, adds AMI qualification support, and adds documentation for PJSIPNotify. This also fixes two refcounting bugs in the outbound registration code. Review: https://reviewboard.asterisk.org/r/2695/ (closes issue ASTERISK-21939) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396087 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-31Found another missed "sip" -> "pjsip" CLI command.Mark Michelson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395884 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-30The large GULP->PJSIP renaming effort.Mark Michelson
The general gist is to have a clear boundary between old SIP stuff and new SIP stuff by having the word "SIP" for old stuff and "PJSIP" for new stuff. Here's a brief rundown of the changes: * The word "Gulp" in dialstrings, functions, and CLI commands is now "PJSIP" * chan_gulp.c is now chan_pjsip.c * Function names in chan_gulp.c that were "gulp_*" are now "chan_pjsip_*" * All files that were "res_sip*" are now "res_pjsip*" * The "res_sip" directory is now "res_pjsip" * Files in the "res_pjsip" directory that began with "sip_*" are now "pjsip_*" * The configuration file is now "pjsip.conf" instead of "res_sip.conf" * The module info for all PJSIP-related files now uses "PJSIP" instead of "SIP" * CLI and AMI commands created by Asterisk's PJSIP modules now have "pjsip" as the starting word instead of "sip" git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395764 65c4cc65-6c06-0410-ace0-fbb531ad65f3