Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing first char from phone with smsgateway.me #93

Open
basequatro opened this issue May 24, 2016 · 3 comments
Open

Removing first char from phone with smsgateway.me #93

basequatro opened this issue May 24, 2016 · 3 comments

Comments

@basequatro
Copy link

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":"[email protected]","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
Copy link
Owner

shibby commented May 24, 2016

@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
Copy link
Author

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

@shibby
Copy link
Owner

shibby commented May 25, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants