We send SMS from our number Megaphone without a GSM device

    Greetings!

    Some time ago, Yastrebon published a found feature for sending sms \ mms through the Megaphone gateway. And send from your number and pay from your own account (including various bonus programs and packages).

    There was free time and I decided to write a wrapper library on this service.



    You can download the lib itself On the github from the repository

    Example usage

    $myNumber = '79274445566';
    $myPassword = 'my-serviceguide-password';
    $recipientNumber = '79274445577';
    $text = 'Привед кросафчег';
    $c = new OMS(new OMS_User($myNumber,$myPassword),
    'https://sms.megafon.ru/oms/service.asmx',
    'https://www.intellisoftware.co.uk/smsgateway/oms/oms.asmx?WSDL'
    );
    $m = new OMS_Message(new OMS_Body_SMS($text),$recipientNumber);
    $c->DeliverXms($m);
    


    (By the way, it’s not clear why, but you can’t get the WSDL from the Megafon server programmatically (apparently you need to send headers like browser ones), so I pulled the description of the service from a similar service)

    There are several points that should be noted:
    • Messages do not go abroad (* sad *) and to paid / entertainment services
    • MMS support is not implemented, but it will fit perfectly into the structure, if anyone needs it
    • Checking the compliance of sent messages with the restrictions set by the gateway - not yet implemented

    Also popular now: