[asterisk-commits] mvanbaak: branch group/multiparking r114019 - /team/group/multiparking/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Apr 10 06:58:46 CDT 2008


Author: mvanbaak
Date: Thu Apr 10 06:58:36 2008
New Revision: 114019

URL: http://svn.digium.com/view/asterisk?view=rev&rev=114019
Log:
convert the parkinglot stuff to stringfields

Modified:
    team/group/multiparking/channels/chan_iax2.c

Modified: team/group/multiparking/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/group/multiparking/channels/chan_iax2.c?view=diff&rev=114019&r1=114018&r2=114019
==============================================================================
--- team/group/multiparking/channels/chan_iax2.c (original)
+++ team/group/multiparking/channels/chan_iax2.c Thu Apr 10 06:58:36 2008
@@ -142,7 +142,7 @@
 
 
 static char context[80] = "default";
-static char default_parkinglot[AST_MAX_EXTENSION];
+static char default_parkinglot[AST_MAX_CONTEXT];
 
 static char language[MAX_LANGUAGE] = "";
 static char regcontext[AST_MAX_CONTEXT] = "";
@@ -301,12 +301,11 @@
 		AST_STRING_FIELD(language);
 		AST_STRING_FIELD(cid_num);
 		AST_STRING_FIELD(cid_name);
+		AST_STRING_FIELD(parkinglot);           /*!< Default parkinglot for device */
 	);
 	
 	int authmethods;
 	int encmethods;
-	char parkinglot[AST_MAX_EXTENSION];		/*!< Default parkinglot for device */
-			/* XXX Needs to be a string field */
 	int amaflags;
 	int adsi;
 	unsigned int flags;
@@ -338,8 +337,8 @@
 		AST_STRING_FIELD(cid_num);		/*!< Default context (for transfer really) */
 		AST_STRING_FIELD(cid_name);		/*!< Default context (for transfer really) */
 		AST_STRING_FIELD(zonetag);		/*!< Time Zone */
+		AST_STRING_FIELD(parkinglot);   /*!< Default parkinglot for device */
 	);
-	char parkinglot[AST_MAX_EXTENSION];		/*!< Default parkinglot for device */
 	struct ast_codec_pref prefs;
 	struct ast_dnsmgr_entry *dnsmgr;		/*!< DNS refresh manager */
 	struct sockaddr_in addr;
@@ -586,6 +585,8 @@
 		AST_STRING_FIELD(mohsuggest);
 		/*! received OSP token */
 		AST_STRING_FIELD(osptoken);
+		/*! Default parkinglot */
+		AST_STRING_FIELD(parkinglot);
 	);
 	
 	/*! permitted authentication methods */
@@ -632,7 +633,6 @@
 	int calling_ton;
 	int calling_tns;
 	int calling_pres;
-	char parkinglot[AST_MAX_EXTENSION];		/*!< Default parkinglot for device */
 	int amaflags;
 	AST_LIST_HEAD_NOLOCK(, iax2_dpcache) dpentries;
 	struct ast_variable *vars;
@@ -1562,7 +1562,7 @@
 			ast_string_field_set(iaxs[x], accountcode, accountcode);
 			ast_string_field_set(iaxs[x], mohinterpret, mohinterpret);
 			ast_string_field_set(iaxs[x], mohsuggest, mohsuggest);
-			ast_copy_string(iaxs[x]->parkinglot, default_parkinglot, sizeof(iaxs[x]->parkinglot));
+			ast_string_field_set(iaxs[x], parkinglot, default_parkinglot);
 		} else {
 			ast_log(LOG_WARNING, "Out of resources\n");
 			ast_mutex_unlock(&iaxsl[x]);
@@ -5733,7 +5733,7 @@
 		if (!ast_strlen_zero(user->mohsuggest))
 			ast_string_field_set(iaxs[callno], mohsuggest, user->mohsuggest);
 		if (!ast_strlen_zero(user->parkinglot))
-			ast_copy_string(iaxs[callno]->parkinglot, user->parkinglot, sizeof(iaxs[callno]->parkinglot));
+			ast_string_field_set(iaxs[callno], parkinglot, user->parkinglot);
 		if (user->amaflags)
 			iaxs[callno]->amaflags = user->amaflags;
 		if (!ast_strlen_zero(user->language))
@@ -10419,7 +10419,7 @@
 			} else if (!strcasecmp(v->name, "mohsuggest")) {
 				ast_string_field_set(user, mohsuggest, v->value);
 			} else if (!strcasecmp(v->name, "parkinglot")) {
-				ast_copy_string(user->parkinglot, v->value, sizeof(user->parkinglot));
+				ast_string_field_set(user, parkinglot, v->value);
 			} else if (!strcasecmp(v->name, "language")) {
 				ast_string_field_set(user, language, v->value);
 			} else if (!strcasecmp(v->name, "amaflags")) {




More information about the asterisk-commits mailing list