Question: Netgsm Sms Integration Error Custom

Netgsm Sms Integration Error Custom

Hello there, I have a membership of Turkey SMS NETGSM company could use. I filled the sms settings here with the custom settings. However, although the error records are empty, it gives an

K

kemal

Asked
Hello there,

I have a membership of Turkey SMS NETGSM company could use.

I filled the sms settings here with the custom settings. However, although the error records are empty, it gives an error.

I've tried all the variations.
https://prnt.sc/100llqr
https://prnt.sc/100lm5u

Can you help me?
  • MS

    Mian Saleem

    Answered
    Hello,

    Please let me know the error message.

    Logs will be empty unless you have send sent message and there were errors. If there are error those should be recorded.

    Let me know the error so that I can check.

    Thank you
  • MS

    Mian Saleem

    Answered
    Hello,

    I am sorry as I didn't see the image.

    I am checking this and shall fix in coming update.

    Thank you
  • K

    kemal

    Answered
    **[Mian Saleem](/u/saleem)** Hello,

    https://prnt.sc/101o3fa (SMS SETTINGS)
    https://prnt.sc/101o60d (SEND SMS)
    https://prnt.sc/101o6hm (LOGS)

    Now I did a test and looked at the log. There is no record today.

    Does the system use the get method?

    SMS GET LINK: https://api.netgsm.com.tr/sms/send/get/
    How to create a get link for this link?

    This code is specified in the documentation:

    ```php
    function SMSgonderHttpGET(){

    $username = "850303xxxx"; //
    $password = urlencode("xxxx"); //

    $url= "https://api.netgsm.com.tr/sms/send/get/?usercode=USERNAME&password=PASS&gsmno=SENDTONUMBER&message=MYMESSAGE&msgheader=MYBRANDNAME";

    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    $http_response = curl_exec($ch);
    $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);

    if($http_code != 200){
    echo "$http_code $http_response\n";
    return false;
    }
    $balanceInfo = $http_response;
    echo "MesajID : $balanceInfo";
    return $balanceInfo;
    }

    SMSgonderHttpGET();

    ```

    Thank you for your help! :)
  • MS

    Mian Saleem

    Answered
    Hello,

    SMS api only support post method. The error message will be updated in coming update.

    Thank you
  • K

    kemal

    Answered
    Thank you.

    I still need help. I understand a little bit of coding.

    I looked at the CustomGateway.php file. I did not understand. I do not know what to do. SMS sending methods in NETGSM are: SOAP Service, HTTP GET and XML POST.

    Soap Service Example Codes:

    try {
    $client = new SoapClient("http://soap.netgsm.com.tr:8080/Sms_webservis/SMS?wsdl");

    $msg = 'test message';
    $gsm = array('905xxxxxxxxx','905xxxxxxxxy' , '905xxxxxxxxz' );


    $Result = $client -> smsGonder1NV2(array('username'=>'850302xxxx', 'password' => 'xxxx', 'header' => '850302xxxx', 'msg' => 'TEST', 'gsm' => $gsm, 'filter' => '', 'startdate' => '', 'stopdate' => '', 'encoding' => '' ));

    } catch (Exception $exc)
    {
    // Hata olusursa yakala
    echo "Soap Hatasi Olustu: " . $exc->getMessage();
    }

    ---
    GET Example:

    function SMSgonderHttpGET(){

    $username = "850303xxxx"; //
    $password = urlencode("xxxx"); //

    $url= "https://api.netgsm.com.tr/sms/send/get/?usercode=kullanicidiniz&password=sifreniz&gsmno=5051234567,5441234568&message=testmesaji&msgheader=MesajBaslik";

    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    $http_response = curl_exec($ch);
    $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);

    if($http_code != 200){
    echo "$http_code $http_response\n";
    return false;
    }
    $balanceInfo = $http_response;
    echo "MesajID : $balanceInfo";
    return $balanceInfo;
    }

    SMSgonderHttpGET();


    --
    XML POST Example:

    function XMLPOST($PostAddress,$xmlData)
    {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,$PostAddress);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,2);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
    curl_setopt($ch, CURLOPT_TIMEOUT, 30);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlData);
    $result = curl_exec($ch);
    return $result;
    }
    $xml='<?xml version="1.0" encoding="UTF-8"?>
    <mainbody>
    <header>
    <company dil="TR">Netgsm</company>
    <usercode>KullaniciAdi</usercode>
    <password>Sifre</password>
    <type>1:n</type>
    <msgheader>Baslik</msgheader>
    </header>
    <body>
    <msg>
    <![CDATA[Mesaj Metnim]]>
    </msg>
    <no>051212312312</no>
    <no>051212312312</no>
    </body>
    </mainbody>';

    $gelen=XMLPOST('https://api.netgsm.com.tr/sms/send/xml',$xml);
    echo $gelen;

    ---

    What should I do? This is very important and urgent to me, I'm waiting for your help
  • MS

    Mian Saleem

    Answered
    Hello,

    I have checked, custom gateway send get request not post. Please make sure the phone number you are sending sms is with country code like +6010702222

    I have updated the error message and it will display better error message from next update.

    Thank you
  • Login to Reply