[asterisk-commits] branch kpfleming/stringfields - r7765 /team/kpfleming/stringfields/channels/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Jan 3 21:13:30 CST 2006


Author: kpfleming
Date: Tue Jan  3 21:13:29 2006
New Revision: 7765

URL: http://svn.digium.com/view/asterisk?rev=7765&view=rev
Log:
use string fields for remaining character string buffers in sip_registry

Modified:
    team/kpfleming/stringfields/channels/chan_sip.c

Modified: team/kpfleming/stringfields/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/stringfields/channels/chan_sip.c?rev=7765&r1=7764&r2=7765&view=diff
==============================================================================
--- team/kpfleming/stringfields/channels/chan_sip.c (original)
+++ team/kpfleming/stringfields/channels/chan_sip.c Tue Jan  3 21:13:29 2006
@@ -833,15 +833,15 @@
 		AST_STRING_FIELD(opaque);	/*!< Opaque nonsense */
 		AST_STRING_FIELD(qop);		/*!< Quality of Protection, since SIP wasn't complicated enough yet. */
 		AST_STRING_FIELD(domain);	/*!< Authorization domain */
+		AST_STRING_FIELD(username);	/*!< Who we are registering as */
+		AST_STRING_FIELD(authuser);	/*!< Who we *authenticate* as */
+		AST_STRING_FIELD(hostname);	/*!< Domain or host we register to */
+		AST_STRING_FIELD(secret);	/*!< Password in clear text */	
+		AST_STRING_FIELD(md5secret);	/*!< Password in md5 */
+		AST_STRING_FIELD(contact);	/*!< Contact extension */
+		AST_STRING_FIELD(random);
 	);
 	int portno;			/*!<  Optional port override */
-	char username[80];		/*!<  Who we are registering as */
-	char authuser[80];		/*!< Who we *authenticate* as */
-	char hostname[MAXHOSTNAMELEN];	/*!< Domain or host we register to */
-	char secret[80];		/*!< Password in clear text */	
-	char md5secret[80];		/*!< Password in md5 */
-	char contact[256];		/*!< Contact extension */
-	char random[80];
 	int expire;			/*!< Sched ID of expiration */
 	int regattempts;		/*!< Number of attempts (since the last success) */
 	int timeout; 			/*!< sched id of sip_reg_timeout */
@@ -851,11 +851,8 @@
 	int callid_valid;		/*!< 0 means we haven't chosen callid for this registry yet. */
 	unsigned int ocseq;		/*!< Sequence number we got to for REGISTERs for this registry */
 	struct sockaddr_in us;		/*!< Who the server thinks we are */
- 	
- 					/* Saved headers */
 	int noncecount;			/*!< Nonce-count */
- 
- 	char lastmsg[256];		/*!< Last Message sent/received */
+	char lastmsg[256];		/*!< Last Message sent/received */
 };
 
 /*! \brief  The user list: Users and friends ---*/
@@ -1907,7 +1904,7 @@
 /*! \brief  create_addr: create address structure from peer name
  *      Or, if peer not found, find it in the global DNS 
  *      returns TRUE (-1) on failure, FALSE on success */
-static int create_addr(struct sip_pvt *dialog, char *opeer)
+static int create_addr(struct sip_pvt *dialog, const char *opeer)
 {
 	struct hostent *hp;
 	struct ast_hostent ahp;
@@ -3271,15 +3268,15 @@
 
 	regobjs++;
 	ASTOBJ_INIT(reg);
-	ast_copy_string(reg->contact, contact, sizeof(reg->contact));
+	ast_string_field_set(reg, contact, contact);
 	if (username)
-		ast_copy_string(reg->username, username, sizeof(reg->username));
+		ast_string_field_set(reg, username, username);
 	if (hostname)
-		ast_copy_string(reg->hostname, hostname, sizeof(reg->hostname));
+		ast_string_field_set(reg, hostname, hostname);
 	if (authuser)
-		ast_copy_string(reg->authuser, authuser, sizeof(reg->authuser));
+		ast_string_field_set(reg, authuser, authuser);
 	if (secret)
-		ast_copy_string(reg->secret, secret, sizeof(reg->secret));
+		ast_string_field_set(reg, secret, secret);
 	reg->expire = -1;
 	reg->timeout =  -1;
 	reg->refresh = default_expiry;



More information about the asterisk-commits mailing list