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: