---
 drivers/stemodem/voicecall.c | 77 +++++++++++++++++++++++---------------------
 1 file changed, 40 insertions(+), 37 deletions(-)

diff --git a/drivers/stemodem/voicecall.c b/drivers/stemodem/voicecall.c
index 356ab7c..eb4431c 100644
--- a/drivers/stemodem/voicecall.c
+++ b/drivers/stemodem/voicecall.c
@@ -82,28 +82,29 @@ static int call_status_ste_to_ofono(enum call_status_ste 
status)
        switch (status) {
        case STE_CALL_STATUS_IDLE:
        case STE_CALL_STATUS_RELEASED:
-               return CALL_STATUS_DISCONNECTED;
+               return OFONO_CALL_STATUS_DISCONNECTED;
        case STE_CALL_STATUS_CALLING:
-               return CALL_STATUS_DIALING;
+               return OFONO_CALL_STATUS_DIALING;
        case STE_CALL_STATUS_CONNECTING:
-               return CALL_STATUS_ALERTING;
+               return OFONO_CALL_STATUS_ALERTING;
        case STE_CALL_STATUS_ACTIVE:
-               return CALL_STATUS_ACTIVE;
+               return OFONO_CALL_STATUS_ACTIVE;
        case STE_CALL_STATUS_HOLD:
-               return CALL_STATUS_HELD;
+               return OFONO_CALL_STATUS_HELD;
        case STE_CALL_STATUS_WAITING:
-               return CALL_STATUS_WAITING;
+               return OFONO_CALL_STATUS_WAITING;
        case STE_CALL_STATUS_ALERTING:
-               return CALL_STATUS_INCOMING;
+               return OFONO_CALL_STATUS_INCOMING;
        case STE_CALL_STATUS_BUSY:
-               return CALL_STATUS_DISCONNECTED;
+               return OFONO_CALL_STATUS_DISCONNECTED;
        }
 
