diff -urN gnokii-0.6.14.orig/common/phones/atgen.c gnokii-0.6.14/common/phones/atgen.c --- gnokii-0.6.14.orig/common/phones/atgen.c 2006-08-28 00:36:54.000000000 +0200 +++ gnokii-0.6.14/common/phones/atgen.c 2007-01-04 14:31:37.723831751 +0100 @@ -29,6 +29,7 @@ Copyright (C) 2002-2004 BORBELY Zoltan Copyright (C) 2003-2004 Igor Popik Copyright (C) 2004 Hugo Hass, Ron Yorston + Copyright (C) 2007 Jeremy Laine This file provides functions specific to generic AT command compatible phones. See README for more details on supported mobile phones. @@ -102,6 +103,7 @@ static gn_error AT_AnswerCall(gn_data *data, struct gn_statemachine *state); static gn_error AT_CancelCall(gn_data *data, struct gn_statemachine *state); static gn_error AT_SetCallNotification(gn_data *data, struct gn_statemachine *state); +static gn_error AT_SendDTMF(gn_data *data, struct gn_statemachine *state); typedef struct { int gop; @@ -145,6 +147,7 @@ { GN_OP_AT_Ring, NULL, ReplyRing }, { GN_OP_SetCallNotification, AT_SetCallNotification, Reply }, { GN_OP_GetNetworkInfo, AT_GetNetworkInfo, ReplyGetNetworkInfo }, + { GN_OP_SendDTMF, AT_SendDTMF, Reply }, }; char *strip_quotes(char *s) @@ -1148,6 +1151,20 @@ return sm_block_no_retry(GN_OP_GetNetworkInfo, data, state); } +static gn_error AT_SendDTMF(gn_data *data, struct gn_statemachine *state) +{ + unsigned char req[32]; + + if (!data || !data->dtmf_string || strlen(data->dtmf_string) != 1) + return GN_ERR_INTERNALERROR; + + snprintf(req, sizeof(req), "AT+VTS=%c\r", data->dtmf_string[0]); + if (sm_message_send(strlen(req), GN_OP_SendDTMF, req, state)) + return GN_ERR_NOTREADY; + + return sm_block_no_retry(GN_OP_SendDTMF, data, state); +} + static gn_error ReplyReadPhonebook(int messagetype, unsigned char *buffer, int length, gn_data *data, struct gn_statemachine *state) { at_driver_instance *drvinst = AT_DRVINST(state);