import re


def phone_number_to_int(phone):
    """
    Converts a string phone number to an integer, as needed by track_by_phone()

    >>> phone_number_to_int('503-555-1234')
    5035551234
    >>> phone_number_to_int('503.555.1234')
    5035551234
    """
    phone = re.sub(r"[\.-]", "", phone)
    return int(phone)