diff --git a/mbtk/mbtk_rild/src/main.c b/mbtk/mbtk_rild/src/main.c
index afff8d5..7a9cbdf 100755
--- a/mbtk/mbtk_rild/src/main.c
+++ b/mbtk/mbtk_rild/src/main.c
@@ -299,7 +299,7 @@
                         if(cgact_wait.cid != 0)
                         {
                             data_pdp = cgact_wait.cid + 200;
-                            urc_msg_distribute(false, INFO_URC_MSG_PDP_STATE, &data_pdp, sizeof(uint8));
+                            urc_msg_distribute(true, INFO_URC_MSG_PDP_STATE, &data_pdp, sizeof(uint8));
                         }
                     }
                 } else if(strStartsWith(s, "+CGEV: NW MODIFY ")) { // +CGEV: NW MODIFY 1,4
@@ -415,7 +415,7 @@
                     }
 
                     data_pdp = data[1] + 200;
-                    urc_msg_distribute(false, INFO_URC_MSG_PDP_STATE, &data_pdp, sizeof(uint8));
+                    urc_msg_distribute(true, INFO_URC_MSG_PDP_STATE, &data_pdp, sizeof(uint8));
 					data[1] = 0;
                 }
             } else {
diff --git a/mbtk/mbtk_rild/src/mbtk_info_server.c b/mbtk/mbtk_rild/src/mbtk_info_server.c
index f935a65..9eb165c 100755
--- a/mbtk/mbtk_rild/src/mbtk_info_server.c
+++ b/mbtk/mbtk_rild/src/mbtk_info_server.c
@@ -6101,6 +6101,7 @@
 
     return 0;
 #else
+
     if(async_process) {
         info_urc_msg_t *urc = (info_urc_msg_t*)malloc(sizeof(info_urc_msg_t));
         if(!urc)
@@ -6539,7 +6540,7 @@
 }
 */
 
-static void net_ifc_state_change(bool act, int cid)
+static void net_ifc_state_change(bool act, int cid, mbtk_pdp_act_info_t *act_info)
 {
     if(cid < MBTK_APN_CID_MIN || cid > MBTK_APN_CID_MAX) { // No nothing for cid 1 and 8
         return;
@@ -6588,6 +6589,12 @@
                 }
             }
 #endif
+
+            if(act_info) {
+                memcpy(&(act_info->ipv4), &ipv4, sizeof(mbtk_ipv4_info_t));
+                memcpy(&(act_info->ipv6), &ipv6, sizeof(mbtk_ipv6_info_t));
+            }
+
             // Config IPv4 address.
             if(ipv4.valid) {
                 char ip[20] = {0};
@@ -6663,14 +6670,20 @@
             LOG("Active cid : %d", cid);
             cgact_wait.waitting = true;
             cgact_wait.cid = cid;
-            net_ifc_state_change(false, cid);
+            net_ifc_state_change(false, cid, NULL);
             data_pdp = cid + 100;
             urc_msg_distribute(false, INFO_URC_MSG_PDP_STATE, &data_pdp, sizeof(uint8));
             req_data_call_start(cid, NULL);
             wait_cgact_complete(10);
-            net_ifc_state_change(true, cid);
+
+            mbtk_pdp_act_info_t act_info;
+            memset(&act_info, 0, sizeof(mbtk_pdp_act_info_t));
             data_pdp = cid + 220;
-            urc_msg_distribute(false, INFO_URC_MSG_PDP_STATE, &data_pdp, sizeof(uint8));
+            act_info.state = data_pdp;
+
+            net_ifc_state_change(true, cid, &act_info);
+
+            urc_msg_distribute(false, INFO_URC_MSG_PDP_STATE, &act_info, sizeof(mbtk_pdp_act_info_t));
         }
     }
     at_process = false;
@@ -6697,7 +6710,28 @@
             bool act = data[0];
             int cid = data[1];
             if(cid > 0) {
-                net_ifc_state_change(act, cid);
+                net_ifc_state_change(act, cid, NULL);
+            }
+            break;
+        }
+        case INFO_URC_MSG_PDP_STATE:
+        {
+            // pdp_state_change
+            mbtk_pdp_act_info_t act_info;
+            memset(&act_info, 0, sizeof(mbtk_pdp_act_info_t));
+            int cme_err = MBTK_INFO_ERR_CME_NON;
+            uint8 cid = *((uint8*)(msg->data));
+            act_info.state = cid;
+#if 0
+            if(cid > 220) {
+                cid -= 220;
+            } else { // > 200
+                cid -= 200;
+            }
+#endif
+            if(!req_data_call_state_get(cid, &(act_info.ipv4), &(act_info.ipv6), &cme_err) && cme_err == MBTK_INFO_ERR_CME_NON)
+            {
+                pdp_state_change(&act_info, sizeof(mbtk_pdp_act_info_t));
             }
             break;
         }
