[asterisk-commits] branch bweschke/polycom_acd_functions - r8039
/team/bweschke/polycom_acd_func...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu Jan 12 15:36:44 CST 2006
Author: bweschke
Date: Thu Jan 12 15:36:43 2006
New Revision: 8039
URL: http://svn.digium.com/view/asterisk?rev=8039&view=rev
Log:
Keeping up with chan_sip.c changes in /trunk
Modified:
team/bweschke/polycom_acd_functions/channels/chan_sip.c
Modified: team/bweschke/polycom_acd_functions/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/polycom_acd_functions/channels/chan_sip.c?rev=8039&r1=8038&r2=8039&view=diff
==============================================================================
--- team/bweschke/polycom_acd_functions/channels/chan_sip.c (original)
+++ team/bweschke/polycom_acd_functions/channels/chan_sip.c Thu Jan 12 15:36:43 2006
@@ -10882,7 +10882,7 @@
/* Find the right "agent" in the config */
if (!strcasecmp(v->name, "agent")) {
args = ast_strdupa(v->value);
- if ((argc = ast_app_separate_args(args, ',', argv, sizeof(argv) / sizeof(argv[0])))) {
+ if ((argc = ast_app_separate_args(args, ',', argv, sizeof(argv) / sizeof(argv[0]))) > 0) {
agentid = argv[0];
if (argc > 1) {
agentsecret = argv[1];
@@ -10969,24 +10969,32 @@
if (p->sipoptions)
user->sipoptions = p->sipoptions;
+
+
/* If we have a call limit, set flag */
if (user->call_limit)
ast_set_flag(p, SIP_CALL_LIMIT);
+
if (!ast_strlen_zero(user->context))
- ast_copy_string(p->context, user->context, sizeof(p->context));
- if (!ast_strlen_zero(user->cid_num) && !ast_strlen_zero(p->cid_num)) {
- ast_copy_string(p->cid_num, user->cid_num, sizeof(p->cid_num));
- ast_shrink_phone_number(p->cid_num);
+ ast_string_field_set(p, context, user->context);
+ if (!ast_strlen_zero(user->cid_num) && !ast_strlen_zero(p->cid_num)) {
+ char *tmp = ast_strdupa(user->cid_num);
+ if (tmp) {
+ ast_shrink_phone_number(tmp);
+ ast_string_field_set(p, cid_num, tmp);
+ } else {
+ ast_string_field_set(p, cid_num, user->cid_num);
+ }
}
- if (!ast_strlen_zero(user->cid_name) && !ast_strlen_zero(p->cid_num))
- ast_copy_string(p->cid_name, user->cid_name, sizeof(p->cid_name));
- ast_copy_string(p->username, user->name, sizeof(p->username));
- ast_copy_string(p->peersecret, user->secret, sizeof(p->peersecret));
- ast_copy_string(p->subscribecontext, user->subscribecontext, sizeof(p->subscribecontext));
- ast_copy_string(p->peermd5secret, user->md5secret, sizeof(p->peermd5secret));
- ast_copy_string(p->accountcode, user->accountcode, sizeof(p->accountcode));
- ast_copy_string(p->language, user->language, sizeof(p->language));
- ast_copy_string(p->musicclass, user->musicclass, sizeof(p->musicclass));
+ if (!ast_strlen_zero(user->cid_name) && !ast_strlen_zero(p->cid_num))
+ ast_string_field_set(p, cid_name, user->cid_name);
+ ast_string_field_set(p, username, user->name);
+ ast_string_field_set(p, peersecret, user->secret);
+ ast_string_field_set(p, peermd5secret, user->md5secret);
+ ast_string_field_set(p, subscribecontext, user->subscribecontext);
+ ast_string_field_set(p, accountcode, user->accountcode);
+ ast_string_field_set(p, language, user->language);
+ ast_string_field_set(p, musicclass, user->musicclass);
p->amaflags = user->amaflags;
p->callgroup = user->callgroup;
p->pickupgroup = user->pickupgroup;
More information about the asterisk-commits
mailing list