Support » Plugin: WP SMS » sms77 notworking

  • Resolved lugmayrm

    (@lugmayrm)



    hello ,
    i installed Wp sms plugin and activated , i register through sms77.de
    i have 0,5Eur credit balance for testing.

    following
    Status – Active!
    Result request – (nothing)
    Bulk send – Supported

    but when i send sms to numbers its not working and its still showing credit balance
    please help.

    [ Signature deleted ]

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Mostafa Soufi

    (@mostafas1990)

    Hi,

    Please make sure about cURL extension in your server.

    yes i have

    Your server’s PHP cURL version information and features:
    cURL version: 7.26.0
    Host: x86_64-pc-linux-gnu
    IPv6 support: yes
    Kerberos V4 support: no
    SSL support: yes
    SSL version: OpenSSL/1.0.1t
    libz HTTP deflate support: yes
    libz version: 1.2.3.4
    Protocols: dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtmp, rtsp, scp, sftp, smtp, smtps, telnet, tftp

    Plugin Author Mostafa Soufi

    (@mostafas1990)

    Hi,

    Please run the below url in your browser and let me about the result.

    https://gateway.sms77.de/balance.php?u=username&p=password

    Change username and password in above url with your credential.

    Plugin Author Mostafa Soufi

    (@mostafas1990)

    We’ve used the same URL in the gateway class.

    $result = @file_get_contents( $this->wsdl_link . 'balance.php?u=' . urlencode( $this->username ) . '&p=' . urlencode( $this->password ) );

    I have tested from my website with cURL test applaince- and it returns the right answere. but with wpsms doese not work.

    thanks for help.

    Martin

    Plugin Author Mostafa Soufi

    (@mostafas1990)

    It seems the file_get_contents not working on your server. You can use the print_r to get the response.

    $result = @file_get_contents( $this->wsdl_link . 'balance.php?u=' . urlencode( $this->username ) . '&p=' . urlencode( $this->password ) );
    
    print_r($result);

    Note: It’s better used wp_remote_get instead file_get_contents.

    lugmayrm

    (@lugmayrm)

    now i have changed to wp_remote_get – in file sms77.class.php – and now it would work.

    `<?php

    class sms77 extends WP_SMS {
    private $wsdl_link = “https://gateway.sms77.de/”;
    public $tariff = “http://www.sms77.de”;
    public $unitrial = false;
    public $unit;
    public $flash = “enable”;
    public $isflash = false;

    public function __construct() {
    parent::__construct();
    $this->validateNumber = “0049171999999999 or 0171999999999 or 49171999999999”;
    }

    public function SendSMS() {
    // Check gateway credit
    if ( is_wp_error( $this->GetCredit() ) ) {
    return new WP_Error( ‘account-credit’, __( ‘Your account does not credit for sending sms.’, ‘wp-sms’ ) );
    }

    /**
    * Modify sender number
    *
    * @since 3.4
    *
    * @param string $this ->from sender number.
    */
    $this->from = apply_filters( ‘wp_sms_from’, $this->from );

    /**
    * Modify Receiver number
    *
    * @since 3.4
    *
    * @param array $this ->to receiver number
    */
    $this->to = apply_filters( ‘wp_sms_to’, $this->to );

    /**
    * Modify text message
    *
    * @since 3.4
    *
    * @param string $this ->msg text message.
    */
    $this->msg = apply_filters( ‘wp_sms_msg’, $this->msg );

    /* $result = @file_get_contents( $this->wsdl_link . ‘?u=’ . urlencode( $this->username ) . ‘&p=’ . urlencode( $this->password ) . ‘&text=’ . urlencode( $this->msg ) . ‘&to=’ . implode( $this->to, “,” ) . ‘&type=quality&from=’ . urlencode( $this->from ) ); */
    $result = @wp_remote_get( $this->wsdl_link . ‘?u=’ . urlencode( $this->username ) . ‘&p=’ . urlencode( $this->password ) . ‘&text=’ . urlencode( $this->msg ) . ‘&to=’ . implode( $this->to, “,” ) . ‘&type=quality&from=’ . urlencode( $this->from ) );
    /* es kommt array retour und im array body ist wert */

    if ( $result[‘body’] == ‘100’ ) {
    $this->InsertToDB( $this->from, $this->msg, $this->to );

    /**
    * Run hook after send sms.
    *
    * @since 2.4
    *
    * @param string $result result output.
    */
    do_action( ‘wp_sms_send’, $result[‘body’] );

    return $result[‘body’];
    }

    return new WP_Error( ‘send-sms’, $result[‘body’] );
    }

    public function GetCredit() {
    // Check username and password
    if ( ! $this->username && ! $this->password ) {
    return new WP_Error( ‘account-credit’, __( ‘Username/Password does not set for this gateway’, ‘wp-sms’ ) );
    }

    $result = @wp_remote_get( $this->wsdl_link . ‘balance.php?u=’ . urlencode( $this->username ) . ‘&p=’ . urlencode( $this->password ) );

    return $result[‘body’];
    }
    }’
    Thanks for help

    • This reply was modified 10 months ago by  lugmayrm.
    Plugin Author Mostafa Soufi

    (@mostafas1990)

    Good, It’s better you have some condition in your source.
    See the below example:
    https://github.com/veronalabs/wp-sms/blob/master/includes/gateways/ozonesmsworld.class.php

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘sms77 notworking’ is closed to new replies.