[svn-commits] rizzo: branch rizzo/astobj2 r47302 - /team/rizzo/astobj2/channels/chan_sip.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue Nov 7 16:41:18 MST 2006


Author: rizzo
Date: Tue Nov  7 17:41:18 2006
New Revision: 47302

URL: http://svn.digium.com/view/asterisk?rev=47302&view=rev
Log:
reorder sip_peer fields so the first part is the same as a sip_user.
Eases merging code.


Modified:
    team/rizzo/astobj2/channels/chan_sip.c

Modified: team/rizzo/astobj2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/astobj2/channels/chan_sip.c?rev=47302&r1=47301&r2=47302&view=diff
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Tue Nov  7 17:41:18 2006
@@ -1069,44 +1069,49 @@
 	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 cid_num[80];		/*!< Caller ID num */
+	char cid_name[80];		/*!< Caller ID name */
+	char accountcode[AST_MAX_ACCOUNT_CODE];	/*!< Account code */
+	char language[MAX_LANGUAGE];	/*!<  Default language for prompts */
+	char mohinterpret[MAX_MUSICCLASS];/*!<  Music on Hold class */
+	char mohsuggest[MAX_MUSICCLASS];/*!<  Music on Hold class */
+	char useragent[256];		/*!<  User agent in SIP request (saved from registration) */
+	struct ast_codec_pref prefs;	/*!<  codec prefs */
+	ast_group_t callgroup;		/*!<  Call group */
+	ast_group_t pickupgroup;	/*!<  Pickup group */
+	unsigned int sipoptions;	/*!<  Supported SIP options */
+	struct ast_flags flags[2];	/*!<  SIP_ flags */
+	int amaflags;			/*!< AMA Flags (for billing) */
+	int callingpres;		/*!< Calling id presentation */
+	int capability;			/*!<  Codec capability */
+	int inUse;			/*!< Number of calls in use */
+	int call_limit;			/*!< Limit of concurrent calls */
+	enum transfermodes allowtransfer;	/*! SIP Refer restriction scheme */
+	struct ast_ha *ha;		/*!<  Access control list */
+	struct ast_variable *chanvars;	/*!<  Variables to set for channel created by user */
+	int maxcallbitrate;		/*!< Maximum Bitrate for a video call */
+	int autoframing;
+
+	/* these fields are only used in a peer */
 	char username[80];		/*!< Temporary username until registration */ 
-	char accountcode[AST_MAX_ACCOUNT_CODE];	/*!< Account code */
-	int amaflags;			/*!< AMA Flags (for billing) */
 	char tohost[MAXHOSTNAMELEN];	/*!< If not dynamic, IP address */
 	char regexten[AST_MAX_EXTENSION]; /*!< Extension to register (if regcontext is used) */
 	char fromuser[80];		/*!< From: user when calling this peer */
 	char fromdomain[MAXHOSTNAMELEN];	/*!< From: domain when calling this peer */
 	char fullcontact[256];		/*!< Contact registered with us (not in sip.conf) */
-	char cid_num[80];		/*!< Caller ID num */
-	char cid_name[80];		/*!< Caller ID name */
-	int callingpres;		/*!< Calling id presentation */
-	int inUse;			/*!< Number of calls in use */
 	int inRinging;			/*!< Number of calls ringing */
 	int onHold;                     /*!< Peer has someone on hold */
-	int call_limit;			/*!< Limit of concurrent calls */
-	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 */
-	char language[MAX_LANGUAGE];	/*!<  Default language for prompts */
-	char mohinterpret[MAX_MUSICCLASS];/*!<  Music on Hold class */
-	char mohsuggest[MAX_MUSICCLASS];/*!<  Music on Hold class */
-	char useragent[256];		/*!<  User agent in SIP request (saved from registration) */
 	char register_from_hdr[256];	/*!<  'From' header received in REGISTER */
-	struct ast_codec_pref prefs;	/*!<  codec prefs */
 	int lastmsgssent;
 	time_t	lastmsgcheck;		/*!<  Last time we checked for MWI */
-	unsigned int sipoptions;	/*!<  Supported SIP options */
-	struct ast_flags flags[2];	/*!<  SIP_ flags */
 	int expire;			/*!<  When to expire this peer registration */
-	int capability;			/*!<  Codec capability */
 	int rtptimeout;			/*!<  RTP timeout */
 	int rtpholdtimeout;		/*!<  RTP Hold Timeout */
 	int rtpkeepalive;		/*!<  Send RTP packets for keepalive */
-	ast_group_t callgroup;		/*!<  Call group */
-	ast_group_t pickupgroup;	/*!<  Pickup group */
 	struct ast_dnsmgr_entry *dnsmgr;/*!<  DNS refresh manager for peer */
 	struct sockaddr_in addr;	/*!<  IP address of peer */
-	int maxcallbitrate;		/*!< Maximum Bitrate for a video call */
 	
 	/* Qualification */
 	struct sip_pvt *call;		/*!<  Call pointer */
@@ -1116,11 +1121,8 @@
 	struct timeval ps;		/*!<  Ping send time */
 	
 	struct sockaddr_in defaddr;	/*!<  Default IP address, used until registration */
-	struct ast_ha *ha;		/*!<  Access control list */
-	struct ast_variable *chanvars;	/*!<  Variables to set for channel created by user */
 	struct sip_pvt *mwipvt;		/*!<  Subscription for MWI */
 	int lastmsg;
-	int autoframing;
 };
 
 
@@ -4428,6 +4430,7 @@
 	Called by handle_request, sipsock_read */
 static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr_in *sin, const int intended_method)
 {
+	static int profile_id = -1;
 	struct sip_pvt *p = NULL;
 	char totag[128];	/* not initialized, but not used if !pedantic */
 	char fromtag[128];	/* not initialized, but not used if !pedantic */
@@ -4467,13 +4470,19 @@
 	}
 
 	dialoglist_lock();
+	if (profile_id == -1)
+		profile_id = ast_add_profile("find_call", 0);
+	ast_mark(profile_id, 1 /* start */);
 	for (p = dialoglist; p; p = p->next) {
 		if (find_call_cb(p, &arg)) {
 			/* Found the call, lock p before unlocking the container */
+			ast_mark(profile_id, 0 /* stop */);
 			sip_pvt_lock(p);
 			break;
 		}
 	}
+	if (!p)
+		ast_mark(profile_id, 0 /* stop */);
 	dialoglist_unlock();
 	if (p)
 		return p;



More information about the svn-commits mailing list