app.py
def attach_inbound_did(app_id):
    """
    Rent a Plivo US DID and attach it the conference application.
    """
    if not config.ALLOW_INBOUND_DID:
        return None

    plivo_conn = get_plivo_connection()
    status, response = plivo_conn.get_number_group({'country_iso': 'US'})
    try:
        group_id = response['objects'][0]['group_id']
        status, response = plivo_conn.rent_from_number_group({'group_id': group_id, 'quantity': 1, 'app_id': app_id})
        number_rented = response['numbers'][0]['number']
        return number_rented
    except Exception as e:
        return None

    Rent a Plivo US DID and attach it the conference application.
    
Rent a Plivo US DID and attach it the conference application.
Rent a Plivo US DID and attach it the conference application .
def attach_inbound_did(app_id):
    if not config.ALLOW_INBOUND_DID:
        return None
    plivo_conn = get_plivo_connection()
    status, response = plivo_conn.get_number_group({'country_iso': 'US'})
    try:
        group_id = response['objects'][0]['group_id']
        status, response = plivo_conn.rent_from_number_group({'group_id': group_id, 'quantity': 1, 'app_id': app_id})
        number_rented = response['numbers'][0]['number']
        return number_rented
    except Exception as e:
        return None
def attach_inbound_did ( app_id ) : if not config . ALLOW_INBOUND_DID : return None plivo_conn = get_plivo_connection ( ) status , response = plivo_conn . get_number_group ( { 'country_iso' : 'US' } ) try : group_id = response [ 'objects' ] [ 0 ] [ 'group_id' ] status , response = plivo_conn . rent_from_number_group ( { 'group_id' : group_id , 'quantity' : 1 , 'app_id' : app_id } ) number_rented = response [ 'numbers' ] [ 0 ] [ 'number' ] return number_rented except Exception as e : return None
Rent a Plivo US DID and attach it the conference application.
Rent a Plivo US DID and attach it the conference application .
"""
    Rent a Plivo US DID and attach it the conference application.
    """
app_id