Commit Graph

29956 Commits

Author SHA1 Message Date
Richard Mudgett
2eea087401 cdr.c: Defer getting ao2_global_obj_ref() until needed.
The CDR performance gets worse the further it gets behind in processing
stasis messages.  One of the reasons is we were getting the global config
even if we didn't need it.

* Most uses of the global config were only needed on off nominal code
paths so it makes sense to not get it until absolutely needed.

ASTERISK-27335

Change-Id: I00c63b7ec233e5bfffd5d976f05568613d3c2365
2017-10-12 19:12:07 -05:00
Richard Mudgett
7c7a917874 cdr.c: Set stringfields only if they are different.
The CDR performance gets worse the further it gets behind in processing
stasis messages.  One of the reasons is we were repeatedly setting string
fields to potentially the same string in base_process_party_a().  Setting
a string field involves allocating room for the new string out of a memory
pool which may have to allocate even more memory.

* Check to see if the string field is already set to the desired string.

ASTERISK-27335

Change-Id: I3ccb7e23f1488417e08cafe477755033eed65a7c
2017-10-12 19:12:07 -05:00
Richard Mudgett
c80c8f2ab9 cdr.c: Fix setting dnid, callingsubaddr, and calledsubaddr
The string comparisons for setting these CDR variables was inverted.  We
were repeatedly setting these CDR variables only if the channel snapshots
had the same value.

ASTERISK-27335

Change-Id: I9482073524411e7ea6c03805b16de200cb1669ea
2017-10-12 19:12:07 -05:00
Jenkins2
acf686e6a5 Merge "res_pjsip_session: Prevent user=phone being added to anonimized URIs." 2017-10-12 12:51:03 -05:00
Jenkins2
6058b1ef3e Merge "sorcery: Use ao2_weakproxy to hold list of instances." 2017-10-12 11:25:12 -05:00
Daniel Tryba
6576e4320a res_pjsip_session: Prevent user=phone being added to anonimized URIs.
Move ast_sip_add_usereqphone to be called after anonymization of URIs,
to prevent the user_eq_phone adding "user=phone" to URIs containing a
username that is not a phonenumber (RFC3261 19.1.1). An extra call to
ast_sip_add_usereqphone on the saved version before anonymization is
added to add user=phone" to the PAI.

ASTERISK-27047 #close

Change-Id: Ie5644bc66341b86dc08b1f7442210de2e6acdec6
2017-10-12 11:06:09 -05:00
Jenkins2
0b1b5849ce Merge "named_locks: Use ao2_weakproxy_find." 2017-10-12 10:16:45 -05:00
Jenkins2
b94f2343a6 Merge "astobj2: Add ao2_weakproxy_find function." 2017-10-12 09:26:29 -05:00
Jenkins2
3affeac39d Merge "astobj2: Run weakproxy callbacks outside of lock." 2017-10-12 09:02:47 -05:00
Joshua Colp
620b402974 Merge "cdr.c: Defer misc checks." 2017-10-12 08:02:36 -05:00
Jenkins2
292cda4ee7 Merge "res_pjsip: Prevent "user=phone" being added multiple times to header" 2017-10-12 07:03:59 -05:00
Jenkins2
c7c5f5a66c Merge "cdr_mysql: avoid releasing a config string" 2017-10-11 19:12:56 -05:00
Joshua Colp
f9e7793411 Merge "chan_vpb: Fix a gcc 7 out-of-bounds complaint" 2017-10-11 17:06:17 -05:00
Joshua Colp
0bedd436dc Merge "app_originate: Set ORIGINATE_STATUS correctly on failure" 2017-10-11 16:03:21 -05:00
Daniel Tryba
a56316423f res_pjsip: Prevent "user=phone" being added multiple times to header
ast_sip_add_usereqphone adds "user=phone" to the header every time is is
called without checking whether the param already exists. Preventing
this by searching to string representation of header for "user=phone".

ASTERISK-26988 #close

Change-Id: Ib84383b07254de357dc6a98d91fc1d2c2c3719e6
2017-10-11 15:36:28 -05:00
Richard Mudgett
e5b9eb0460 cdr.c: Defer misc checks.
Try to defer some checks until needed in case there is an early exit.

