summaryrefslogtreecommitdiff
path: root/res/res_pjsip
AgeCommit message (Collapse)Author
2018-02-28pjproject: Add cache_pools debugging option.Richard Mudgett
The pool cache gets in the way of finding use after free errors of memory pool contents. Tools like valgrind and MALLOC_DEBUG don't know when a pool is released because it gets put into the cache instead of being freed. * Added the "cache_pools" option to pjproject.conf. Disabling the option helps track down pool content mismanagement when using valgrind or MALLOC_DEBUG. The cache gets in the way of determining if the pool contents are used after free and who freed it. To disable the pool caching simply disable the cache_pools option in pjproject.conf and restart Asterisk. Sample pjproject.conf setting: [startup] cache_pools=no * Made current users of the caching pool factory initialization and destruction calls call common routines to create and destroy cached pools. ASTERISK-27704 Change-Id: I64d5befbaeed2532f93aa027a51eb52347d2b828
2018-02-21AST-2018-005: res_pjsip_transport_management: Move to coreGeorge Joseph
Since res_pjsip_transport_management provides several attack mitigation features, its functionality moved to res_pjsip and this module has been removed. This way the features will always be available if res_pjsip is loaded. ASTERISK-27618 Reported By: Sandro Gauci Change-Id: I21a2d33d9dda001452ea040d350d7a075f9acf0d
2018-02-21AST-2018-005: Fix tdata leaks when calling pjsip_endpt_send_response(2)George Joseph
pjsip_distributor: authenticate() creates a tdata and uses it to send a challenge or failure response. When pjsip_endpt_send_response2() succeeds, it automatically decrements the tdata ref count but when it fails, it doesn't. Since we weren't checking for a return status, we weren't decrementing the count ourselves on error and were therefore leaking tdatas. res_pjsip_session: session_reinvite_on_rx_request wasn't decrementing the ref count if an error happened while sending a 491 response. pre_session_setup wasn't decrementing the ref count if while sending an error after a pjsip_inv_verify_request failure. res_pjsip: ast_sip_send_response wasn't decrementing the ref count on error. ASTERISK-27618 Reported By: Sandro Gauci Change-Id: Iab33a6c7b6fba96148ed465b690ba8534ac961bf
2018-02-16res_pjsip: Endpoint destruction does not free DTLS configurationSean Bright
ASTERISK-27679 #close Reported by: Mak Dee Change-Id: I89a2783a11be0763bf123d1619ed176b6225cf42
2018-02-02res_pjsip/config_domain_aliases.c: Add check for missing domain.Richard Mudgett
What is the point of defining an alias and not saying what is being aliased? Change-Id: I98a892016ed61dcf5efeb6619fd748925103f0be
2018-01-30res_pjsip_pubsub: Prune subs with reliable transports at startupGeorge Joseph
In an earlier release, inbound registrations on a reliable transport were pruned on Asterisk restart since the TCP connection would have been torn down and become unusable when Asterisk stopped. This same process is now also applied to inbound subscriptions. Also fixed issues in res_pjsip_registrar where it wasn't handling the monitoring correctly when multiple registrations came in over the same transport. To accomplish this, the pjsip_transport_event feature needed to be refactored to allow multiple monitors (multiple subcriptions or registrations from the same endpoint) to exist on the same transport. Since this changed the API, any external modules that may have used the transport monitor feature (highly unlikey) will need to be changed. ASTERISK-27612 Reported by: Ross Beer Change-Id: Iee87cf4eb9b7b2b93d5739a72af52d6ca8fbbe36
2018-01-29Merge "Remove redundant module checks and references."Jenkins2
2018-01-26Merge "Add missing OPTIONAL_API and ARI dependences."Jenkins2
2018-01-24Remove redundant module checks and references.Corey Farrell
This removes references that are no longer needed due to automatic references created by module dependencies. In addition this removes most calls to ast_module_check as they were checking modules which are listed as dependencies. Change-Id: I332a6e8383d4c72c8e89d988a184ab8320c4872e
2018-01-24Merge "res_pjsip: Add AMI action 'PJSIPShowContacts'"Jenkins2
2018-01-23res_pjsip: Add AMI action 'PJSIPShowContacts'Sungtae Kim
Add an AMI action which provides information on all configured Contacts. ASTERISK-27581 Change-Id: I2eed42c74bbc725fad26b8b33b1a5b3161950c73
2018-01-22Add missing OPTIONAL_API and ARI dependences.Corey Farrell
I've audited all modules that include any header which includes asterisk/optional_api.h. All modules which use OPTIONAL_API now declare those dependencies in AST_MODULE_INFO using requires or optional_modules as appropriate. In addition ARI dependency declarations have been reworked. Instead of declaring additional required modules in res/ari/resource_*.c we now add them to an optional array "requiresModules" in api-docs for each module. This allows the AST_MODULE_INFO dependencies to include those missing modules. Change-Id: Ia0c70571f5566784f63605e78e1ceccb4f79c606
2018-01-16res_pjsip: Split type=identify to IP address and SIP header matching prioritiesRichard Mudgett
The type=identify endpoint identification method can match by IP address and by SIP header. However, the SIP header matching has limited usefulness because you cannot specify the SIP header matching priority relative to the IP address matching. All the matching happens at the same priority and the order of evaluating the identify sections is indeterminate. e.g., If you had two type=identify sections where one matches by IP address for endpoint alice and the other matches by SIP header for endpoint bob then you couldn't predict which endpoint is matched when a request comes in that matches both. * Extract the SIP header matching criteria into its own "header" endpoint identification method so the user can specify the relative priority of the SIP header and the IP address matching criteria in the global endpoint_identifier_order option. The "ip" endpoint identification method now only matches by IP address. ASTERISK-27491 Change-Id: I9df142a575b7e1e3471b7cda5d3ea156cef08095
2018-01-13config_transport: Enable TCP_NODELAY on TLS transportsGeorge Joseph
We did this for TCP transports already but I'm not sure why we didn't do it for TLS transports. ASTERISK_27474 #not_final_fix Change-Id: I5b1ef4b882f7b859e718236686b7898751dbb262
2018-01-11Merge "res_pjsip.c: Fix ident_to_str() and refactor ident_handler()."Joshua Colp
2018-01-09res_pjsip.c: Fix ident_to_str() and refactor ident_handler().Richard Mudgett
* Extracted sip_endpoint_identifier_type2str() and sip_endpoint_identifier_str2type() to simplify the calling functions. * Fixed pjsip_configuration.c:ident_to_str() building the endpoint's identify_by value string. Change-Id: Ide876768a8d5d828b12052e2a75008b0563fc509
2018-01-08res_pjsip: Add AMI action 'PJSIPShowAuths'Sungtae Kim
Add an AMI action which provides information on all configured Auths. ASTERISK-27547 Change-Id: I1a88a75b38a2b1dd9d1de6c0307b20a3f584c817
2018-01-02res_pjsip: Add AMI action 'PJSIPShowAors'Sungtae Kim
Add an AMI action which provides information on all configured AORs. ASTERISK-27537 Change-Id: If8b990a00909e5b6c0f04a3b8dccd9903dc445eb
2017-12-22AST-2017-014: res_pjsip - Missing contact header can cause crashKevin Harwell
Those SIP messages that create dialogs require a contact header to be present. If the contact header was missing from the message it could cause Asterisk to crash. This patch checks to make sure SIP messages that create a dialog contain the contact header. If the message does not and it is required Asterisk now returns a "400 Missing Contact header" response. Also added NULL checks when retrieving the contact header that were missing as a "just in case". ASTERISK-27480 #close Change-Id: I1810db87683fc637a9e3e1384a746037fec20afe
2017-12-22Remove as much trailing whitespace as possible.Sean Bright
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2017-12-20Fix Common Typo's.Corey Farrell
Fix instances of: * Retreive * Recieve * other then * different then * Repeated words ("the the", "an an", "and and", etc). * othterwise, teh ASTERISK-24198 #close Change-Id: I3809a9c113b92fd9d0d9f9bac98e9c66dc8b2d31
2017-12-15Merge "pjsip_options: wrongly applied "UNKNOWN" status"Jenkins2
2017-12-13Merge "pjsip_options: contacts sometimes not being updated on reload"Kevin Harwell
2017-12-13Merge "pjsip_options: dynamic contact's fields not updated on reload"Jenkins2
2017-12-12res_pjsip: Add TLSv1.1 and TLSv1.2 supportSean Bright
Support for these protocols was added in the same commit as the 'proto' field, so we can safely use the same ./configure check. For reference: https://trac.pjsip.org/repos/changeset/4968 Change-Id: Icf4975d785d6bfb8f30ac7ffa695a0adf9382dac
2017-12-11pjsip_options: wrongly applied "UNKNOWN" statusKevin Harwell
A couple of places were setting the status to "UNKNOWN" when qualifies were being disabled. Instead this should be set to the "CREATED" status that represents when a contact is given (uri available), but the qualify frequency is set to zero so we don't know the status. This patch updates the relevant places with "CREATED". It also updates the "CREATED" status description (value shown in CLI/AMI/ARI output) to a value of "NonQualified"/"NonQual" as this description is hopefully less confusing. ASTERISK-27467 Change-Id: Id67509d25df92a72eb3683720ad2a95a27b50c89
2017-12-11Merge "pjsip: Improve CLI completion performance"Jenkins2
2017-12-10pjsip: Improve CLI completion performanceSean Bright
Use the new ast_cli_completion_add() function to improve completion performance for commands like 'pjsip show endpoint.' Change-Id: I76d802294d2ac1766110dc75f7d117c8541ce348
2017-12-08pjsip_configuration: Add correct file headerSean Bright
Change-Id: I25348c386a222bb704aff07f54375108a6402906
2017-12-07pjsip_options: contacts sometimes not being updated on reloadKevin Harwell
For both dynamic and static contacts it was possible that potential AOR changes were not being applied to all contacts. This was because the qualify and schedule code was only retrieving AOR's, and contacts with frequencies greater than zero. For instance the following could happen: and AOR/contact has a frequency of 5, it then gets set to 0, and then a reload occurs. All scheduled OPTIONS are stopped, a list of AOR's is retrieved with frequency > 0, but none are selected since in this scenario all are 0. The contact for the one previously set to 5 though does not get updated, so it's status remains "AVAILABLE". This patch makes it so all contacts (static and dynamic) are selected, and appropriately updated if need be. ASTERISK-27467 #close Change-Id: I7a920170f89c683af9505d4723a44fc6841decdb
2017-12-07pjsip_options: dynamic contact's fields not updated on reloadKevin Harwell
Dynamic contacts were not being properly updated on reload. As a matter of fact any changes to the AOR that a dynamic contact was associated with were not being applied. On reload, this patch makes it so for each dynamic contact, the associated AOR is now retrieved and the AOR's fields are applied to the contact. ASTERISK-27467 Change-Id: I8e3165dc6a745218c1c9db837f77fafa0516985d
2017-12-04security-events: Fix SuccessfulAuth using_password declaration.Richard Mudgett
The SuccessfulAuth using_password field was declared as a pointer to a uint32_t when the field was later read as a uint32_t value. This resulted in unnecessary casts and a non-portable field value reinterpret in main/security_events.c:add_json_object(). i.e., It would work on a 32 bit architecture but not on a 64 bit big endian architecture. Change-Id: Ia08bc797613a62f07e5473425f9ccd8d77c80935
2017-11-20Merge "res_pjsip: Use sorcery prefix operation for contact lookup"Joshua Colp
2017-11-19res_pjsip: Fix warning by deferring implicit type cast.Corey Farrell
Mac doesn't like the comparison of -1 to an enum, so store the result of ast_sip_str_to_dtmf to an int so we can check for the negative return value. ast_sip_str_to_dtmf returns an int so this is only delaying the implicit type cast. Change-Id: I0c262c1719ee951aae1f437d733a301cf5f8ad29
2017-11-16res_pjsip: Use sorcery prefix operation for contact lookupSean Bright
This improves performance for registrations assuming that res_config_astdb is not in use. Change-Id: I86f37aa9ef07a4fe63448cb881bbadd996834bb1
2017-11-07Merge "res_pjsip: Fix leak on error in ast_sip_auth_vector_init."Jenkins2
2017-11-07Merge "res_pjsip: Avoid crash when contact uri is empty string"Jenkins2
2017-11-07Merge "res_pjsip: Ignore empty TLS configuration"Jenkins2
2017-11-07res_pjsip: Avoid crash when contact uri is empty stringAaron An
Asterisk will crash if contact uri is invalid, so contact_apply_handler should check if the uri is NULL or empty. ASTERISK-27393 #close Reported-by: Aaron An Tested-by: AaronAn Change-Id: Ia0309bdc6b697c73c9c736e1caec910b77ca69f5
2017-11-06res_pjsip: Fix leak on error in ast_sip_auth_vector_init.Corey Farrell
Change-Id: Ib0fc7a18f3135ca8990c3984c9e15f6d26e556e8
2017-11-06Merge "dtls: Add support for ephemeral DTLS certificates."Joshua Colp
2017-11-06res_pjsip: Ignore empty TLS configurationSean Bright
When using realtime, fields that are not explicitly set by an administrator are still presented to sorcery as empty strings. Handle this case explicitly. In this particular case, if any of these fields are required for TLS support, their existence should be validated in the 'apply' handler once we have a complete transport definition. ASTERISK-27032 #close Reported by: seanchann.zhou Change-Id: Ie3b5fb421977ccdb33e415d4ec52c3fd192601b7
2017-11-06dtls: Add support for ephemeral DTLS certificates.Sean Bright
This mimics the behavior of Chrome and Firefox and creates an ephemeral X.509 certificate for each DTLS session. Currently, the only supported key type is ECDSA because of its faster generation time, but other key types can be added in the future as necessary. ASTERISK-27395 Change-Id: I5122e5f4b83c6320cc17407a187fcf491daf30b4
2017-11-02res_pjsip: Add to list of valid characters for from_user.Ben Ford
Fixes a regression where some characters were unable to be used in the from_user field of an endpoint. Additionally, the backtick was removed from the list of valid characters, since it is not valid, and it was replaced with a single quote, which is a valid character. ASTERISK-27387 Change-Id: Id80c10a644508365c87b3182e99ea49da11b0281
2017-11-01pjsip_message_filter: Only do interface lookup for wildcard addresses.Sean Bright
Change-Id: Ie083987e69dc43b6861671c218cacacc11b2072f
2017-10-25res_pjsip: Add 'ip' as a valid option to 'identify_by' on endpoint.Joshua Colp
When the identify_by option on an endpoint is set to ip it will only be identified using the res_pjsip_endpoint_identifier_ip module. This ensures that it is not mistakenly matched using the username of the From header. To ensure behavior has not changed the default has been changed to "username,ip" for the identify_by option. ASTERISK-27206 Change-Id: I2170b86a7f7e221b4f00bf14aa1ef1ac5b050bbd
2017-10-10Merge "res_pjsip: Add REF_DEBUG info to module references."Jenkins2
2017-10-09Merge "res_pjsip: Fix issues that prevented shutdown of modules."Jenkins2
2017-10-06res_pjsip: Fix leak of persistent endpoint references.Corey Farrell
Do not manually call sip_endpoint_apply_handler from load_all_endpoints. This is not necessary and causes memory leaks. Additionally reinitialize persistent->aors when we reuse a persistent object with a new endpoint. ASTERISK-27306 Change-Id: I59bbfc8da8a14d5f4af8c5bb1e71f8592ae823eb
2017-10-06res_pjsip: Fix leak of fake_auth references.Corey Farrell
pjsip_distributor leaks references to fake_auth when the default realm has not changed. ASTERISK-27306 Change-Id: I3fcf103b3680ad2d1d4610dcd6738eeaebf4d202