pbx.c: fix confused match caller id that deleted exten still in hash

This fixes a bug where a zero length callerid match adjacent to a no
match callerid extension entry would be deleted together, which then
resulted in hashtable references to free'd memory.  A third state of
the matchcid value has been added to indicate match to any extension
which allows enforcing comparison of matchcid on/off without errors.

(closes issue AST-1235)
Reported by: Guenther Kelleter
Review: https://reviewboard.asterisk.org/r/2930/
........

Merged revisions 401959 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 401960 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 401961 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@401962 f38db490-d61c-443f-a65b-d21fe96a405b
ARI recordings: Issue HTTP failures for recording requests with file conflicts

If a file already exists in the recordings directory with the same name as what
we would record, issue a 422 instead of relying on the internal failure and
issuing success.

(closes issue ASTERISK-22623)
Reported by: Joshua Colp
Review: https://reviewboard.asterisk.org/r/2922/
........

Merged revisions 401973 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@401999 f38db490-d61c-443f-a65b-d21fe96a405b
ARI: channel/bridge recording errors when invalid format specified

Asterisk will now issue 422 if recording is requested against channels
or bridges with an unknown format

(closes issue ASTERISK-22626)
Reported by: Joshua Colp
Review: https://reviewboard.asterisk.org/r/2939/
........

Merged revisions 402001 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@402002 f38db490-d61c-443f-a65b-d21fe96a405b
You'd think that new files would be free of whitespace issues.  But you would be wrong.
........

Merged revisions 402003 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@402004 f38db490-d61c-443f-a65b-d21fe96a405b
taskprocessor: Made use pthread_equal() to compare thread ids.

* Removed another silly use of RAII_VAR().  RAII_VAR() and SCOPED_LOCK()
are not silver bullets that allow you to turn off your brain.
........

Merged revisions 402044 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@402045 f38db490-d61c-443f-a65b-d21fe96a405b
rtp_engine: fix rtp payloads copy and improve argument names

In function ast_rtp_instance_early _bridge_make_compatible the
use of instance 0/1 as arguments doesn't clearly communicate a
direction that the copying of payloads from the source channel
to the destination channel will occur, making it more probable
to have the arguments to ast_rtp_codecs_payloads_copy() put in
the reverse order.  This patch renames the arguments with _dst
and _src suffixes and corrects the copy direction.

(closes issue ASTERISK-21464)
Reported by: Kevin Stewart
Review: https://reviewboard.asterisk.org/r/2894/
........

Merged revisions 402000 from http://svn.asterisk.org/svn/asterisk/branches/1.8
Test shows rtpmap:119 being copied per this change, but is not in sip invite
........

Merged revisions 402042 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 402043 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@402054 f38db490-d61c-443f-a65b-d21fe96a405b
res_stasis.c: Made use the ao2_container callback templates.

* Made res_stasis.c use the OBJ_SEARCH_XXX defines.
........

Merged revisions 402055 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@402056 f38db490-d61c-443f-a65b-d21fe96a405b
chan_pjsip: Fix a crash when direct media is enabled and an ACK is received after the channel is hung up.

(closes issue ASTERISK-22731)
Reported by: Kinsey Moore
........

Merged revisions 402064 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@402065 f38db490-d61c-443f-a65b-d21fe96a405b
Update Alembic database scripts for external scripting and PostgreSQL, Oracle

This patch does the following:
1) The env scripts have been updated to be tolerant of a NULL configuration
   file. This occurs when configuration is provided by an external script,
   such that the actual config.ini file is not used.
2) Enum types have all been given names. This is needed for PostgreSQL script
   generation.
3) The identifier meetme_confno_starttime_endtime is greater than 30
   characters, and hence invalid for Oracle databases. This has been truncated
   down to meetme_confno_start_end.
........

Merged revisions 400383 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@402073 f38db490-d61c-443f-a65b-d21fe96a405b