Printable a 26 Latin letters (A to Z) phone number to the 12-key telephone
    keypad number.

    :param number: string
    :param alphabet: dict

    >>> print(e161('0800-PIZZA123'))
    080074992123
    >>> e161('0800^PIZZA123')
    Traceback (most recent call last):
        ...
    ValueError: Character "^" (0x5e) is not in the E.161 alphabet

def e161(number, alphabet=PHONE_E161_ALPHABET):
    '''
    Printable a 26 Latin letters (A to Z) phone number to the 12-key telephone
    keypad number.

    :param number: string
    :param alphabet: dict

    >>> print(e161('0800-PIZZA123'))
    080074992123
    >>> e161('0800^PIZZA123')
    Traceback (most recent call last):
        ...
    ValueError: Character "^" (0x5e) is not in the E.161 alphabet
    '''

    digits = []
    for char in strip(number, '+-. ()').lower():
        length = len(digits)
        for group, digit in alphabet.items():
            if char in group:
                digits.append(digit)
                break

        if len(digits) == length:
            raise ValueError(
                _('Character "%s" (0x%02x) is not in the E.161 alphabet') %
                (char, ord(char))
            )

    return u''.join(digits)