diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-03-09 14:59:44 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2018-03-10 05:17:38 +0100 |
commit | d656dff235cbd3d18c929c718a25cfcdeef60e9a (patch) | |
tree | d1557e8a3e13530f454132916c45c47cf9a32bbe /src/libmsc/vty_interface_layer3.c | |
parent | e9495388d9fdcf9b3abe3919faa0b6ec2a7fa416 (diff) |
silent call: clarify rc and error messages logged on vty
In gsm_silent_call_{start,stop}(), return meaningful error codes and interpret
them on the VTY to clearly indicate the result.
Change-Id: Id5abb8f2ba901689e03040af8e51483b6c618e7f
Diffstat (limited to 'src/libmsc/vty_interface_layer3.c')
-rw-r--r-- | src/libmsc/vty_interface_layer3.c | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index 06a426765..05f5b63cf 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -524,16 +524,20 @@ DEFUN(subscriber_silent_call_start, type = RSL_CHANNEED_ANY; /* Defaults to ANY */ rc = gsm_silent_call_start(vsub, vty, type); - if (rc <= 0) { - vty_out(vty, "%% Subscriber not attached%s", - VTY_NEWLINE); - vlr_subscr_put(vsub); - return CMD_WARNING; + switch (rc) { + case -ENODEV: + vty_out(vty, "%% Subscriber not attached%s", VTY_NEWLINE); + break; + default: + if (rc) + vty_out(vty, "%% Cannot start silent call (rc=%d)%s", rc, VTY_NEWLINE); + else + vty_out(vty, "%% Silent call initiated%s", VTY_NEWLINE); + break; } vlr_subscr_put(vsub); - - return CMD_SUCCESS; + return rc ? CMD_WARNING : CMD_SUCCESS; } DEFUN(subscriber_silent_call_stop, @@ -553,14 +557,24 @@ DEFUN(subscriber_silent_call_stop, } rc = gsm_silent_call_stop(vsub); - if (rc < 0) { - vlr_subscr_put(vsub); - return CMD_WARNING; + switch (rc) { + case -ENODEV: + vty_out(vty, "%% No active connection for subscriber%s", VTY_NEWLINE); + break; + case -ENOENT: + vty_out(vty, "%% Subscriber has no silent call active%s", + VTY_NEWLINE); + break; + default: + if (rc) + vty_out(vty, "%% Cannot stop silent call (rc=%d)%s", rc, VTY_NEWLINE); + else + vty_out(vty, "%% Silent call stopped%s", VTY_NEWLINE); + break; } vlr_subscr_put(vsub); - - return CMD_SUCCESS; + return rc ? CMD_WARNING : CMD_SUCCESS; } DEFUN(subscriber_ussd_notify, |