asterisk/configs/samples
George Joseph 4ebf9a938d res_pjsip: Add ability to identify by Authorization username
A feature of chan_sip that service providers relied upon was the ability to
identify by the Authorization username.  This is most often used when customers
have a PBX that needs to register rather than identify by IP address.  From my
own experiance, this is pretty common with small businesses who otherwise
don't need a static IP.

In this scenario, a register from the customer's PBX may succeed because From
will usually contain the PBXs account id but an INVITE will contain the caller
id.  With nothing recognizable in From, the service provider's Asterisk can
never match to an endpoint and the INVITE just stays unauthorized.

The fixes:

A new value "auth_username" has been added to endpoint/identify_by that
will use the username and digest fields in the Authorization header
instead of username and domain in the the From header to match an endpoint,
or the To header to match an aor.  This code as added to
res_pjsip_endpoint_identifier_user rather than creating a new module.

Although identify_by was always a comma-separated list, there was only
1 choice so order wasn't preserved.  So to keep the order, a vector was added
to the end of ast_sip_endpoint.  This is only used by res_pjsip_registrar
to find the aor.  The res_pjsip_endpoint_identifier_* modules are called in
globals/endpoint_identifier_order.

Along the way, the logic in res_pjsip_registrar was corrected to match
most-specific to least-specific as res_pjsip_endpoint_identifier_user does.

The order is:

username@domain
username@domain_alias
username

Auth by username does present 1 problem however, the first INVITE won't have
an Authorization header so the distributor, not finding a match on anything,
sends a securty_alert.  It still sends a 401 with a challenge so the next
INVITE will have the Authorization header and presumably succeed.  As a result
though, that first security alert is actually a false alarm.

To address this, a new feature has been added to pjsip_distributor that keeps
track of unidentified requests and only sends the security alert if a
configurable number of unidentified requests come from the same IP in a
configurable amout of time.  Those configuration options have been added to
the global config object.  This feature is only used when auth_username
is enabled.

Finally, default_realm was added to the globals object to replace the hard
coded "asterisk" used when an endpoint is not yet identified.

The testsuite tests all pass but new tests are forthcoming for this new
feature.

ASTERISK-25835 #close
Reported-by: Ross Beer