Change-Id: Ibc6b34c38a4f60ad4f9b67984b7d070a07257064
2017-10-11 13:28:51 -05:00
Jenkins2
45756b490e Merge "cdr.c: Eliminated simple RAII_VAR usages." 2017-10-11 12:04:09 -05:00
Jenkins2
9b1bc73db5 Merge "ari/bridge: Add mute, dtmf suppression controls" 2017-10-11 11:34:08 -05:00
Jenkins2
832efb4a41 Merge "app_queue.c: clear moh field in init_queue" 2017-10-11 11:30:46 -05:00
Seán C McCord
e8bde6916a ari/bridge: Add mute, dtmf suppression controls
Add bridge_features structure to bridge creation.  Specifically, this
implements mute and DTMF suppression, but others should be able to be
easily added to the same structure.

ASTERISK-27322 #close
Reported by: Darren Sessions
Sponsored by: AVOXI

Change-Id: Id4002adfb65c9a8027ee9e1a5f477e0f01cf9d61
2017-10-11 08:23:05 -04:00
George Joseph
ab4d36533c chan_vpb: Fix a gcc 7 out-of-bounds complaint
chan_vpb was trying to use sizeof(*p->play_dtmf), where
p->play_dtmf is defined as char[16], to get the length of the array
but since p->play_dtmf is an actual array, sizeof(*p->play_dtmf)
returns the size of the first array element, which is 1.  gcc7
validly complains because the context in which it's used could
cause an out-of-bounds condition.

Change-Id: If9c4bfdb6b02fa72d39e0c09bf88900663c000ba
2017-10-11 07:10:45 -05:00
Jenkins2
1505c1bb09 Merge "res_pjsip_registrar.c: Update remove_existing AOR contact handling." 2017-10-11 06:49:54 -05:00
Nathan Bruning
be7da57546 app_queue.c: clear moh field in init_queue
ASTERISK-27301 #close

Change-Id: Ic31361f34e2de3b6470e68fc37205a7711082eba
2017-10-11 05:34:45 -05:00
Corey Farrell
b8dadccbe1 sorcery: Use ao2_weakproxy to hold list of instances.
* Store weak proxy objects in instances container.
* Remove special unreference function and replace with macro that calls
ao2_cleanup.
* Add REF_DEBUG information to ast_sorcery_open.

Change-Id: I5a150a4e13cee319d46b5a4654f95a4623a978f8
2017-10-10 20:47:49 -04:00
Corey Farrell
7774623804 named_locks: Use ao2_weakproxy_find.
Change-Id: I0ce8a1b7101b6caac6a19f83a89f00eaba1e9d9c
2017-10-10 20:15:31 -04:00
Corey Farrell
b058f8673a astobj2: Add ao2_weakproxy_find function.
This function finds a weak proxy in an ao2_container and returns the
real object associated with it.

Change-Id: I9da822049747275f5961b5c0a7f14e87157d65d8
2017-10-10 20:15:25 -04:00
Corey Farrell
fd3101e8ad astobj2: Run weakproxy callbacks outside of lock.
Copy the list of weakproxy callbacks to temporary memory so they can be
run without holding the weakproxy lock.

Change-Id: Ib167622a8a0f873fd73938f7611b2a5914308047
2017-10-10 18:23:00 -04:00
Jenkins2
65366a435e Merge "contrib/thirdparty/sip_to_pjsip: add additional flag mappings" 2017-10-10 12:51:42 -05:00
Sean Bright
3ad7d2f36c app_originate: Set ORIGINATE_STATUS correctly on failure
We were ignoring the return value from ast_pbx_outgoing_exten() and
ast_pbx_outgoing_app() which could fail before setting the reason code.
This resulted in failures being reported as success.

ASTERISK-25266 #close
Reported by: Allen Ford

Change-Id: Idf16237b7e41b527d2c69c865829128686beeb3b
2017-10-10 12:32:25 -05:00
Jenkins2
6fc222a1d2 Merge "res_pjsip: Add REF_DEBUG info to module references." 2017-10-10 12:28:13 -05:00
Torrey Searle
b1d9fc87bc contrib/thirdparty/sip_to_pjsip: add additional flag mappings
add mappings for udptl redundancy, rtptimeout, and debug flags

