shibby / WHMCS-SmsModule

Sms module for WHMCS
GNU General Public License v3.0
52 stars 71 forks source link

Removing first char from phone with smsgateway.me #93

Open basequatro opened 8 years ago

basequatro commented 8 years ago

I've set the module and got it working but it keeps removing the first digit from the custom field phone.

Ex:

Phone in WHMCS client profile: 11 98765432

To: 11 98765432 its ok but when it sends remove the first char Request send message: test xxx.com.brto number: 198765432

Params: {"senderid":"Xxx","email":"admin@xxxx.com.br","pass":"xxxx","countrycode":"","signature":"xxxx.com.br"}
To: 11 98765432
Message: test xxx.com.br
SenderClass: smsgateway
Request send message: test xxx.com.brto number: 198765432
smsGateway server response returned: {
    "response": {
        "success": true,
        "result": {
            "success": [
                {
                    "id": "16811253",
                    "device_id": "22417",
                    "message": "test xxx.com.br",
                    "status": "pending",
                    "send_at": 1464105873,
                    "queued_at": 0,
                    "sent_at": 0,
                    "delivered_at": 0,
                    "expires_at": 1464107074,
                    "canceled_at": 0,
                    "failed_at": 0,
                    "received_at": 0,
                    "error": "",
                    "created_at": 1464105873,
                    "contact": {
                        "id": "3842493",
                        "name": "198765432",
                        "number": "198765432"
                    }
                }
            ],
            "fails": []
        }
    },
    "status": 200
}
Call API success.
Message id: 1681853 sent at: 2016-05-24 01:04:33 Status: pending
Mesaj veritabanına kaydedildi

24/05/16 16:04:33 Msg #1681853 failed on Device 22417

shibby commented 8 years ago

@basequatro i think it could be related with gsm number util function. https://github.com/AktuelSistem/WHMCS-SmsModule/blob/master/modules/addons/aktuel_sms/senders/smsgateway.php#L222

i didn't tested this sender before.

basequatro commented 8 years ago

Great, removed substr() and it worked. I think they use that only if user enter countrycode with plus signal

shibby commented 8 years ago

So, maybe you can change function then? Check if number contains +, then use substr, otherwise dont use?