Adds phone number(s) to the blacklist
@param $phoneNumbers array|string The phone numbers
@return string status API response
8179
public function addBlacklist($phoneNumbers = null)
    {
        //If the <nums> parameter is blank, all users are removed from blacklist as Mutlucell Api says
        if ($phoneNumbers === null) {
            $phoneNumbers = '';
        }

        if (is_array($phoneNumbers)) {
            $phoneNumbers = implode(', ', $phoneNumbers);
        }

        $xml = '<?xml version="1.0" encoding="UTF-8"?>' . '<addblacklist ka="' . $this->config['auth']['username'] . '" pwd="' . $this->config['auth']['password'] . '">';
        $xml .= '<nums>' . $phoneNumbers . '</nums>';
        $xml .= '</addblacklist>';

        return $this->postXML($xml, 'https://smsgw.mutlucell.com/smsgw-ws/addblklst');
    }
1062041
private String formatPhoneNumber() {

    StringBuilder buffer = new StringBuilder();
    buffer.append(this.countryCode);
    buffer.append(' ');
    buffer.append(this.areaCode);
    buffer.append(' ');
    buffer.append(this.localNumber);
    if ((this.extension != null) && (this.extension.length() > 0)) {
      buffer.append('-');
      buffer.append(this.extension);
    }
    return buffer.toString();
  }
1197407
public function getExtensions()
    {
        $uri = $this->base_uri . '/presence/rest/directory';

        $extensions = $this->makeRequest($uri);

        if (!isset($extensions['extensions'])) {
            throw BadResponse::create($vonage);
        }

        if (!count($extensions['extensions'])) {
            return false;
        };

        foreach ($extensions['extensions'] as $extension => $value) {
            if (strlen(trim($value['name'])) > 0) {
                switch ($value['status']) {
                    case 'available':
                        $callIcon = 'fa-phone';
                        break;
                    case 'busy':
                        $callIcon = 'fa-volume-control-phone';
                        break;
                    default:
                        $callIcon = 'fa-times';
                        break;
                }

                $callDirection = '';
                $onCallWith = '';
                $onCallWithName = '';
                $onCallWithNumber = '';
                $directionIcon = '';

                if ($value['status'] == 'busy') {
                    $extentionDetails = $this->getExtension($extension);
                    $extentionDetails = $extentionDetails['details']['presence'];

                    if (count($extentionDetails) > 0) {
                        $callDirection = $extentionDetails['direction'];

                        switch ($callDirection) {
                            case 'inbound':
                                $directionIcon = 'fa-long-arrow-left';
                                break;
                            case 'outbound':
                                $directionIcon = 'fa-long-arrow-right';
                                break;
                            default:
                                $directionIcon = '';
                                break;
                        }

                        $onCallWithName = $extentionDetails['onCallWithName'];

                        // remove 1st digit = 1
                        $onCallWithNumber = substr($extentionDetails['onCallWith'], 1, 10);

                        // get Crm company
                        $company = Crm::getCompanyByPhone($onCallWithNumber);

                        $onCallWith = (count($company) === 0)
                            // ? (!empty($onCallWithName) ? $onCallWithName : $onCallWithNumber)
                            ? ($onCallWithName == 'null' ? $onCallWithNumber : $onCallWithName)
                            : $company[0]['company'];
                    }
                }

                $extensionInfo[$extension] = array(
                    'extension'     => $extension,
                    'name'          => $value['name'],
                    'status'        => $value['status'],
                    'loginName'     => $value['loginName'],
                    'callIcon'      => $callIcon,
                    'directionIcon' => $directionIcon,
                    'company'       => $onCallWith,
                    'callerId'      => $onCallWithName
                );
            }
        }

        return $extensionInfo;
    }
474561
public function requestCode($clientRef, $phoneNumber, $optionalArgs = array())
    {
        $requestCode = new RequestCode;
        $requestCode
            ->setClientRef($clientRef)
            ->setPhoneNumber($phoneNumber);

        if (count($optionalArgs) > 0) {
            foreach ($optionalArgs as $key => $value) {
                $requestCode->set($key, $value);
            }
        }

        $response = $this->request('TFA/Request', array(), $requestCode);

        $serializer = SerializerBuilder::create()->build();
        $result = $serializer->deserialize(
            $response,
            'Fortytwo\SDK\TwoFactorAuthentication\Response2FA',
            'json'
        );

        return $result;
    }
59322
protected function getPhoneNumbers() {
        if (!$this->_phoneNumbers) {
            $this->_phoneNumbers = new PhoneNumberList($this->version, $this->solution['sid']);
        }

        return $this->_phoneNumbers;
    }
1211476
public function formatMsisdn($phone_number = '', $format = NULL)
    {
        if (empty($phone_number)) {
            return NULL;
        }
        try {
            if (mb_strpos('*', $phone_number) || mb_strpos('x', $phone_number)) {
                return $phone_number;
            } else {
                if (self::MSISDN_FORMAT_MODE == 'new' || self::MSISDN_FORMAT_MODE == 'old') {
                    $BasePhoneNumber = new BasePhoneNumber();
                    $phone_number    = $BasePhoneNumber->phone_number_convert($phone_number, self::MSISDN_FORMAT_MODE, $format);
                } else {
                    $phone_number = $this->phoneNumber->format($phone_number, $format);
                }

                return $phone_number;
            }
        }
        catch (\Exception $e) {
            return $phone_number;
        }
    }
