diff options
author | Andrzej Zaborowski <andrew.zaborowski@intel.com> | 2009-08-05 09:08:40 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-08-05 13:33:35 -0500 |
commit | d0b91bfbc8d7e3a7c75c51b14932e25551d2233c (patch) | |
tree | a4c9fa3e3ec91f178e52c748ffbfb4ebae06ecf3 /src/message-waiting.c | |
parent | 9a55de9cd01af55f8abf9c94bca4ff96aad33355 (diff) | |
download | ofono-d0b91bfbc8d7e3a7c75c51b14932e25551d2233c.tar.bz2 |
Attempt to update MBDN based on Enhanced VM IEI
Diffstat (limited to 'src/message-waiting.c')
-rw-r--r-- | src/message-waiting.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/message-waiting.c b/src/message-waiting.c index ec1da395..f5f61b2a 100644 --- a/src/message-waiting.c +++ b/src/message-waiting.c @@ -618,6 +618,7 @@ static void handle_enhanced_voicemail_iei(struct ofono_modem *modem, { int profile, n; gboolean set; + struct sms_address mailbox_address; if (length < 3) return; @@ -633,9 +634,10 @@ static void handle_enhanced_voicemail_iei(struct ofono_modem *modem, if (discard) *discard = (iei[0] & (1 << 4)) ? FALSE : TRUE; - /* TODO: VM_MAILBOX_ACCESS_ADDRESS */ - n = 2 + (iei[1] + 1) / 2; - if (length < n + 11) + /* VM_MAILBOX_ACCESS_ADDRESS */ + n = 0; + if (!sms_decode_address_field(iei + 1, length - 1, &n, + FALSE, &mailbox_address)) return; /* TODO: VM_MESSAGE_PRIORITY_INDICATION */ @@ -655,9 +657,10 @@ static void handle_enhanced_voicemail_iei(struct ofono_modem *modem, if (discard) *discard = (iei[0] & (1 << 4)) ? FALSE : TRUE; - /* TODO: VM_MAILBOX_ACCESS_ADDRESS */ - n = 2 + (iei[1] + 1) / 2; - if (length < n + 11) + /* VM_MAILBOX_ACCESS_ADDRESS */ + n = 0; + if (!sms_decode_address_field(iei + 1, length - 1, &n, + FALSE, &mailbox_address)) return; /* Other parameters currently not supported */ @@ -666,6 +669,10 @@ static void handle_enhanced_voicemail_iei(struct ofono_modem *modem, mw_set_indicator(modem, profile, SMS_MWI_TYPE_VOICE, set, iei[n + 2]); } + + if (mailbox_address.address[0] != '\0') + set_mbdn(modem, SMS_MWI_TYPE_VOICE, + sms_address_to_string(&mailbox_address), NULL); } void ofono_handle_sms_mwi(struct ofono_modem *modem, |