]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix a couple of CCSS issues.
authorMark Michelson <mmichelson@digium.com>
Mon, 20 Dec 2010 21:38:30 +0000 (21:38 +0000)
committerMark Michelson <mmichelson@digium.com>
Mon, 20 Dec 2010 21:38:30 +0000 (21:38 +0000)
* Make sure to allocate a cc_params structure
  when creating autopeers.

* Use sip_uri_cmp when retrieving SIP CC agents
  and monitors in case parameters appear in the
  URI.

(closes issue #18504)
Reported by: kkm

(closes issue #18338)
Reported by: GeorgeKonopacki
Patches:
      18338.diff uploaded by mmichelson (license 60)
Tested by: GeorgeKonopacki

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@299248 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 86f86e0a5d5eb326720841b034e4faa928340895..f33ffbf7abace510a98db8f18f874140bb79b7a6 100644 (file)
@@ -1625,7 +1625,7 @@ static int find_by_notify_uri_helper(void *obj, void *arg, int flags)
        struct sip_cc_agent_pvt *agent_pvt = agent->private_data;
        const char *uri = arg;
 
-       return !strcmp(agent_pvt->notify_uri, uri) ? CMP_MATCH | CMP_STOP : 0;
+       return !sip_uri_cmp(agent_pvt->notify_uri, uri) ? CMP_MATCH | CMP_STOP : 0;
 }
 
 static struct ast_cc_agent *find_sip_cc_agent_by_notify_uri(const char * const uri)
@@ -1640,7 +1640,7 @@ static int find_by_subscribe_uri_helper(void *obj, void *arg, int flags)
        struct sip_cc_agent_pvt *agent_pvt = agent->private_data;
        const char *uri = arg;
 
-       return !strcmp(agent_pvt->subscribe_uri, uri) ? CMP_MATCH | CMP_STOP : 0;
+       return !sip_uri_cmp(agent_pvt->subscribe_uri, uri) ? CMP_MATCH | CMP_STOP : 0;
 }
 
 static struct ast_cc_agent *find_sip_cc_agent_by_subscribe_uri(const char * const uri)
@@ -25670,6 +25670,11 @@ static struct sip_peer *temp_peer(const char *name)
                ao2_t_ref(peer, -1, "failed to string_field_init, drop peer");
                return NULL;
        }
+       
+       if (!(peer->cc_params = ast_cc_config_params_init())) {
+               ao2_t_ref(peer, -1, "failed to allocate cc_params for peer");
+               return NULL;
+       }
 
        ast_atomic_fetchadd_int(&apeerobjs, 1);
        set_peer_defaults(peer);