[asterisk-commits] bweschke: branch bweschke/polycom_acd_on_1.4 r96197 - /team/bweschke/polycom_...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jan 3 05:48:27 CST 2008
Author: bweschke
Date: Thu Jan 3 05:48:26 2008
New Revision: 96197
URL: http://svn.digium.com/view/asterisk?view=rev&rev=96197
Log:
Another progress commit. Next step, export functions to handle agent login / logout.
Modified:
team/bweschke/polycom_acd_on_1.4/channels/chan_sip.c
Modified: team/bweschke/polycom_acd_on_1.4/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/polycom_acd_on_1.4/channels/chan_sip.c?view=diff&rev=96197&r1=96196&r2=96197
==============================================================================
--- team/bweschke/polycom_acd_on_1.4/channels/chan_sip.c (original)
+++ team/bweschke/polycom_acd_on_1.4/channels/chan_sip.c Thu Jan 3 05:48:26 2008
@@ -968,6 +968,7 @@
int expiry; /*!< How long we take to expire */
long branch; /*!< The branch identifier of this session */
char tag[11]; /*!< Our tag for this session */
+ char digestname[80]; /*!< The digest name presented for authentication */
int sessionid; /*!< SDP Session ID */
int sessionversion; /*!< SDP Session Version */
struct sockaddr_in sa; /*!< Our peer */
@@ -1079,6 +1080,7 @@
struct sip_auth *auth; /*!< Realm authentication list */
char context[AST_MAX_CONTEXT]; /*!< Default context for incoming calls */
char subscribecontext[AST_MAX_CONTEXT]; /*!< Default context for subscriptions */
+ char agentcbcontext[AST_MAX_CONTEXT]; /*!< Default context for callback to agent logins */
char username[80]; /*!< Temporary username until registration */
char accountcode[AST_MAX_ACCOUNT_CODE]; /*!< Account code */
int amaflags; /*!< AMA Flags (for billing) */
@@ -1094,6 +1096,7 @@
int inRinging; /*!< Number of calls ringing */
int onHold; /*!< Peer has someone on hold */
int call_limit; /*!< Limit of concurrent calls */
+ int agentlogin; /*!< Agent login is allowed (for phones that support it) */
enum transfermodes allowtransfer; /*! SIP Refer restriction scheme */
char vmexten[AST_MAX_EXTENSION]; /*!< Dialplan extension for MWI notify message*/
char mailbox[AST_MAX_EXTENSION]; /*!< Mailbox setting for MWI checks */
@@ -8373,6 +8376,7 @@
ast_log(LOG_WARNING, "username mismatch, have <%s>, digest has <%s>\n",
username, keys[K_USER].s);
/* Oops, we're trying something here */
+ ast_copy_string(p->digestname, keys[K_USER].s, sizeof(p->digestname));
return AUTH_USERNAME_MISMATCH;
}
@@ -9467,12 +9471,12 @@
checkauthret = check_auth(p, req, peer->name, p->peersecret, p->peermd5secret, sipmethod, uri2, reliable, ast_test_flag(req, SIP_PKT_IGNORE));
- if (checkauthret == AUTH_USERNAME_MISMATCH) {
- checkauthret = check_auth(p, req, "12345", "12345", NULL, sipmethod, uri2, reliable, ast_test_flag(req, SIP_PKT_IGNORE));
+ if (checkauthret == AUTH_USERNAME_MISMATCH && peer->agentlogin) {
+ checkauthret = check_auth(p, req, p->digestname, "12345", NULL, sipmethod, uri2, reliable, ast_test_flag(req, SIP_PKT_IGNORE));
if (!checkauthret)
- ast_log(LOG_DEBUG, "auth'd correctly with 12345 on peer %s\n", peer->name);
+ ast_log(LOG_DEBUG, "auth'd correctly with %s on peer %s\n", p->digestname, peer->name);
else
- ast_log(LOG_DEBUG, "not auth'd correctly with 12345 on peer %s\n", peer->name);
+ ast_log(LOG_DEBUG, "not auth'd correctly with %s on peer %s\n", p->digestname, peer->name);
}
res = checkauthret;
if (checkauthret == AUTH_SUCCESSFUL) {
@@ -16379,6 +16383,7 @@
ast_copy_flags(&peer->flags[0], &global_flags[0], SIP_FLAGS_TO_COPY);
ast_copy_flags(&peer->flags[1], &global_flags[1], SIP_PAGE2_FLAGS_TO_COPY);
strcpy(peer->context, default_context);
+ strcpy(peer->agentcbcontext, default_context);
strcpy(peer->subscribecontext, default_subscribecontext);
strcpy(peer->language, default_language);
strcpy(peer->mohinterpret, default_mohinterpret);
@@ -16405,6 +16410,7 @@
peer->pickupgroup = 0;
peer->maxms = default_qualify;
peer->prefs = default_prefs;
+ peer->agentlogin = 0;
}
/*! \brief Create temporary peer (used in autocreatepeer mode) */
@@ -16517,10 +16523,18 @@
ast_copy_string(peer->context, v->value, sizeof(peer->context));
} else if (!strcasecmp(v->name, "subscribecontext")) {
ast_copy_string(peer->subscribecontext, v->value, sizeof(peer->subscribecontext));
+ } else if (!strcasecmp(v->name, "agentcbcontext")) {
+ ast_copy_string(peer->agentcbcontext, v->value, sizeof(peer->agentcbcontext));
} else if (!strcasecmp(v->name, "fromdomain")) {
ast_copy_string(peer->fromdomain, v->value, sizeof(peer->fromdomain));
} else if (!strcasecmp(v->name, "usereqphone")) {
ast_set2_flag(&peer->flags[0], ast_true(v->value), SIP_USEREQPHONE);
+ } else if (!strcasecmp(v->name, "agentlogin")) {
+ if (!strcasecmp(v->value, "no")) {
+ peer->agentlogin = 0;
+ } else if (!strcasecmp(v->value, "yes")) {
+ peer->agentlogin = 1;
+ }
} else if (!strcasecmp(v->name, "fromuser")) {
ast_copy_string(peer->fromuser, v->value, sizeof(peer->fromuser));
} else if (!strcasecmp(v->name, "host") || !strcasecmp(v->name, "outboundproxy")) {
More information about the asterisk-commits
mailing list