-       return CALL_STATUS_DISCONNECTED;
+       return OFONO_CALL_STATUS_DISCONNECTED;
 }
 
 static struct ofono_call *create_call(struct ofono_voicecall *vc, int type,
-                                       int direction, int status,
+                                       enum ofono_call_direction direction,
+                                       enum ofono_call_status status,
                                        const char *num, int num_type, int clip)
 {
        struct voicecall_data *d = ofono_voicecall_get_data(vc);
@@ -120,7 +121,7 @@ static struct ofono_call *create_call(struct 
ofono_voicecall *vc, int type,
        call->direction = direction;
        call->status = status;
 
-       if (clip != CLIP_VALIDITY_NOT_AVAILABLE) {
+       if (clip != OFONO_CLIP_VALIDITY_NOT_AVAILABLE) {
                strncpy(call->phone_number.number, num,
                        OFONO_MAX_PHONE_NUMBER_LENGTH);
                call->phone_number.type = num_type;
@@ -255,10 +256,10 @@ static void ste_hangup(struct ofono_voicecall *vc,
                        ofono_voicecall_cb_t cb, void *data)
 {
        unsigned int active_dial_alert_or_incoming =
-                       (1 << CALL_STATUS_ACTIVE) |
-                       (1 << CALL_STATUS_DIALING) |
-                       (1 << CALL_STATUS_ALERTING) |
-                       (1 << CALL_STATUS_INCOMING);
+                       (1 << OFONO_CALL_STATUS_ACTIVE) |
+                       (1 << OFONO_CALL_STATUS_DIALING) |
+                       (1 << OFONO_CALL_STATUS_ALERTING) |
+                       (1 << OFONO_CALL_STATUS_INCOMING);
 
        ste_template("AT+CHUP", vc, ste_generic_cb,
                        active_dial_alert_or_incoming, cb, data);
@@ -273,7 +274,7 @@ static void ste_hold_all_active(struct ofono_voicecall *vc,
 static void ste_release_all_held(struct ofono_voicecall *vc,
                                ofono_voicecall_cb_t cb, void *data)
 {
-       unsigned int held = 1 << CALL_STATUS_HELD;
+       unsigned int held = 1 << OFONO_CALL_STATUS_HELD;
 
        ste_template("AT+CHLD=0", vc, ste_generic_cb, held, cb, data);
 }
@@ -282,7 +283,8 @@ static void ste_set_udub(struct ofono_voicecall *vc,
                        ofono_voicecall_cb_t cb, void *data)
 {
        unsigned int incoming_or_waiting =
-                       (1 << CALL_STATUS_INCOMING) | (1 << 
CALL_STATUS_WAITING);
+                       (1 << OFONO_CALL_STATUS_INCOMING) |
+                       (1 << OFONO_CALL_STATUS_WAITING);
 
        ste_template("AT+CHLD=0", vc, ste_generic_cb, incoming_or_waiting,
                        cb, data);
@@ -291,7 +293,7 @@ static void ste_set_udub(struct ofono_voicecall *vc,
 static void ste_release_all_active(struct ofono_voicecall *vc,
                                        ofono_voicecall_cb_t cb, void *data)
 {
-       unsigned int active = 1 << CALL_STATUS_ACTIVE;
+       unsigned int active = 1 << OFONO_CALL_STATUS_ACTIVE;
 
        ste_template("AT+CHLD=1", vc, ste_generic_cb, active, cb, data);
 }
@@ -359,7 +361,8 @@ static void ste_deflect(struct ofono_voicecall *vc,
 {
        char buf[128];
        unsigned int incoming_or_waiting =
-               (1 << CALL_STATUS_INCOMING) | (1 << CALL_STATUS_WAITING);
+               (1 << OFONO_CALL_STATUS_INCOMING) |
+               (1 << OFONO_CALL_STATUS_WAITING);
 
        snprintf(buf, sizeof(buf), "AT+CTFR=\"%s\",%d", ph->number, ph->type);
        ste_template(buf, vc, ste_generic_cb, incoming_or_waiting, cb, data);
@@ -442,9 +445,9 @@ static void ecav_notify(GAtResult *result, gpointer 
user_data)
 
        status = call_status_ste_to_ofono(status);
 
-       if (status == CALL_STATUS_DIALING ||
-                       status == CALL_STATUS_WAITING ||
-                       status == CALL_STATUS_INCOMING) {
+       if (status == OFONO_CALL_STATUS_DIALING ||
+                       status == OFONO_CALL_STATUS_WAITING ||
+                       status == OFONO_CALL_STATUS_INCOMING) {
                /*
                 * If caller uses hidden id, the number and
                 * number type might not be present. Don't
@@ -467,16 +470,16 @@ static void ecav_notify(GAtResult *result, gpointer 
user_data)
        if (l)
                existing_call = l->data;
 
-       if (l == NULL && status != CALL_STATUS_DIALING &&
-                               status != CALL_STATUS_WAITING &&
-                               status != CALL_STATUS_INCOMING) {
+       if (l == NULL && status != OFONO_CALL_STATUS_DIALING &&
+                               status != OFONO_CALL_STATUS_WAITING &&
+                               status != OFONO_CALL_STATUS_INCOMING) {
                ofono_error("ECAV notification for unknown call."
                                " id: %d, status: %d", id, status);
                return;
        }
 
        switch (status) {
-       case CALL_STATUS_DISCONNECTED: {
+       case OFONO_CALL_STATUS_DISCONNECTED: {
                enum ofono_disconnect_reason reason;
 
                existing_call->status = status;
@@ -495,21 +498,21 @@ static void ecav_notify(GAtResult *result, gpointer 
user_data)
                break;
        }
 
-       case CALL_STATUS_DIALING:
-       case CALL_STATUS_WAITING:
-       case CALL_STATUS_INCOMING: {
+       case OFONO_CALL_STATUS_DIALING:
+       case OFONO_CALL_STATUS_WAITING:
+       case OFONO_CALL_STATUS_INCOMING: {
                int clip_validity;
                int direction;
 
-               if (status == CALL_STATUS_DIALING)
-                       direction = CALL_DIRECTION_MOBILE_ORIGINATED;
+               if (status == OFONO_CALL_STATUS_DIALING)
+                       direction = OFONO_CALL_DIRECTION_MOBILE_ORIGINATED;
                else
-                       direction = CALL_DIRECTION_MOBILE_TERMINATED;
+                       direction = OFONO_CALL_DIRECTION_MOBILE_TERMINATED;
 
                if (strlen(num) > 0)
-                       clip_validity = CLIP_VALIDITY_VALID;
+                       clip_validity = OFONO_CLIP_VALIDITY_VALID;
                else
-                       clip_validity = CLIP_VALIDITY_NOT_AVAILABLE;
+                       clip_validity = OFONO_CLIP_VALIDITY_NOT_AVAILABLE;
 
                new_call = create_call(vc, call_type, direction, status,
                                        num, num_type, clip_validity);
@@ -524,9 +527,9 @@ static void ecav_notify(GAtResult *result, gpointer 
user_data)
                break;
        }
 
-       case CALL_STATUS_ALERTING:
-       case CALL_STATUS_ACTIVE:
-       case CALL_STATUS_HELD:
+       case OFONO_CALL_STATUS_ALERTING:
+       case OFONO_CALL_STATUS_ACTIVE:
+       case OFONO_CALL_STATUS_HELD:
                existing_call->status = status;
                ofono_voicecall_notify(vc, existing_call);
                break;
-- 
1.9.1

_______________________________________________
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono

Reply via email to