Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 49667) +++ channels/chan_sip.c (working copy) @@ -555,6 +555,7 @@ static char global_realm[MAXHOSTNAMELEN]; /*!< Default realm */ static char global_regcontext[AST_MAX_CONTEXT]; /*!< Context for auto-extensions */ static char global_useragent[AST_MAX_EXTENSION]; /*!< Useragent for the SIP channel */ +static char global_auth_secret[80]; /*!< Default authentication scheme */ static int allow_external_domains; /*!< Accept calls to external SIP domains? */ static int global_callevents; /*!< Whether we send manager events or not */ static int global_t1min; /*!< T1 roundtrip time minimum */ @@ -10500,6 +10501,7 @@ ast_cli(fd, " User Agent: %s\n", global_useragent); ast_cli(fd, " MWI checking interval: %d secs\n", global_mwitime); ast_cli(fd, " Reg. context: %s\n", S_OR(global_regcontext, "(not set)")); + ast_cli(fd, " Auth secret: %s\n", S_OR(global_auth_secret, "(not set)")); ast_cli(fd, " Caller ID: %s\n", default_callerid); ast_cli(fd, " From: Domain: %s\n", default_fromdomain); ast_cli(fd, " Record SIP history: %s\n", recordhistory ? "On" : "Off"); @@ -15966,6 +15968,7 @@ set_peer_defaults(peer); ast_copy_string(peer->name, name, sizeof(peer->name)); + ast_copy_string(peer->secret, global_auth_secret, sizeof(peer->secret)); ast_set_flag(&peer->flags[1], SIP_PAGE2_SELFDESTRUCT); ast_set_flag(&peer->flags[1], SIP_PAGE2_DYNAMIC); @@ -16294,6 +16297,7 @@ /* Reset channel settings to default before re-configuring */ allow_external_domains = DEFAULT_ALLOW_EXT_DOM; /* Allow external invites */ global_regcontext[0] = '\0'; + global_auth_secret[0] = '\0'; expiry = DEFAULT_EXPIRY; global_notifyringing = DEFAULT_NOTIFYRINGING; global_limitonpeers = FALSE; /*!< Match call limit on peers only */ @@ -16447,6 +16451,8 @@ ast_context_create(NULL, context,"SIP"); } ast_copy_string(global_regcontext, v->value, sizeof(global_regcontext)); + } else if (!strcasecmp(v->name, "secret")) { + ast_copy_string(global_auth_secret, v->value, sizeof(global_auth_secret)); } else if (!strcasecmp(v->name, "callerid")) { ast_copy_string(default_callerid, v->value, sizeof(default_callerid)); } else if (!strcasecmp(v->name, "fromdomain")) {