diff options
| -rw-r--r-- | audio/headset.c | 18 | ||||
| -rw-r--r-- | audio/telephony-dummy.c | 6 | ||||
| -rw-r--r-- | audio/telephony.h | 2 | 
3 files changed, 26 insertions, 0 deletions
| diff --git a/audio/headset.c b/audio/headset.c index 4683c356..b90c1a9c 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -840,6 +840,23 @@ ok:  	return headset_send(hs, "\r\nOK\r\n");  } +static int dtmf_tone(struct audio_device *device, const char *buf) +{ +	struct headset *hs = device->headset; + +	if (strlen(buf) < 8) { +		error("Too short string for DTMF tone"); +		return -EINVAL; +	} + +	if (telephony_transmit_dtmf_req(buf[7]) < 0) { +		headset_send(hs, "\r\nERROR\r\n"); +		return 0; +	} + +	return headset_send(hs, "\r\nOK\n\r"); +} +  static struct event event_callbacks[] = {  	{ "ATA", answer_call },  	{ "ATD", dial_number }, @@ -853,6 +870,7 @@ static struct event event_callbacks[] = {  	{ "AT+CLIP", cli_notification },  	{ "AT+BTRH", response_and_hold },  	{ "AT+BLDN", last_dialed_number }, +	{ "AT+VTS", dtmf_tone },  	{ 0 }  }; diff --git a/audio/telephony-dummy.c b/audio/telephony-dummy.c index 701de220..f9e121bf 100644 --- a/audio/telephony-dummy.c +++ b/audio/telephony-dummy.c @@ -113,6 +113,12 @@ int telephony_dial_number_req(const char *number)  	return 0;  } +int telephony_transmit_dtmf_req(char tone) +{ +	debug("telephony-dummy: transmit dtmf: %c", tone); +	return 0; +} +  /* D-Bus method handlers */  static DBusMessage *outgoing_call(DBusConnection *conn, DBusMessage *msg,  					void *data) diff --git a/audio/telephony.h b/audio/telephony.h index 5cca4997..94df9d2a 100644 --- a/audio/telephony.h +++ b/audio/telephony.h @@ -93,6 +93,8 @@ int telephony_calling_stopped_ind(void);  int telephony_ready_ind(uint32_t features, const struct indicator *indicators,  			int rh); +int telephony_transmit_dtmf_req(char tone); +  /* Helper function for quick indicator updates */  static inline int telephony_update_indicator(struct indicator *indicators,  						const char *desc, | 
