[asterisk-commits] russell: branch murf/bug11210 r104865 - /team/murf/bug11210/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 27 17:09:27 CST 2008


Author: russell
Date: Wed Feb 27 17:09:26 2008
New Revision: 104865

URL: http://svn.digium.com/view/asterisk?view=rev&rev=104865
Log:
Remove a large chunk of code that is not being used.  We can grab it out of svn
history if it is needed, but I would be very concerned about the maintainability
of such a thing ... something to think about ...

Modified:
    team/murf/bug11210/channels/chan_sip.c

Modified: team/murf/bug11210/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/channels/chan_sip.c?view=diff&rev=104865&r1=104864&r2=104865
==============================================================================
--- team/murf/bug11210/channels/chan_sip.c (original)
+++ team/murf/bug11210/channels/chan_sip.c Wed Feb 27 17:09:26 2008
@@ -20488,513 +20488,6 @@
 	return peer;
 }
 
-/*! \note Theory: It is quicker to construct a peer from the config file,
- *  and to compare it with the (possibly existing) current peer at reload
- *  time, and do nothing if the peer has not changed at all, than to 
- *  automatically destroy the peer and re-create it every time.
- *  With really large lists of peers, most reload situations will
- *  involve fairly small sets of peer changes  */
-
-static int ast_sockaddrcmp(struct sockaddr_in *sa1, struct sockaddr_in *sa2)
-{
-	if (sa1->sin_port != sa2->sin_port) {
-		ast_log(LOG_NOTICE, "Peers differ in sockaddr sin_port field: %x vs %x\n", sa1->sin_port, sa2->sin_port);
-		return 1;
-	}
-	
-	
-	if (sa1->sin_addr.s_addr != sa2->sin_addr.s_addr) {
-		ast_log(LOG_NOTICE, "Peers differ in sockaddr sin_addr field: %x vs %x\n", sa1->sin_addr.s_addr, sa2->sin_addr.s_addr);
-		return 1;
-	}
-	
-	if (sa1->sin_family != sa2->sin_family) {
-		ast_log(LOG_NOTICE, "Peers differ in sockaddr sin_family field: %x vs %x\n", sa1->sin_family, sa2->sin_family);
-		return 1;
-	}
-	
-	return 0;
-}
-
-
-static int ast_hacmp(struct ast_ha *ha1, struct ast_ha *ha2) /* the list should match in order */
-{
-	if (ha1->sense != ha2->sense) {
-		ast_log(LOG_NOTICE, "Peers differ in ha sense field: %d vs %d\n", ha1->sense, ha2->sense);
-		return 1;
-	}
-	if (ha1->netaddr.s_addr != ha2->netaddr.s_addr) {
-		ast_log(LOG_NOTICE, "Peers differ in ha netaddr field: %d vs %d\n", ha1->netaddr.s_addr, ha2->netaddr.s_addr);
-		return 1;
-	}
-	if (ha1->netmask.s_addr != ha2->netmask.s_addr) {
-		ast_log(LOG_NOTICE, "Peers differ in ha netmask field: %d vs %d\n", ha1->netmask.s_addr, ha2->netmask.s_addr);
-		return 1;
-	}
-
-	if ((ha1->next && !ha2->next) || (!ha1->next && ha2->next)) {
-		ast_log(LOG_NOTICE, "Peers differ in list length\n");
-		return 1;
-	}
-	
-	if (ha1->next && ast_hacmp(ha1->next, ha2->next)) {
-		return 1;
-	}
-
-	return 0;
-}
-
-static int ast_proxycmp(struct sip_proxy *p1, struct sip_proxy *p2)
-{
-	if( (ast_strlen_zero(p1->name) && !ast_strlen_zero(p2->name))
-		|| (!ast_strlen_zero(p1->name) && ast_strlen_zero(p2->name))) {
-		ast_log(LOG_NOTICE, "Peers differ in proxy name field: one set, but not the other\n");
-		return 1;
-	}
-	
-	if (!ast_strlen_zero(p1->name) && strcmp(p1->name, p2->name) != 0) {
-		ast_log(LOG_NOTICE, "Peers differ in proxy name field: %s vs %s\n", p1->name, p2->name);
-		return 1;
-	}
-	
-	if (p1->force != p2->force) {
-		ast_log(LOG_NOTICE, "Peers differ in proxy force field: %d vs %d\n", p1->force, p2->force);
-		return 1;
-	}
-	
-	if (ast_sockaddrcmp(&p1->ip, &p2->ip)) {
-		ast_log(LOG_NOTICE, "Above Peers differ in proxy sockaddr ip field\n");
-		return 1;
-	}
-
-	return 0;
-}
-
-static int ast_authcmp(struct sip_auth *peer1, struct sip_auth *peer2)
-{
-	if (ast_strlen_zero(peer1->realm) && !ast_strlen_zero(peer2->realm)) {
-		ast_log(LOG_NOTICE, "Peers differ in auth realm field: one set, one not\n");
-		return 1;
-	}
-	if (!ast_strlen_zero(peer1->realm) && strcmp(peer1->realm, peer2->realm) != 0) {
-		ast_log(LOG_NOTICE, "Peers differ in auth realm field: %s vs %s\n", peer1->realm, peer2->realm);
-		return 1;
-	}
-	
-	if (ast_strlen_zero(peer1->username) && !ast_strlen_zero(peer2->username)) {
-		ast_log(LOG_NOTICE, "Peers differ in auth username field: one set, one not\n");
-		return 1;
-	}
-	if (!ast_strlen_zero(peer1->username) && strcmp(peer1->username, peer2->username) != 0) {
-		ast_log(LOG_NOTICE, "Peers differ in auth username field: %s vs %s\n", peer1->username, peer2->username);
-		return 1;
-	}
-	
-	if (ast_strlen_zero(peer1->secret) && !ast_strlen_zero(peer2->secret)) {
-		ast_log(LOG_NOTICE, "Peers differ in auth secret field: one set, one not\n");
-		return 1;
-	}
-	if (!ast_strlen_zero(peer1->secret) && strcmp(peer1->secret, peer2->secret) != 0) {
-		ast_log(LOG_NOTICE, "Peers differ in auth secret field: %s vs %s\n", peer1->secret, peer2->secret);
-		return 1;
-	}
-	
-	if (ast_strlen_zero(peer1->md5secret) && !ast_strlen_zero(peer2->md5secret)) {
-		ast_log(LOG_NOTICE, "Peers differ in auth md5secret field: one set, one not\n");
-		return 1;
-	}
-	if (!ast_strlen_zero(peer1->md5secret) && strcmp(peer1->md5secret, peer2->md5secret) != 0) {
-		ast_log(LOG_NOTICE, "Peers differ in auth md5secret field: %s vs %s\n", peer1->md5secret, peer2->md5secret);
-		return 1;
-	}
-	
-	if ((peer1->next && !peer2->next) && (!peer1->next && peer2->next)) {
-		ast_log(LOG_NOTICE, "Peers differ in auth list length\n");
-		return 1;
-	}
-	if (peer1->next && ast_authcmp(peer1->next, peer2->next)) {
-		return 1;
-	}
-
-	return 0;
-}
-
-static int ast_codecprefcmp(struct ast_codec_pref *pref1, struct ast_codec_pref *pref2)
-{
-	int i;
-	for (i=0;i<32;i++) {
-		if (pref1->order[i] != pref2->order[i]) {
-			ast_log(LOG_NOTICE, "Peers differ in codec pref order field: %d vs %d\n", pref1->order[i], pref2->order[i]);
-			return 1;
-		}
-		if (pref1->framing[i] != pref2->framing[i]) {
-			ast_log(LOG_NOTICE, "Peers differ in codec pref framing field: %d vs %d\n", pref1->framing[i], pref2->framing[i]);
-			return 1;
-		}
-	}
-	return 0;
-}
-
-static int ast_mailboxescmp(struct sip_peer *peer1, struct sip_peer *peer2)
-{
-	struct sip_mailbox *m1, *m2 = AST_LIST_FIRST(&peer2->mailboxes);
-	
-	AST_LIST_TRAVERSE(&peer1->mailboxes, m1, entry) {
-		if (!m2) {
-			ast_log(LOG_NOTICE, "Peers differ in mailbox list length (1)\n");
-			return 1;
-		}
-		if ((!AST_LIST_NEXT(m1, entry) && AST_LIST_NEXT(m2, entry))
-			|| (AST_LIST_NEXT(m1, entry) && !AST_LIST_NEXT(m2, entry))) {
-			ast_log(LOG_NOTICE, "Peers differ in mailbox list length (2)\n");
-			return 1;
-		}
-		if ((ast_strlen_zero(m1->mailbox) && !ast_strlen_zero(m2->mailbox))
-			|| (!ast_strlen_zero(m1->mailbox) && ast_strlen_zero(m2->mailbox))) {
-			ast_log(LOG_NOTICE, "Peers differ in mailbox spec: one set, but not the other\n");
-			return 1;
-		}
-		if (!ast_strlen_zero(m1->mailbox) && strcmp(m1->mailbox, m2->mailbox) != 0) {
-			ast_log(LOG_NOTICE, "Peers differ in mailbox spec: %s vs %s\n", m1->mailbox, m2->mailbox);
-			return 1;
-		}
-		if ((ast_strlen_zero(m1->context) && !ast_strlen_zero(m2->context))
-			|| (!ast_strlen_zero(m1->context) && ast_strlen_zero(m2->context))) {
-			ast_log(LOG_NOTICE, "Peers differ in context spec: one set, but not the other\n");
-			return 1;
-		}
-		if (!ast_strlen_zero(m1->context) && strcmp(m1->context, m2->context) != 0) {
-			ast_log(LOG_NOTICE, "Peers differ in context spec: %s vs %s\n", m1->context, m2->context);
-			return 1;
-		}
-		m2 = AST_LIST_NEXT(m2, entry);
-	}
-	if (m2) {
-		ast_log(LOG_NOTICE, "Peers differ in mailbox list length (3)\n");
-		return 1;
-	}
-	return 0;
-}
-
-static int ast_varcmp(struct ast_variable *var1, struct ast_variable *var2)
-{
-	if ((!ast_strlen_zero(var1->name) && ast_strlen_zero(var2->name))
-		|| (ast_strlen_zero(var1->name) && !ast_strlen_zero(var2->name))) {
-		ast_log(LOG_NOTICE, "Peers differ in chan variable name -- one set, one not set\n");
-		return 1;
-	}
-	if ((!ast_strlen_zero(var1->value) && ast_strlen_zero(var2->value))
-		|| (ast_strlen_zero(var1->value) && !ast_strlen_zero(var2->value))) {
-		ast_log(LOG_NOTICE, "Peers differ in chan variable value -- one set, one not set\n");
-		return 1;
-	}
-	if (!ast_strlen_zero(var1->name) && strcmp(var1->name, var2->name) != 0) {
-		ast_log(LOG_NOTICE, "Peers differ in channel var name: %s vs %s\n", var1->name, var2->name);
-		return 1;
-	}
-	if (!ast_strlen_zero(var1->value) && strcmp(var1->value, var2->value) != 0) {
-		ast_log(LOG_NOTICE, "Peers differ in channel var value: %s vs %s\n", var1->value, var2->value);
-		return 1;
-	}
-	if ((var1->next && !var2->next) || (!var1->next && var2->next)) {
-		ast_log(LOG_NOTICE, "Peers differ in chan variable list len (1)\n");
-		return 1;
-	}
-	if (var1->next && ast_varcmp(var1->next, var2->next)) {
-		return 1;
-	}
-	return 0;
-}
-
-/* set up the mask by looking at the handle_common_options func and the fields set in the
-   reload_config func... */
-
-static int peercmp_mask0 = SIP_TRUSTRPID | SIP_SENDRPID | SIP_G726_NONSTANDARD | SIP_USECLIENTCODE
-		| SIP_DTMF | SIP_NAT | SIP_REINVITE | SIP_INSECURE | SIP_PROG_INBAND | SIP_PROMISCREDIR 
-		| SIP_USEREQPHONE;
-static int peercmp_mask1 = SIP_PAGE2_VIDEOSUPPORT | SIP_PAGE2_TEXTSUPPORT | SIP_PAGE2_ALLOWOVERLAP 
-		| SIP_PAGE2_ALLOWSUBSCRIBE | SIP_PAGE2_T38SUPPORT_UDPTL
-		| SIP_PAGE2_T38SUPPORT_RTP | SIP_PAGE2_T38SUPPORT_TCP 
-		| SIP_PAGE2_RFC2833_COMPENSATE | SIP_PAGE2_BUGGY_MWI 
-		| SIP_PAGE2_SUBSCRIBEMWIONLY | SIP_PAGE2_REGISTERTRYING;
-
-
-int ast_peercmp(struct sip_peer *peer1, struct sip_peer *peer2);
-
-int ast_peercmp(struct sip_peer *peer1, struct sip_peer *peer2)
-{
-	/* rule 1: only compare those fields that are actually set
-	   when the config file is read in. */
-	/* fields to compare:
-	   X name
-	   X stuff in handle_common_options
-	   X secret
-	   X md5secret
-	   X cid_name
-	   X cid_num
-	   X context
-	   X subscribecontext
-	   X fromdomain
-	   X fromuser
-	   X tohost
-	   X username
-	   X language
-	   X regexten
-	   X mohinterpret
-	   X mohsuggest
-	   X vmexten
-
-	   X flags[0] <- SIP_USEREQPHONE
-	   X flags[1] <- SIP_PAGE2_SUBSCRIBEMWIONLY
-	   X flags[1] <- SIP_PAGE2_REGISTERTRYING
-	   X callingpres
-	   X call_limit
-	   X amaflags
-	   X busy_level
-	   X accountcode
-	   X maxcallbitrate
-	   X host_dynamic
-	   X maxms (qualify)
-	   X timer_t1
-	   X timer_b
-	   X autoframing
-	   X rtptimeout
-	   X rtpholdtimeout
-	   X rtpkeepalive
-
-	   callback (a sep field) (used to register, but not stored in peer, perse)
-	   X stuff done by add_peer_mailboxes()
-	   X allowtransfer  (enum transfermodes)
-	   X prefs ------\  (struct ast_codec_prefs)
-	   X capability -r-+---- set by ast_parse_allow_disallow
-	   X chanvars (is a list!)
-	   X auth (stuff from add_realm_authentification)  (struct sip_auth)
-	   X outboundproxy (proxyname, port, forceopt)  (struct sip_proxy)
-	   X addr.sin_addr          (struct sockaddr_in)
-	   X addr.sin_port
-	   X defaddr                  (struct sockaddr_in)
-	   X ha (permit/deny info)    (struct ast_ha)
-	   X callgroup    (ast_group_t)
-	   X pickupgroup  (ast_group_t)
-
-	   NOTE: this is a big list, with lots of datatypes...! */
-
-	int empty1;
-	
-
-#define STR_UNEQUAL(field) (empty1=ast_strlen_zero(peer1->field) ^ (ast_strlen_zero(peer2->field))) /* one's empty, and the other not */ \
-							|| (empty1 && !strcmp((peer1->field), (peer2->field)))   /* or both set but not equal */
-	
-#define INT_UNEQUAL(field) (peer1->field != peer2->field)
-
-	if (STR_UNEQUAL(name)) {
-		ast_log(LOG_NOTICE, "Peers differ in name: %s vs %s\n", peer1->name, peer2->name);
-		return 1;
-	}
-	if (STR_UNEQUAL(secret)) {
-		ast_log(LOG_NOTICE, "Peers differ in secret: %s vs %s\n", peer1->secret, peer2->secret);
-		return 1;
-	}
-	if (STR_UNEQUAL(md5secret)) {
-		ast_log(LOG_NOTICE, "Peers differ in md5secret: %s vs %s\n", peer1->md5secret, peer2->md5secret);
-		return 1;
-	}
-	if (STR_UNEQUAL(context)) {
-		ast_log(LOG_NOTICE, "Peers differ in context: %s vs %s\n", peer1->context, peer2->context);
-		return 1;
-	}
-	if (STR_UNEQUAL(subscribecontext)) {
-		ast_log(LOG_NOTICE, "Peers differ in subscribecontext: %s vs %s\n", peer1->subscribecontext, peer2->subscribecontext);
-		return 1;
-	}
-	if (STR_UNEQUAL(username)) {
-		ast_log(LOG_NOTICE, "Peers differ in username: %s vs %s\n", peer1->username, peer2->username);
-		return 1;
-	}
-	if (STR_UNEQUAL(accountcode)) {
-		ast_log(LOG_NOTICE, "Peers differ in accountcode: %s vs %s\n", peer1->accountcode, peer2->accountcode);
-		return 1;
-	}
-	if (STR_UNEQUAL(tohost)) {
-		ast_log(LOG_NOTICE, "Peers differ in tohost: %s vs %s\n", peer1->tohost, peer2->tohost);
-		return 1;
-	}
-	if (STR_UNEQUAL(regexten)) {
-		ast_log(LOG_NOTICE, "Peers differ in regexten: %s vs %s\n", peer1->regexten, peer2->regexten);
-		return 1;
-	}
-	if (STR_UNEQUAL(fromuser)) {
-		ast_log(LOG_NOTICE, "Peers differ in fromuser: %s vs %s\n", peer1->fromuser, peer2->fromuser);
-		return 1;
-	}
-	if (STR_UNEQUAL(fromdomain)) {
-		ast_log(LOG_NOTICE, "Peers differ in fromdomain: %s vs %s\n", peer1->fromdomain, peer2->fromdomain);
-		return 1;
-	}
-	if (STR_UNEQUAL(accountcode)) {
-		ast_log(LOG_NOTICE, "Peers differ in accountcode: %s vs %s\n", peer1->accountcode, peer2->accountcode);
-		return 1;
-	}
-	if (STR_UNEQUAL(cid_num)) {
-		ast_log(LOG_NOTICE, "Peers differ in cid_num: %s vs %s\n", peer1->cid_num, peer2->cid_num);
-		return 1;
-	}
-	if (STR_UNEQUAL(cid_name)) {
-		ast_log(LOG_NOTICE, "Peers differ in cid_name: %s vs %s\n", peer1->cid_name, peer2->cid_name);
-		return 1;
-	}
-	if (STR_UNEQUAL(vmexten)) {
-		ast_log(LOG_NOTICE, "Peers differ in vmexten: %s vs %s\n", peer1->vmexten, peer2->vmexten);
-		return 1;
-	}
-	if (STR_UNEQUAL(language)) {
-		ast_log(LOG_NOTICE, "Peers differ in language: %s vs %s\n", peer1->language, peer2->language);
-		return 1;
-	}
-	if (STR_UNEQUAL(mohinterpret)) {
-		ast_log(LOG_NOTICE, "Peers differ in mohinterpret: %s vs %s\n", peer1->mohinterpret, peer2->mohinterpret);
-		return 1;
-	}
-	if (STR_UNEQUAL(mohsuggest)) {
-		ast_log(LOG_NOTICE, "Peers differ in mohsuggest: %s vs %s\n", peer1->mohsuggest, peer2->mohsuggest);
-		return 1;
-	}
-
-	if (INT_UNEQUAL(amaflags)) {
-		ast_log(LOG_NOTICE, "Peers differ in amaflags: %d vs %d\n", peer1->amaflags, peer2->amaflags);
-		return 1;
-	}
-	if (INT_UNEQUAL(busy_level)) {
-		ast_log(LOG_NOTICE, "Peers differ in busy_level: %d vs %d\n", peer1->busy_level, peer2->busy_level);
-		return 1;
-	}
-	if (INT_UNEQUAL(maxcallbitrate)) {
-		ast_log(LOG_NOTICE, "Peers differ in maxcallbitrate: %d vs %d\n", peer1->maxcallbitrate, peer2->maxcallbitrate);
-		return 1;
-	}
-	if (INT_UNEQUAL(host_dynamic)) {
-		ast_log(LOG_NOTICE, "Peers differ in host_dynamic: %d vs %d\n", peer1->host_dynamic, peer2->host_dynamic);
-		return 1;
-	}
-	if (INT_UNEQUAL(maxms)) {
-		ast_log(LOG_NOTICE, "Peers differ in maxms: %d vs %d\n", peer1->maxms, peer2->maxms);
-		return 1;
-	}
-	if (INT_UNEQUAL(timer_t1)) {
-		ast_log(LOG_NOTICE, "Peers differ in timer_t1: %d vs %d\n", peer1->timer_t1, peer2->timer_t1);
-		return 1;
-	}
-	if (INT_UNEQUAL(timer_b)) {
-		ast_log(LOG_NOTICE, "Peers differ in timer_b: %d vs %d\n", peer1->timer_b, peer2->timer_b);
-		return 1;
-	}
-	if (INT_UNEQUAL(autoframing)) {
-		ast_log(LOG_NOTICE, "Peers differ in autoframing: %d vs %d\n", peer1->autoframing, peer2->autoframing);
-		return 1;
-	}
-	if (INT_UNEQUAL(rtptimeout)) {
-		ast_log(LOG_NOTICE, "Peers differ in rtptimeout: %d vs %d\n", peer1->rtptimeout, peer2->rtptimeout);
-		return 1;
-	}
-	if (INT_UNEQUAL(rtpholdtimeout)) {
-		ast_log(LOG_NOTICE, "Peers differ in rtpholdtimeout: %d vs %d\n", peer1->rtpholdtimeout, peer2->rtpholdtimeout);
-		return 1;
-	}
-	if (INT_UNEQUAL(rtpkeepalive)) {
-		ast_log(LOG_NOTICE, "Peers differ in rtpkeepalive: %d vs %d\n", peer1->rtpkeepalive, peer2->rtpkeepalive);
-		return 1;
-	}
-	if (INT_UNEQUAL(call_limit)) {
-		ast_log(LOG_NOTICE, "Peers differ in call_limit: %d vs %d\n", peer1->call_limit, peer2->call_limit);
-		return 1;
-	}
-	if (INT_UNEQUAL(callingpres)) {
-		ast_log(LOG_NOTICE, "Peers differ in callingpres: %d vs %d\n", peer1->callingpres, peer2->callingpres);
-		return 1;
-	}
-	if (INT_UNEQUAL(capability)) {
-		ast_log(LOG_NOTICE, "Peers differ in capability: %d vs %d\n", peer1->capability, peer2->capability);
-		return 1;
-	}
-	   
-	if ((peer1->flags[0].flags & peercmp_mask0) != (peer2->flags[0].flags & peercmp_mask0)) {
-		ast_log(LOG_NOTICE, "Peers differ in flags[0]: %x vs %x\n", peer1->flags[0].flags, peer2->flags[0].flags);
-		return 1;
-	}
-	if ((peer1->flags[1].flags & peercmp_mask1) != (peer2->flags[1].flags & peercmp_mask1)) {
-		ast_log(LOG_NOTICE, "Peers differ in flags[1]: %x vs %x\n", peer1->flags[1].flags, peer2->flags[1].flags);
-		return 1;
-	}
-
-	if ((peer1->ha && !peer2->ha) || (!peer1->ha && peer2->ha)) {
-		ast_log(LOG_NOTICE, "Peers differ in ha field: %p vs %p\n", peer1->ha, peer2->ha);
-		return 1;
-	}
-	if (peer1->ha && ast_hacmp(peer1->ha, peer2->ha)) {
-		return 1;
-	}
-	
-	if (peer1->allowtransfer != peer2->allowtransfer) {
-		ast_log(LOG_NOTICE, "Peers differ in allowtransfer: %d vs %d\n", peer1->allowtransfer, peer2->allowtransfer);
-		return 1;
-	}
-
-	if (peer1->callgroup != peer2->callgroup) {
-		ast_log(LOG_NOTICE, "Peers differ in callgroup: %lld vs %lld\n", peer1->callgroup, peer2->callgroup);
-		return 1;
-	}
-	if (peer1->pickupgroup != peer2->pickupgroup) {
-		ast_log(LOG_NOTICE, "Peers differ in pickupgroup: %lld vs %lld\n", peer1->pickupgroup, peer2->pickupgroup);
-		return 1;
-	}
-
-	if (ast_sockaddrcmp(&peer1->addr, &peer2->addr)) {
-		return 1;
-	}
-	if (ast_sockaddrcmp(&peer1->defaddr, &peer2->defaddr)) {
-		return 1;
-	}
-	
-	if ((peer1->outboundproxy && !peer2->outboundproxy) || (!peer1->outboundproxy && peer2->outboundproxy)) {
-		ast_log(LOG_NOTICE, "Peers differ in outboundproxy field: %p vs %p\n", peer1->outboundproxy, peer2->outboundproxy);
-		return 1;
-	}
-	if (peer1->outboundproxy && ast_proxycmp(peer1->outboundproxy, peer2->outboundproxy)) {
-		return 1;
-	}
-	
-	if ((peer1->auth && !peer2->auth) && (!peer1->auth && peer2->auth)) {
-		ast_log(LOG_NOTICE, "Peers differ in auth field: %p vs %p\n", peer1->auth, peer2->auth);
-		return 1;
-	}
-	if (peer1->auth && ast_authcmp(peer1->auth, peer2->auth)) {
-		return 1;
-	}
-
-	if (ast_codecprefcmp(&peer1->prefs, &peer2->prefs)) {
-		return 1;
-	}
-	
-	if (AST_LIST_EMPTY(&peer1->mailboxes) && !AST_LIST_EMPTY(&peer2->mailboxes)) {
-		ast_log(LOG_NOTICE, "Peers differ in mailbox data, one has data, the other not.\n");
-		return 1;
-	}
-	if (!AST_LIST_EMPTY(&peer1->mailboxes) && ast_mailboxescmp(peer1, peer2)) {
-		return 1;
-	}
-	
-	if ((!peer1->chanvars && peer2->chanvars) || (peer1->chanvars && !peer2->chanvars)) {
-		ast_log(LOG_NOTICE, "Peers differ in chanvars; one has some, one doesn't\n");
-		return 1;
-	}
-	if (peer1->chanvars && ast_varcmp(peer1->chanvars, peer2->chanvars)) {
-		return 1;
-	}
-	
-	return 0; /* return 0 for a match like strcmp, 1 otherwise */
-}
-
-
 static int peer_markall_func(void *userobj, void *arg, int flags)
 {
 	struct sip_peer *peer = userobj;




More information about the asterisk-commits mailing list