parameters: (app_id)
docstring: Rent a Plivo US DID and attach it the conference application.
docstring_summary: Rent a Plivo US DID and attach it the conference application.
docstring_tokens: Rent a Plivo US DID and attach it the conference application .
function: 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
function_tokens: 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