diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-02-16 22:23:52 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-02-17 19:34:27 +0100 |
commit | ab7c601118ef19414e8c83fe7f93415f5061b04c (patch) | |
tree | 74850f4e2ddc8d596d80ec0be22b2e008d9a3bc2 /src/ss7_application.c | |
parent | a7bc3aafdc79c04e038eab741ed8f428c13751c0 (diff) |
ss7: Provide a way to start the application
Diffstat (limited to 'src/ss7_application.c')
-rw-r--r-- | src/ss7_application.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/src/ss7_application.c b/src/ss7_application.c index 49ae4c1..1eb7ec9 100644 --- a/src/ss7_application.c +++ b/src/ss7_application.c @@ -127,7 +127,6 @@ static int ss7_app_setup_stp(struct ss7_application *app, app->type = APP_STP; app->bsc->m2ua_trans->started = 1; - /* TODO: start the applications here */ return 0; } @@ -202,7 +201,6 @@ static int ss7_app_setup_relay(struct ss7_application *app, int type, app->type = type; - /* TODO: start the applications here */ return 0; } @@ -225,3 +223,34 @@ int ss7_application_setup(struct ss7_application *ss7, int type, return -1; } } + + +static void start_mtp(struct mtp_link_set *set) +{ + struct mtp_link *link; + + llist_for_each_entry(link, &set->links, entry) + link->reset(link); +} + +static void start_msc(struct msc_connection *msc) +{ + msc_connection_start(msc); +} + +int ss7_application_start(struct ss7_application *app) +{ + if (app->route_src.set) + start_mtp(app->route_src.set); + if (app->route_dst.set) + start_mtp(app->route_dst.set); + + if (app->route_src.msc) + start_msc(app->route_src.msc); + if (app->route_dst.msc) + start_msc(app->route_dst.msc); + + LOGP(DINP, LOGL_NOTICE, "SS7 Application %d/%s is now running.\n", + app->nr, app->name); + return 0; +} |