Change-Id: I30ba62d208e6f63439600916fcd1c08a365ed69d
2016-04-27 16:33:51 -05:00
..
acl.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
adsi.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
agents.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
alarmreceiver.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
alsa.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
amd.conf.sample app_amd: Correct maximum_number_of_words functionality & documentation 2015-12-21 16:02:09 -08:00
app_mysql.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
app_skel.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
ari.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
asterisk.adsi configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
asterisk.conf.sample Astobj2: Allow reference debugging to be enabled/disabled by config. 2015-04-27 18:37:26 -04:00
calendar.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
ccss.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
cdr.conf.sample cdr/cdr_csv.c: Add a new option to enable columns added in Asterisk 1.8 2015-05-03 09:50:25 -05:00
cdr_adaptive_odbc.conf.sample cdr_adaptive_odbc: Add ability to set character for quoted identifiers. 2015-05-05 04:38:33 -04:00
cdr_custom.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
cdr_manager.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
cdr_mysql.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
cdr_odbc.conf.sample cdr/cdr_odbc.c: Added to record new columns add on CDR 1.8 Asterisk Version 2015-04-27 09:38:15 -05:00
cdr_pgsql.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
cdr_sqlite3_custom.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
cdr_syslog.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
cdr_tds.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
cel.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
cel_custom.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
cel_odbc.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
cel_pgsql.conf.sample cel_pgsql: Add support for setting schema 2015-05-05 07:59:12 -04:00
cel_sqlite3_custom.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
cel_tds.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
chan_dahdi.conf.sample chan_dahdi: Improve force_restart_unavailable_chans option description. 2015-05-06 16:12:00 -05:00
chan_mobile.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
cli.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
cli_aliases.conf.sample Sample Configurations: make 'pjsip reload' reload all reloadable pjsip modules 2014-10-17 22:45:27 +00:00
cli_permissions.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
codecs.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
confbridge.conf.sample app_confbridge: Make non-admin users join a muted conference muted. 2016-01-27 16:46:20 -06:00
config_test.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
console.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
dbsep.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
dnsmgr.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
dsp.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
dundi.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
enum.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
extconfig.conf.sample app_queue: Add RealTime support for queue rules 2014-08-11 00:14:53 +00:00
extensions.ael.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
extensions.conf.sample ASTERISK-24419, fix incorrect syntax for setting language in extensions.conf.sample 2014-10-28 13:13:16 +00:00
extensions.lua.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
extensions_minivm.conf.sample Git Conversion: Switch Non-C files to ASTERISK_REGISTER_FILE. 2015-04-29 01:02:10 -04:00
features.conf.sample Update version number in features.conf.sample 2016-01-16 20:02:43 +00:00
festival.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
followme.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
func_odbc.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
hep.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
http.conf.sample AST-2016-001 http: Provide greater control of TLS and set modern defaults. 2016-02-03 15:10:16 -06:00
iax.conf.sample channels/chan_iax2: Add a configuration parameter for call token expiration 2015-04-10 12:23:42 +00:00
iaxprov.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
indications.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
logger.conf.sample main/logger: Add log formatters and JSON structured logs 2015-09-29 07:28:01 -05:00
manager.conf.sample ASTERISK-23512, correct inaccurate comment in manager.conf.sample 2014-10-28 18:09:32 +00:00
meetme.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
mgcp.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
minivm.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
misdn.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
modules.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
motif.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
musiconhold.conf.sample musiconhold: Add preferchannelclass=no option to prefer app class. 2014-09-25 20:49:04 +00:00
muted.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
ooh323.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
osp.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
oss.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
phone.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
phoneprov.conf.sample res_phoneprov: Refactor phoneprov to allow pluggable config providers 2014-10-09 17:46:23 +00:00
pjproject.conf.sample res_pjproject: Add ability to map pjproject log levels to Asterisk log levels 2016-02-18 16:30:29 -06:00
pjsip.conf.sample res_pjsip: Add ability to identify by Authorization username 2016-04-27 16:33:51 -05:00
pjsip_notify.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
pjsip_wizard.conf.sample res_pjsip_config_wizard: Add ability to auto-create hints. 2015-02-10 23:17:17 +00:00
queuerules.conf.sample app_queue: Add RealTime support for queue rules 2014-08-11 00:14:53 +00:00
queues.conf.sample app_queue: Update sample conf documenation 2014-12-24 21:28:14 +00:00
res_config_mysql.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
res_config_sqlite.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
res_config_sqlite3.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
res_corosync.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
res_curl.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
res_fax.conf.sample res_fax: Add T.38 negotiation timeout option 2015-01-09 14:53:09 +00:00
res_ldap.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
res_odbc.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
res_parking.conf.sample res_parking: Update parking documentation for dynamic parking lots. 2016-03-25 18:25:47 -05:00
res_pgsql.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
res_pktccops.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
res_snmp.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
res_stun_monitor.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
resolver_unbound.conf.sample dns: Add core DNS API + unit tests and res_resolver_unbound module + unit tests. 2015-03-25 12:32:26 +00:00
rtp.conf.sample res_rtp_asterisk: Allow ICE host candidates to be overriden 2016-02-03 17:06:20 -06:00
say.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
sip.conf.sample Remove reference to non-existent sip.conf option 2016-04-22 13:12:29 -05:00
sip_notify.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
skinny.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
sla.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
smdi.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
sorcery.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
ss7.timers.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
stasis.conf.sample main/stasis: Allow subscriptions to use a threadpool for message delivery 2014-12-01 17:59:21 +00:00
statsd.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
telcordia-1.adsi configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
test_sorcery.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
udptl.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
unistim.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
users.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
voicemail.conf.sample app_voicemail: Add the ability to specify multiple email addresses. 2014-08-08 19:16:29 +00:00
vpb.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00
xmpp.conf.sample configs: Move sample config files into a subdirectory of configs 2014-07-17 21:17:28 +00:00