diff options
| author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-09-11 15:22:00 +0300 | 
|---|---|---|
| committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-09-11 15:22:00 +0300 | 
| commit | b8e38926181408cd9b2ea93aa6015aaeee2399b2 (patch) | |
| tree | b4d2ba6510cbb8b3b9abd7cde460e5594fb9a19a | |
| parent | 0b3d10c5ef6262410e6799ee3e2037c4441b563d (diff) | |
Implement support for subscriber number request (AT+CNUM)
| -rw-r--r-- | audio/headset.c | 13 | ||||
| -rw-r--r-- | audio/telephony-dummy.c | 5 | ||||
| -rw-r--r-- | audio/telephony.h | 2 | 
3 files changed, 20 insertions, 0 deletions
diff --git a/audio/headset.c b/audio/headset.c index a7adffd9..f0eb0b7b 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -857,6 +857,18 @@ static int dtmf_tone(struct audio_device *device, const char *buf)  	return headset_send(hs, "\r\nOK\n\r");  } +static int subscriber_number(struct audio_device *device, const char *buf) +{ +	struct headset *hs = device->headset; + +	if (telephony_subscriber_number_req() < 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 }, @@ -871,6 +883,7 @@ static struct event event_callbacks[] = {  	{ "AT+BTRH", response_and_hold },  	{ "AT+BLDN", last_dialed_number },  	{ "AT+VTS", dtmf_tone }, +	{ "AT+CNUM", subscriber_number },  	{ 0 }  }; diff --git a/audio/telephony-dummy.c b/audio/telephony-dummy.c index f9e121bf..315501a4 100644 --- a/audio/telephony-dummy.c +++ b/audio/telephony-dummy.c @@ -119,6 +119,11 @@ int telephony_transmit_dtmf_req(char tone)  	return 0;  } +int telephony_subscriber_number_req(void) +{ +	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 94df9d2a..e2e208ae 100644 --- a/audio/telephony.h +++ b/audio/telephony.h @@ -95,6 +95,8 @@ int telephony_ready_ind(uint32_t features, const struct indicator *indicators,  int telephony_transmit_dtmf_req(char tone); +int telephony_subscriber_number_req(void); +  /* Helper function for quick indicator updates */  static inline int telephony_update_indicator(struct indicator *indicators,  						const char *desc,  | 
