summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/menu/menu.c9
-rw-r--r--src/ua.c20
2 files changed, 27 insertions, 2 deletions
diff --git a/modules/menu/menu.c b/modules/menu/menu.c
index bf64b28..ca1c1fa 100644
--- a/modules/menu/menu.c
+++ b/modules/menu/menu.c
@@ -286,7 +286,6 @@ static int options_command(struct re_printf *pf, void *arg)
return err;
}
-
static int cmd_answer(struct re_printf *pf, void *unused)
{
(void)pf;
@@ -468,7 +467,6 @@ static int call_reinvite(struct re_printf *pf, void *unused)
return call_modify(ua_call(uag_cur()));
}
-
static int call_mute(struct re_printf *pf, void *unused)
{
struct audio *audio = call_audio(ua_call(uag_cur()));
@@ -512,6 +510,12 @@ static int call_holdresume(struct re_printf *pf, void *arg)
return call_hold(ua_call(uag_cur()), 'x' == carg->key);
}
+static int hold_prev_call(struct re_printf *pf, void *unused)
+{
+ (void)pf;
+ (void)unused;
+ return call_hold(ua_prev_call(uag_cur()), true);
+}
#ifdef USE_VIDEO
static int call_videoenc_cycle(struct re_printf *pf, void *unused)
@@ -569,6 +573,7 @@ static const struct cmd callcmdv[] = {
{'m', 0, "Call mute/un-mute", call_mute },
{'r', CMD_IPRM,"Transfer call", call_xfer },
{'x', 0, "Call hold", call_holdresume },
+ {'H', 0, "Hold previous call", hold_prev_call },
#ifdef USE_VIDEO
{'E', 0, "Cycle video encoder", call_videoenc_cycle },
diff --git a/src/ua.c b/src/ua.c
index 5bdb991..2f86d33 100644
--- a/src/ua.c
+++ b/src/ua.c
@@ -922,6 +922,26 @@ struct call *ua_call(const struct ua *ua)
return NULL;
}
+struct call *ua_prev_call(const struct ua *ua)
+{
+ struct le *le;
+
+ if (!ua)
+ return NULL;
+
+ int prev = 0;
+ for (le = ua->calls.tail; le; le = le->prev) {
+ if( prev == 1){
+ struct call *call = le->data;
+ return call;
+ }
+ if( prev == 0)
+ prev = 1;
+ }
+
+ return NULL;
+}
+
int ua_debug(struct re_printf *pf, const struct ua *ua)
{