From 430f84808d9ed2ab16a6e0ab56e764aedbdfaac1 Mon Sep 17 00:00:00 2001 From: smorlat Date: Mon, 13 Jul 2009 20:38:59 +0000 Subject: [PATCH] print status for incoming calls pending. git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@536 3f6dc0c8-ddfe-455d-9043-3cd528dc4637 --- linphone/console/commands.c | 15 ++++++++++++++- linphone/console/linphonec.c | 1 + linphone/console/linphonec.h | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/linphone/console/commands.c b/linphone/console/commands.c index a07f9d69b..6d763f468 100644 --- a/linphone/console/commands.c +++ b/linphone/console/commands.c @@ -333,6 +333,7 @@ lpc_cmd_help(LinphoneCore *lc, char *arg) } static char callee_name[256]={0}; +static char caller_name[256]={0}; static int lpc_cmd_call(LinphoneCore *lc, char *args) @@ -360,10 +361,18 @@ lpc_cmd_call(LinphoneCore *lc, char *args) return 1; } -static const char *linphonec_get_callee(){ +const char *linphonec_get_callee(){ return callee_name; } +const char *linphonec_get_caller(){ + return caller_name; +} + +void linphonec_set_caller(const char *caller){ + snprintf(caller_name,sizeof(caller_name)-1,"%s",caller); +} + static int lpc_cmd_refer(LinphoneCore *lc, char *args) { @@ -1437,6 +1446,10 @@ static int lpc_cmd_status(LinphoneCore *lc, char *args) case GSTATE_CALL_IN_CONNECTED: linphonec_out("hook=answered duration=%i\n" , linphone_core_get_current_call_duration(lc)); + break; + case GSTATE_CALL_IN_INVITE: + linphonec_out("Incoming call from %s\n",linphonec_get_caller()); + break; default: break; } diff --git a/linphone/console/linphonec.c b/linphone/console/linphonec.c index f9295d4f7..5d380a7f7 100644 --- a/linphone/console/linphonec.c +++ b/linphone/console/linphonec.c @@ -216,6 +216,7 @@ linphonec_display_url (LinphoneCore * lc, const char *something, const char *url static void linphonec_call_received(LinphoneCore *lc, const char *from) { + linphonec_set_caller(from); if ( auto_answer) { answer_call=TRUE; } diff --git a/linphone/console/linphonec.h b/linphone/console/linphonec.h index 59306572c..8c1c7ca32 100644 --- a/linphone/console/linphonec.h +++ b/linphone/console/linphonec.h @@ -110,7 +110,7 @@ extern char *linphonec_readline(char *prompt); void linphonec_set_autoanswer(bool_t enabled); bool_t linphonec_get_autoanswer(); void linphonec_command_finished(void); - +void linphonec_set_caller(const char *caller); #endif /* def LINPHONEC_H */