639732
protected function getAvailablePhoneNumbers() {
        if (!$this->_availablePhoneNumbers) {
            $this->_availablePhoneNumbers = new AvailablePhoneNumberCountryList(
                $this->version,
                $this->solution['sid']
            );
        }

        return $this->_availablePhoneNumbers;
    }
1350882
private function phoneValidate($phone)
    {
        $result = null;
        $phone  = trim($phone);
        if (!empty($phone)) {
            if (!$this->phoneHelper) {
                $this->phoneHelper = new PhoneNumberHelper();
            }
            try {
                $phone = $this->phoneHelper->format($phone);
                if (!empty($phone)) {
                    $result = $phone;
                }
            } catch (\Exception $e) {
            }
        }

        return $result;
    }
371072
public function stoplistAdd($stoplistPhone, $stoplistText)
    {
        $response = $this->request(
            'stoplist/add',
            [
                'stoplist_phone' => $stoplistPhone,
                'stoplist_text'  => $stoplistText,
            ]
        );
        
        $response = explode("\n", $response);
        
        return new StoplistAddResponse(array_shift($response));
    }
1251852
public function PhoneFriendly()
    {
        $ReplacementMap = array(
            'a'=>'2', 'b'=>'2', 'c'=>'2',
            'd'=>'3', 'e'=>'3', 'f'=>'3',
            'g'=>'4', 'h'=>'4', 'i'=>'4',
            'j'=>'5', 'k'=>'5', 'l'=>'5',
            'm'=>'6', 'n'=>'6', 'o'=>'6',
            'p'=>'7', 'q'=>'7', 'r'=>'7', 's'=>'7',
            't'=>'8', 'u'=>'8', 'v'=>'8',
            'w'=>'9', 'x'=>'9', 'y'=>'9', 'z'=>'9',
            '+'=>'00',
            ' '=>''
        );
        $value = str_ireplace(
            array_keys($ReplacementMap),
            array_values($ReplacementMap),
            $this->owner->value
        );

        // Strip out everything else
        $value = preg_replace('/[^0-9\,]+/', '', $value);

        return $value;
    }
370546
public function createNumberLookup($numbers)
    {
        if (is_array($numbers)) {
            $numberLookup = $this->factory->createNumberLookup($numbers);
        } else {
            $numberLookup = $this->factory->createNumberLookup(array($numbers));
        }

        return $numberLookup;
    }
256244
public boolean isPhoneNumberInBlackList(final String phoneNumber) {
		logger.info("Receive request for isPhoneNumberInBlackList : " + phoneNumber);
		boolean retVal = daoService.isPhoneNumberInBlackList(phoneNumber);
		logger.info("Response for getListPhoneNumbersInBlackList request : " 
				 + phoneNumber + " is : " + retVal);		
		return retVal;
	}
105139
public function AddNumbersToDncList($Id, Request\AddNumbersToDncList $AddNumbersToDncList)
    {
        $uri = $this->getUri('/contact/dnc/list/%s/add', array($Id));

        return $this->post($uri, $AddNumbersToDncList);
    }
841014
public void addPhoneNumber(String newPhoneNumber) {
        if (newPhoneNumber==null || newPhoneNumber.trim().length()==0) {
            return;
        }

        if (phoneNumbers == null) {
            phoneNumbers = new ArrayList<>(1);
        }
        for (PhoneNumber phoneNumber : phoneNumbers) {
            if (phoneNumber.value.equals(newPhoneNumber) && phoneNumber.getType() == null) {
                throw new IllegalArgumentException("Already contains phoneNumber " + newPhoneNumber);
            }
        }

        PhoneNumber number = new PhoneNumber();
        number.setValue(newPhoneNumber);
        phoneNumbers.add(number);
    }
347223
public function searchByPhone($parameters = [])
    {
        $path = $this->appendParametersToUrl('/v2/phone_search', $parameters);
        $request = $this->getRequest('GET', $path);

        return $this->processRequest($request);
    }
371027
public function getActivatedPhoneNumbers()
    {
        Piwik::checkUserIsNotAnonymous();

        $phoneNumbers = $this->retrievePhoneNumbers();

        $activatedPhoneNumbers = array();
        foreach ($phoneNumbers as $phoneNumber => $verificationCode) {
            if (self::isActivated($verificationCode)) {
                $activatedPhoneNumbers[] = $phoneNumber;
            }
        }

        return $activatedPhoneNumbers;
    }
59793
public static function phone($phone) {

        $result = new \sb\Validate\Results();
        $result->value = $phone;
        $result->is_valid = false;

        if (preg_match("/^\d{3}-\d{3}-\d{4}$/", $phone)) {
            $result->message = "Valid phone number";
            $result->is_valid = true;
        } else {
            $result->message = "Invalid phone number";
        }

        return $result;
    }