User Tools

Site Tools


Sidebar

en:objects:simnet:functional:get_phone_number

get_phone_number

get_phone_number($service='ot',$operator='any',$country='0'); - get the number of available numbers.

the input Function accepts parameters:

  • $service – service for ordering. List of available services:
    vk(Vkontakte)
    ok(Classmates)
    wa(Whatsapp)
    vi(Viber)
    tg(Telegram)
    wb(WeChat)
    go(Google,youtube,Gmail)
    av(avito)
    fb(facebook)
    tw(Twitter)
    ub(Uber)
    qw(Qiwi)
    gt(Gett)
    sn(OLX)
    ig(Instagram)
    ss(SeoSprint)
    ym(Yula)
    ma(Mail.ru)
    mm(Microsoft)
    uk(MeetMe)
    me(Line messenger)
    mb(Yahoo)
    we(Drugvokrug)
    bd(Rambler.ru)
    kp(Tencent QQ)
    dt(Taxi Maxim)
    ya(Yandex)
    mt(Skout)
    oi(Nimses)
    fd(Mamba)
    zz(Drom.ru)
    kt(KakaoTalk)
    pm(AOL)
    tn(LinkedIN)
    ot(Any other)
    You can also use the full name of the service:
    airbnb
    alibaba
    amazon
    aol
    avito
    blablacar
    blizzard
    blockchain
    burgerking
    careem
    delivery
    discord
    dixy
    drom
    drugvokrug
    dukascopy
    ebay
    electroneum
    facebook
    fiverr
    forwarding
    gameflip
    gett
    google
    grabtaxi
    hqtrivia
    icard
    instagram
    kakaotalk
    komandacard
    lazada
    line
    linkedin
    livescore
    magnolia
    mailru
    mamba
    microsoft
    naver
    odnoklassniki
    okey
    olx
    other
    perekrestok
    pyaterochka
    qiwiwallet
    sipnet
    steam
    tantan
    telegram
    tinder
    twitter
    uber
    viber
    vkontakte
    voopee
    webmoney
    wechat
    weku
    whatsapp
    yahoo
    yandex
    yandexmoney
    youla
  • $operator – mobile operator only for Russia: megafon, mts, beeline,tele2, any.
    You can also use the full name of the operator:
    activ
    altel
    beeline
    claro
    globe
    kcell
    lycamobile
    megafon
    movistar
    mts
    rostelecom
    smart
    sun
    tele2
    tnt
  • $country - country of the number, 0 - Russia, 1 - Ukraine, 2 - Kazakhstan (optional, by default as specified in the settings). You can also use the full name of the country: russia, kazakhstan, philippines.

    After testing, the function returns the result of its work to the script :
  • true – got a phone number
  • false – didn't get a phone number


    You can get the received phone number from the simnet->numbervariable. However, if we did not receive the phone number, the full response of the service can be obtained from the simnet->answervariable.

    The simnet->answer variable can be:

      NO_NUMBERS - no numbers
      NO_BALANCE - balance ended
      Possible error:
      BAD_ACTION - invalid action
      BAD_SERVICE - invalid service name
      BAD_KEY - invalid API key
      ERROR_SQL - SQL server error


    PHP example:

    <?php $xhe_host = "127.0.0.1:7010";
     
    //connect the object to control the emulator, if not already connected
    if(!isset($path))
      $path = "../../../Templates/xweb_human_emulator.php";
    require($path);
     
    //Start
    echo "<hr> <font color = blue> simnet->".basename(__FILE__)."</font> <hr>";
     
    //set the service api key
    $simnet->api_key = '3161df9b1fe1ccb8cfd7dA91db765de8';
     
    //get phone number
    if(!$simnet->get_phone_number('ot'))
    {
        while($simnet->answer == "NO_NUMBERS")
        {
            $simnet->get_phone_number('ot');
            sleep(10);
        }
     
        if(strpos($simnet->answer, 'ACCESS_NUMBER') === false)
        {
           echo("answer $simnet->servis of the $simnet->answer <br>");
           $app->quit();
        }
    }
     
    //sms sent
    $simnet->set_status(1);
    //received phone number
    echo $phone = trim($simnet->number);
    echo "<br>";
     
    /* use the number here in the registration form
    after which an SMS is sent to the phone
    */
     
    //wait * 10 in seconds
    $wt_wait = 7;
    //get code from SMS
    if(!$simnet->get_code($wt_wait))
    {
        echo("ERROR: $simnet->answer could not get code from SMS");
     
       //inform the service that we release the number
        $simnet->set_status(8);
    }
    else//if necessary, correct the parsing of the SMS text, if the code is not correctly parsed from it
    {
       //inform the service that everything is ok
        $simnet->set_status();
       //code from sms
        echo trim($simnet->code).'<br>';
    }
     
     
    //end
    echo "<hr> <br>";
     
    //Quit
    $app->quit();
    ?>

    Python example:

     

    C# example:

     

    Java Script example:

     
  • en/objects/simnet/functional/get_phone_number.txt · Last modified: 2026/08/05 22:47 (external edit)