Index: pro-violet-viettel/sourcecode/application/modules/services/controllers/sendmessage.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/services/controllers/sendmessage.php	(revision 457)
+++ pro-violet-viettel/sourcecode/application/modules/services/controllers/sendmessage.php	(revision 460)
@@ -18,4 +18,5 @@
 	public function testmo() {
 		$url = 'http://10.58.38.162/violetservice/soanbai/mo';
+		//$url = 'http://10.58.38.162/services/viettel';
 		//$url = 'http://viettel.violet.vn/violetservice/soanbai/mo';
 		$aryParams = array(
@@ -42,5 +43,4 @@
 		$client->operation = $operation;
 		$result = $client->send($this->_xmlHeader.$xml, $operation);		
-		
 		//$result = $client->call('MOReceiver', $aryParams ,$operator ,$operation);
 		
@@ -102,5 +102,4 @@
 	public function topup () 
 	{
-		$url = $this->config->item('topup_service_url');
 		$operator = 'TopupService';
 		$operation = 'http://tempuri.org/ITopupService/TopUp';
Index: pro-violet-viettel/sourcecode/application/modules/services/controllers/viettel.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/services/controllers/viettel.php	(revision 457)
+++ pro-violet-viettel/sourcecode/application/modules/services/controllers/viettel.php	(revision 460)
@@ -31,4 +31,5 @@
 						'serviceID'=>array('name'=>'serviceID', 'type'=>'xsd:string'),
 						'commandCode'=>array('name'=>'commandCode', 'type'=>'xsd:string'),
+						'contentType'=>array('name'=>'contentType', 'type'=>'xsd:string'),
 						'info'=>array('name'=>'info', 'type'=>'xsd:string'),
 						'receiveTime'=>array('name'=>'receiveTime', 'type'=>'xsd:string')
@@ -44,4 +45,5 @@
 						'serviceID' => 'xsd:string',
 						'commandCode' => 'xsd:string',
+						'contentType' => 'xsd:string',
 						'info' => 'xsd:string',
 						'receiveTime' => 'xsd:string')
@@ -57,4 +59,9 @@
 			$_SERVER['QUERY_STRING'] = "";
 		}
+		
+		function MOReceiver () {
+			return 'Service not available!';
+		}
+		
 		$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA:'';
 		$this->nusoap_server->service($HTTP_RAW_POST_DATA);
@@ -63,5 +70,5 @@
 	public function mo() 
 	{
-		function MOReceiver($username, $password, $requestID, $userID, $receiverID, $serviceID, $commandCode, $info,$receiveTime){
+		function MOReceiver($username, $password, $requestID, $userID, $receiverID, $serviceID, $commandCode, $contentType ,$info, $receiveTime){
 			$msgType = '0'; //text message
 			$errCode = '1'; //#1:error; 1:Success;
@@ -71,13 +78,4 @@
 			$mo_password = $CI->config->item('mo_password');
 
-			/* if (!isset($parameters['username'])) return '0|0|Username is required!';
-			if (!isset($parameters['password'])) return '0|0|Password is required!';
-			if ($parameters['username'] != $mo_username) return '0|0|Username is not corrected!'.var_export($parameters, true);
-			if ($parameters['password'] != $mo_password) return '0|0|Password is not corrected!';
-			if (!isset($parameters['userID'])) return '0|0|UserID is required!';
-			if (!isset($parameters['userID'])) return '0|0|UserID is required!';
-			if (!isset($parameters['serviceID'])) return '0|0|serviceID is required!';
-			if ($parameters['serviceID'] != '8062') return '0|0|serviceID is not corrected!'; */
-			
 			if (!$username) return '0|0|Username is required!';
 			if (!$password) return '0|0|Password is required!';
@@ -88,17 +86,21 @@
 			if (!$serviceID) return '0|0|serviceID is required!';
 			if ($serviceID != '8062') return '0|0|serviceID is not corrected!';
-						
+			
+			$status = 0;
 			$sentNumber = $userID;									
 			$username = !$receiverID ? $sentNumber : $receiverID;
 			
 			$CI->load->model('frontend/user_model', 'userModel');
-			$password = $CI->userModel->create_random_password();
-			$sms = "Chuc mung Qui vi da dang ky thanh cong tai khoan SBGOnline. Hay dang nhap vao http://soanbaigiang.smas.vn/ voi ten truy nhap ".$username.", mat khau ".$password." de su dung.";			
-			//$msg = $CI->userModel->register ($sentNumber, $receiverID, $serviceID, $commandCode, $info, $receiveTime, $status);
+			$password = $CI->userModel->create_random_password();		
 			
-			//return $status.'|'.$msgType.'|'.$msg;
-
-			//for dummy data
-			return '1|0|'.$sms;
+			$result = $CI->userModel->register ($sentNumber, $receiverID, $serviceID, $commandCode, $info, $receiveTime, $status);
+			$aryAgrs = func_get_args ();
+			$fh = fopen('register.log', 'a+');
+			fwrite ($fh, var_export($aryAgrs, true). "\n");
+			fclose($fh);
+			
+			$aryResult = explode ('|', $result);
+			
+			return $aryResult[0].'|'.$msgType.'|'.$aryResult[1];
 		}
 		