Change-Id: Ie73cf5c83c05dee01eb9624ede76c1a30225d73a
2017-10-10 10:50:24 -05:00
Richard Mudgett
b0408d05c0 cdr.c: Eliminated simple RAII_VAR usages.
Change-Id: I150505db307249a962987e7b941bdd369bb91f35
2017-10-10 09:59:30 -05:00
Tzafrir Cohen
11cefdf621 cdr_mysql: avoid releasing a config string
Fixes a memory corruption issue after a reload of cdr_mysql.

Issue was accidentally included in 747beb1ed1 .

ASTERISK-27270 #close

Change-Id: I90b6a9d18710c0f9009466370bd5f4bac5d5d12e
2017-10-10 17:52:20 +03:00
Jenkins2
f006310bd1 Merge "res_pjproject: Fix cleanup of buildopts vector." 2017-10-10 08:12:25 -05:00
Joshua Colp
49e6356620 Merge "tcptls: Do not re-bind to wildcard on client creation." 2017-10-10 07:53:04 -05:00
Corey Farrell
fae09c6676 res_pjproject: Fix cleanup of buildopts vector.
ASTERISK-27306

Change-Id: I3bed0edf3f55b1d4adcbabb25ec14f11dc766c72
2017-10-09 23:51:03 -04:00
Jenkins2
7d9fa0bea4 Merge "cdr.c: Replace redundant check with an ast_assert()" 2017-10-09 20:04:33 -05:00
Jenkins2
7002705940 Merge "cdr.h: Fix doxygen comments." 2017-10-09 19:01:19 -05:00
Joshua Colp
37297d2c0e Merge "cdr.c: Use current ao2 flag names" 2017-10-09 18:08:26 -05:00
Jenkins2
89859f33b2 Merge "res_pjsip: Fix issues that prevented shutdown of modules." 2017-10-09 17:29:26 -05:00
Jenkins2
a152824798 Merge "cdr.c: Replace inlined code with ao2_t_replace()" 2017-10-09 16:52:29 -05:00
Jenkins2
b877181cd9 Merge "res_pjsip_session: Fix format_cap leak." 2017-10-09 16:23:01 -05:00
Jenkins2
71c3565708 Merge "res_config_sqlite: Don't enable SQLite CDRs when running 'make samples'" 2017-10-09 16:20:55 -05:00
Jenkins2
4914311150 Merge "res_pjsip: Fix leak of persistent endpoint references." 2017-10-09 15:24:49 -05:00
Richard Mudgett
fdf9aacca3 cdr.c: Replace redundant check with an ast_assert()
The only caller of cdr_object_fn_table.process_party_b() explicitly does
the check before calling.

Change-Id: Ib0c53cdf5048227842846e0df9d2c19117c45618
2017-10-09 13:34:32 -05:00
Richard Mudgett
2e4b5fadbd cdr.c: Replace inlined code with ao2_t_replace()
Change-Id: I9f424f5282ca7d833592f958d95f1b2bafb549b0
2017-10-09 13:30:16 -05:00
Richard Mudgett
62980eedc3 cdr.c: Use current ao2 flag names
Change-Id: Ib59d7d2f2a4a822754628f2c48a308d6791a6e6e
2017-10-09 13:28:04 -05:00
Richard Mudgett
e769846f11 cdr.h: Fix doxygen comments.
* Also some misc formatting in cdr.c.

Change-Id: Ied89a28802a662c37c43326a1aafdce596e0df4a
2017-10-09 13:25:45 -05:00
Richard Mudgett
fb19799b62 res_pjsip_registrar.c: Update remove_existing AOR contact handling.
When "rewrite_contact" is enabled, the "max_contacts" count option can
block re-registrations because the source port from the endpoint can be
random.  When the re-registration is blocked, the endpoint may give up
re-registering and require manual intervention.

* The "remove_existing" option now allows a registration to succeed by
displacing any existing contacts that now exceed the "max_contacts" count.
Any removed contacts are the next to expire.  The behaviour change is
beneficial when "rewrite_contact" is enabled and "max_contacts" is greater
than one.  The removed contact is likely the old contact created by
"rewrite_contact" that the device is refreshing.

ASTERISK-27192

Change-Id: I64c107a10b70db1697d17136051ae6bf22b5314b
2017-10-09 12:52:30 -05:00
Jenkins2
13c1c72401 Merge "res_sdp_translator_pjmedia: Fix test unregistration." 2017-10-09 12:10:34 -05:00