Beispiel #1
0
def delete_user_line_extension_with_user_id(user_id):
    user = user_helper.get_by_user_id(user_id)
    if not user:
        return

    line_id = user_helper.find_line_id_for_user(user_id)
    if line_id:
        line_helper.delete_line(line_id)

    extension_id = extension_helper.find_extension_id_for_line(line_id)
    if extension_id:
        extension_helper.delete(extension_id)

    user_helper.delete_user(user.id)
def delete_user_line_extension_with_user_id(user_id):
    user = user_helper.get_by_user_id(user_id)
    if not user:
        return

    line_id = user_helper.find_line_id_for_user(user_id)
    if line_id:
        line_helper.delete_line(line_id)

    extension_id = extension_helper.find_extension_id_for_line(line_id)
    if extension_id:
        extension_helper.delete(extension_id)

    user_helper.delete_user(user.id)
def _delete_extension_type(exten, extension_type, typeval):
    try:
        if extension_type == 'user':
            user_helper.delete_user(int(typeval))
        elif extension_type == 'queue':
            queue_helper.delete_queues_with_number(exten)
        elif extension_type == 'group':
            group_helper.delete_groups_with_number(exten)
        elif extension_type == 'incall':
            incall_helper.delete_incalls_with_did(exten)
        elif extension_type == 'meetme':
            meetme_helper.delete_meetme_with_confno(exten)
        elif extension_type == 'outcall':
            dialpattern_helper.delete((typeval))
    except ElementDeletionError as e:
        print "I tried deleting a type %s typeval %s but it didn't work." % (extension_type, typeval)
        print e
def _delete_extension_type(exten, extension_type, typeval):
    try:
        if extension_type == 'user':
            user_helper.delete_user(int(typeval))
        elif extension_type == 'queue':
            queue_helper.delete_queues_with_number(exten)
        elif extension_type == 'group':
            group_helper.delete_groups_with_number(exten)
        elif extension_type == 'incall':
            incall_helper.delete_incalls_with_did(exten)
        elif extension_type == 'meetme':
            meetme_helper.delete_meetme_with_confno(exten)
        elif extension_type == 'outcall':
            dialpattern_helper.delete((typeval))
    except ElementDeletionError as e:
        print "I tried deleting a type %s typeval %s but it didn't work." % (
            extension_type, typeval)
        print e
def delete_user(user_id):
    user_helper.delete_user(user_id)