Index: /pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php	(revision 767)
+++ /pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php	(revision 768)
@@ -435,5 +435,5 @@
 	}
 	
-	public function insertSmslog($sentNumber, $serviceID, $commandcode, $info, $receiveTime) {
+	public function insertSmslog($sentNumber, $serviceID, $commandcode, $info, $receiveTime, $mtbody = null, $responseTime = null) {
 		if (preg_match ( '/^(84)([0-9]{9,10})$/', $sentNumber, $aryMatch ) == 1) {
 			$sentNumber = '0' . $aryMatch [2];
@@ -452,6 +452,9 @@
 		$smslog ['info'] = $info;
 		$smslog ['created_time'] = $receiveTime;
-		$this->db->query ( 'UNLOCK TABLES' );
-		$sql = 'INSERT INTO tblsmslog(sender, us_id, service_id, commandcode, info, created_time) VALUES(?,?,?,?,?,?)';
+		$smslog ['mtbody'] = $mtbody;
+		$smslog ['response_time'] = $responseTime;
+		
+		$this->db->query ( 'UNLOCK TABLES' );
+		$sql = 'INSERT INTO tblsmslog(sender, us_id, service_id, commandcode, info, created_time, mtbody, response_time) VALUES(?,?,?,?,?,?,?,?)';
 		$query = $this->db->query($sql, $smslog);
 	}
Index: /pro-violet-viettel/sourcecode/application/modules/services/controllers/viettel.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/services/controllers/viettel.php	(revision 767)
+++ /pro-violet-viettel/sourcecode/application/modules/services/controllers/viettel.php	(revision 768)
@@ -80,9 +80,13 @@
 			$CI->load->model ( 'Services_model' );
 			$CI->load->model ( 'frontend/User_model', 'objUserModel' );
-			$result = $CI->Services_model->processMORequest ( $userID, $info );
-			error_log ( date ( 'Y-m-d H:i:s' ) . ' -- INFO VAR: ' . var_export ( $info, TRUE ) . "\n\n", 3, '/srv/www/sbg/log/sms.log' );
-			$CI->objUserModel->insertSmslog ( $receiverID, $serviceID, $commandCode, $info, $receiveTime );
 			
+			$mtBody = '';
+			$result = $CI->Services_model->processMORequest ( $userID, $info , $mtBody);
+			$responseTime = date ( 'Y-m-d H:i:s' );
+			error_log ( $responseTime . ' -- INFO VAR: ' . var_export ( $info, TRUE ) . "\n\n", 3, '/srv/www/sbg/log/sms.log' );
 			$aryResult = explode ( '|', $result );
+
+			$CI->objUserModel->insertSmslog ( $receiverID, $serviceID, $commandCode, $info, $receiveTime , $mtBody, $responseTime);
+			
 			return $aryResult [0] . '|' . $msgType . '|' . $aryResult [1];
 		}
Index: /pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php	(revision 767)
+++ /pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php	(revision 768)
@@ -101,5 +101,5 @@
 	 * @return string
 	 */
-	public function processMORequest ($sentNumber, $message) 
+	public function processMORequest ($sentNumber, $message, &$mtBody = null) 
 	{
 		$debugMsg = $message."\n";
@@ -133,6 +133,9 @@
 					$smsReturn = $collaboratorMsg;
 					$arySMS = explode ('|', $sms);
-					if ((int)$arySMS[0] == 1 )
-						$sendMT = $this->sendMT($this->formatPhoneNumber($userName, -1), $arySMS[1]);
+					if ((int)$arySMS[0] == 1 ) {
+						$mtBody = $arySMS[1];
+						$sendMT = $this->sendMT($this->formatPhoneNumber($userName, -1), $mtBody);
+					}
+										
 				}
 				else {
@@ -141,5 +144,5 @@
 
 				break;
-			case _SBG_MO_PHONENUM_CHANGE:
+			/* case _SBG_MO_PHONENUM_CHANGE:
 				if (!preg_match('/^(09\d{8}|01\d{9})$/', $aryContents[0])) {
 					$smsReturn = _SBG_MO_PROCCESS_ERR.'|'.lang('_SBG_MO_PHONENUM_WRONG_FORMAT_MSG');
@@ -157,5 +160,5 @@
 				$sms = preg_replace($aryPatterns, array($sentNumber), lang('_SBG_MO_USER_OLD_PHONENUM_CHANGE_SUCCESS_MSG'));
 				$sendMT = $changeResult == 1 ? $this->sendMT($this->formatPhoneNumber($oldPhoneNumber, -1), $sms) : '';
-				break;
+				break; */
 			case _SBG_MO_PASSWORD_RECOVERY:
 				$smsReturn = $this->objUserModel->changePassword($sentNumber);
@@ -170,5 +173,5 @@
 
 				if (trim($arySmsReturn[1]) == trim(lang('_SBG_MO_USER_REGISTER_VIP_FAIL_NOT_ENOUGH_MSG'))) {
-					
+					$maxCharging = 50000;
 					$amount = $packageData ['p_price'];
 					$count = $amount > $maxCharging ? ceil($amount/ _SBG_CHARGING_MAX_VALUE) : 1;
@@ -216,4 +219,5 @@
 						$aryPatterns = array('/:amount:/', '/:sentNumber:/');
 						$smsMT = preg_replace($aryPatterns, array($amount, $sentNumber), lang('_SBG_MO_PAY_TO_ACCOUNT_FOR_MSG'));
+						$mtBody = $smsMT;
 						$sendMT = $this->sendMT($this->formatPhoneNumber($userName, -1), $smsMT);
 						$smsReturn = $arySmsReturn[0].'|'.preg_replace(array('/:amount:/','/:username:/'), array($amount, $userName), lang('_SBG_MO_PAY_TO_ACCOUNT_FOR_OTHER_SUCCESS_MSG'));
@@ -252,4 +256,6 @@
 				break;
 		}
+		
+		$mtBody = $smsReturn . "\n" . $mtBody;
 		
 		return $smsReturn.'|'.$case;
