From c972e1a914b964c9b75c7de6c89978759fa0034b Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sun, 2 May 2010 01:43:11 +0000 Subject: [PATCH] Incoming calls are now reported as well --- src/gsm.c | 7 +++++++ src/gsm.h | 1 + src/phone.c | 1 + 3 files changed, 9 insertions(+) diff --git a/src/gsm.c b/src/gsm.c index f8cb987..3bd0a11 100644 --- a/src/gsm.c +++ b/src/gsm.c @@ -711,6 +711,8 @@ static int _gsm_event(GSM * gsm, GSMEventType type, ...) case GSM_EVENT_TYPE_FUNCTIONAL: event->functional.functional = va_arg(ap, unsigned int); break; + case GSM_EVENT_TYPE_INCOMING_CALL: + break; case GSM_EVENT_TYPE_MESSAGE_LIST: event->message_list.start = va_arg(ap, unsigned int); event->message_list.end = va_arg(ap, unsigned int); @@ -1357,6 +1359,11 @@ static int _gsm_parse_line(GSM * gsm, char const * line, gboolean * answered) *answered = FALSE; if(strncmp(line, "AT", 2) == 0) /* ignore echo (tighter check?) */ return 0; + if(strcmp(line, "RING") == 0) + { + _gsm_event(gsm, GSM_EVENT_TYPE_INCOMING_CALL); + return 0; + } if(strcmp(line, "OK") == 0) { if(answered != NULL) diff --git a/src/gsm.h b/src/gsm.h index 00aefcf..25691cf 100644 --- a/src/gsm.h +++ b/src/gsm.h @@ -32,6 +32,7 @@ typedef enum _GSMEventType GSM_EVENT_TYPE_CONTACT, GSM_EVENT_TYPE_CONTACT_LIST, GSM_EVENT_TYPE_FUNCTIONAL, + GSM_EVENT_TYPE_INCOMING_CALL, GSM_EVENT_TYPE_MESSAGE_LIST, GSM_EVENT_TYPE_MESSAGE_SENT, GSM_EVENT_TYPE_OPERATOR, diff --git a/src/phone.c b/src/phone.c index 99b762a..c0811f8 100644 --- a/src/phone.c +++ b/src/phone.c @@ -1100,6 +1100,7 @@ static int _phone_gsm_event(GSMEvent * event, gpointer data) event->contact_list.end); return 0; case GSM_EVENT_TYPE_FUNCTIONAL: + case GSM_EVENT_TYPE_INCOMING_CALL: /* FIXME implement */ return 0; case GSM_EVENT_TYPE_MESSAGE_LIST: