Incoming calls are now reported as well

This commit is contained in:
Pierre Pronchery 2010-05-02 01:43:11 +00:00
parent 1de8062925
commit c972e1a914
3 changed files with 9 additions and 0 deletions

View File

@ -711,6 +711,8 @@ static int _gsm_event(GSM * gsm, GSMEventType type, ...)
case GSM_EVENT_TYPE_FUNCTIONAL: case GSM_EVENT_TYPE_FUNCTIONAL:
event->functional.functional = va_arg(ap, unsigned int); event->functional.functional = va_arg(ap, unsigned int);
break; break;
case GSM_EVENT_TYPE_INCOMING_CALL:
break;
case GSM_EVENT_TYPE_MESSAGE_LIST: case GSM_EVENT_TYPE_MESSAGE_LIST:
event->message_list.start = va_arg(ap, unsigned int); event->message_list.start = va_arg(ap, unsigned int);
event->message_list.end = 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; *answered = FALSE;
if(strncmp(line, "AT", 2) == 0) /* ignore echo (tighter check?) */ if(strncmp(line, "AT", 2) == 0) /* ignore echo (tighter check?) */
return 0; return 0;
if(strcmp(line, "RING") == 0)
{
_gsm_event(gsm, GSM_EVENT_TYPE_INCOMING_CALL);
return 0;
}
if(strcmp(line, "OK") == 0) if(strcmp(line, "OK") == 0)
{ {
if(answered != NULL) if(answered != NULL)

View File

@ -32,6 +32,7 @@ typedef enum _GSMEventType
GSM_EVENT_TYPE_CONTACT, GSM_EVENT_TYPE_CONTACT,
GSM_EVENT_TYPE_CONTACT_LIST, GSM_EVENT_TYPE_CONTACT_LIST,
GSM_EVENT_TYPE_FUNCTIONAL, GSM_EVENT_TYPE_FUNCTIONAL,
GSM_EVENT_TYPE_INCOMING_CALL,
GSM_EVENT_TYPE_MESSAGE_LIST, GSM_EVENT_TYPE_MESSAGE_LIST,
GSM_EVENT_TYPE_MESSAGE_SENT, GSM_EVENT_TYPE_MESSAGE_SENT,
GSM_EVENT_TYPE_OPERATOR, GSM_EVENT_TYPE_OPERATOR,

View File

@ -1100,6 +1100,7 @@ static int _phone_gsm_event(GSMEvent * event, gpointer data)
event->contact_list.end); event->contact_list.end);
return 0; return 0;
case GSM_EVENT_TYPE_FUNCTIONAL: case GSM_EVENT_TYPE_FUNCTIONAL:
case GSM_EVENT_TYPE_INCOMING_CALL:
/* FIXME implement */ /* FIXME implement */
return 0; return 0;
case GSM_EVENT_TYPE_MESSAGE_LIST: case GSM_EVENT_TYPE_MESSAGE_LIST: