SUA: Our SUA implementation needs an SCCP instance in ss7_instance

So when we create a xua_server for SUA, we must make sure to create that
associated SCCP instance, if it doesn't already exist.  End-user
programs probably normally call this during their initialization anyway,
but in something like OsmoSTP, we need to auto-create it.

Change-Id: Ib575763dbd00f5bd7bfbf48f227a8f5ef9528e2a
This commit is contained in:
Harald Welte 2017-04-17 10:42:30 +02:00
parent 6548d1b9c4
commit afc3b85613
1 changed files with 9 additions and 0 deletions

View File

@ -1033,6 +1033,11 @@ osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name,
asp->cfg.proto = proto;
asp->cfg.name = talloc_strdup(asp, name);
llist_add_tail(&asp->list, &inst->asp_list);
/* The SUA code internally needs SCCP to work */
if (proto == OSMO_SS7_ASP_PROT_SUA && !inst->sccp)
inst->sccp = osmo_sccp_instance_create(inst, NULL);
}
return asp;
}
@ -1617,6 +1622,10 @@ osmo_ss7_xua_server_create(struct osmo_ss7_instance *inst, enum osmo_ss7_asp_pro
oxs->inst = inst;
llist_add_tail(&oxs->list, &inst->xua_servers);
/* The SUA code internally needs SCCP to work */
if (proto == OSMO_SS7_ASP_PROT_SUA && !inst->sccp)
inst->sccp = osmo_sccp_instance_create(inst, NULL);
return oxs;
}