feat: create cook branch
This commit is contained in:
@@ -73,17 +73,15 @@ static int ta_init_peer_addr(struct peer_info* inf)
|
||||
static void peer_free_cb(struct peer_info *died_peer, void *cb_data)
|
||||
{
|
||||
LOG_N("peer_free_cb.%p %p", died_peer, cb_data);
|
||||
SH_CONF_S *ptr = (SH_CONF_S *)cb_data;
|
||||
if(NULL == died_peer && MODE_CLI == ta_conf->mode)
|
||||
{
|
||||
struct peer_info inf;
|
||||
memset(&inf, 0, sizeof(inf));
|
||||
inf.pi_diamid = strdup(ptr->pi_diamid_peer);//strdup(g_sh_conf_ext.pi_diamid_peer);
|
||||
inf.pi_diamid = strdup(g_sh_conf_ext.pi_diamid_peer);
|
||||
inf.config.pic_flags.sec = PI_SEC_NONE;
|
||||
inf.config.pic_port = ptr->peer_port;
|
||||
// ta_init_peer_addr( (struct peer_info*)(&inf.pi_endpoints) );
|
||||
|
||||
ASSERT( 0 == fd_peer_add(&inf, __FILE__, peer_free_cb, ptr));//NULL));
|
||||
ASSERT( 0 == fd_peer_add(&inf, __FILE__, peer_free_cb, NULL));
|
||||
}
|
||||
}
|
||||
static int ta_conf_init(void)
|
||||
@@ -101,74 +99,14 @@ static int ta_conf_init(void)
|
||||
ta_conf->mode = g_sh_conf_ext.mode;
|
||||
/* fj added 20170114. only diameter client connect to peer. In this case, connect to peer when started. */
|
||||
if(MODE_CLI == ta_conf->mode)
|
||||
{
|
||||
if (g_sh_conf_ext.pi_diamid_peer != NULL)
|
||||
{
|
||||
struct peer_info inf;
|
||||
memset(&inf, 0, sizeof(inf));
|
||||
inf.pi_diamid = strdup(g_sh_conf_ext.pi_diamid_peer);
|
||||
inf.config.pic_flags.sec = PI_SEC_NONE;
|
||||
inf.config.pic_port = g_sh_conf_ext.peer_port;
|
||||
// ta_init_peer_addr( (struct peer_info*)(&inf.pi_endpoints) );
|
||||
|
||||
ASSERT( 0 == fd_peer_add(&inf, __FILE__, peer_free_cb, &g_sh_conf_ext));
|
||||
}
|
||||
|
||||
int i=0;
|
||||
SH_CONF_S *pcfg = NULL;
|
||||
for (i=0; i<rolkset.smslknum; i++)
|
||||
{
|
||||
pcfg = &rolkset.smslk[i].cfg;
|
||||
if (pcfg->pi_diamid_peer != NULL)
|
||||
{
|
||||
struct peer_info inf;
|
||||
memset(&inf, 0, sizeof(inf));
|
||||
inf.pi_diamid = strdup(pcfg->pi_diamid_peer);
|
||||
inf.config.pic_flags.sec = PI_SEC_NONE;
|
||||
inf.config.pic_port = pcfg->peer_port;
|
||||
// ta_init_peer_addr( (struct peer_info*)(&inf.pi_endpoints) );
|
||||
|
||||
ASSERT( 0 == fd_peer_add(&inf, __FILE__, peer_free_cb, pcfg));
|
||||
}
|
||||
}
|
||||
for (i=0; i<rolkset.voicelknum; i++)
|
||||
{
|
||||
pcfg = &rolkset.voicelk[i].cfg;
|
||||
if (pcfg->pi_diamid_peer != NULL)
|
||||
{
|
||||
struct peer_info inf;
|
||||
memset(&inf, 0, sizeof(inf));
|
||||
inf.pi_diamid = strdup(pcfg->pi_diamid_peer);
|
||||
inf.config.pic_flags.sec = PI_SEC_NONE;
|
||||
inf.config.pic_port = pcfg->peer_port;
|
||||
// ta_init_peer_addr( (struct peer_info*)(&inf.pi_endpoints) );
|
||||
|
||||
ASSERT( 0 == fd_peer_add(&inf, __FILE__, peer_free_cb, pcfg));
|
||||
}
|
||||
}
|
||||
/*if (g_rosms_conf_ext.pi_diamid_peer != NULL)
|
||||
{
|
||||
struct peer_info inf;
|
||||
memset(&inf, 0, sizeof(inf));
|
||||
inf.pi_diamid = strdup(g_rosms_conf_ext.pi_diamid_peer);
|
||||
inf.config.pic_flags.sec = PI_SEC_NONE;
|
||||
inf.config.pic_port = g_rosms_conf_ext.peer_port;
|
||||
// ta_init_peer_addr( (struct peer_info*)(&inf.pi_endpoints) );
|
||||
|
||||
ASSERT( 0 == fd_peer_add(&inf, __FILE__, peer_free_cb, &g_rosms_conf_ext));
|
||||
}
|
||||
|
||||
if (g_rovoice_conf_ext.pi_diamid_peer != NULL)
|
||||
{
|
||||
struct peer_info inf;
|
||||
memset(&inf, 0, sizeof(inf));
|
||||
inf.pi_diamid = strdup(g_rovoice_conf_ext.pi_diamid_peer);
|
||||
inf.config.pic_flags.sec = PI_SEC_NONE;
|
||||
inf.config.pic_port = g_rovoice_conf_ext.peer_port;
|
||||
// ta_init_peer_addr( (struct peer_info*)(&inf.pi_endpoints) );
|
||||
|
||||
ASSERT( 0 == fd_peer_add(&inf, __FILE__, peer_free_cb, &g_rovoice_conf_ext));
|
||||
}*/
|
||||
ASSERT( 0 == fd_peer_add(&inf, __FILE__, peer_free_cb, NULL));
|
||||
}
|
||||
|
||||
ta_conf->dest_realm = strdup(fd_g_config->cnf_diamrlm);
|
||||
|
||||
Reference in New Issue
Block a user