From bb8329e91c09a180733716fcdf0c24c4facd5cc9 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Wed, 9 Aug 2017 18:43:03 +0200 Subject: sccp: fix creating of the default route in simple client The simple client (osmo_sccp_simple_client_on_ss7_id() and osmo_sccp_simple_client) does not create a default route if the user has already created an AS via VTY. Check the presence of a default route independently of the AS. If no default route exists, create one. Change-Id: I7516fa5509bade4ba10e9d8eaa3e46cfe3696b3a --- src/sccp_user.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/sccp_user.c b/src/sccp_user.c index 1414572..1d59d3c 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -368,16 +368,20 @@ osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, goto out_ss7; } as->cfg.routing_key.pc = ss7->cfg.primary_pc; + } + LOGP(DLSCCP, LOGL_NOTICE, "%s: Using AS instance %s\n", name, + as->cfg.name); - /* install default route */ + /* Create a default route if necessary */ + rt = osmo_ss7_route_find_dpc_mask(ss7->rtable_system, 0, 0); + if (!rt) { + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating default route\n", name); rt = osmo_ss7_route_create(ss7->rtable_system, 0, 0, as->cfg.name); if (!rt) goto out_as; rt_created = true; } - LOGP(DLSCCP, LOGL_NOTICE, "%s: Using AS instance %s\n", name, - as->cfg.name); /* Check if we do already have an application server process * that is associated with the application server we have choosen -- cgit v1.2.3