#!/usr/bin/python

from __future__ import division

from builtins import range
import sys
import csv


first_user = 5000
add_users = 1000 
context = "loadtest"
line_site = "mds1"
webrtc = ""
filename = sys.argv[1]
first_name = "tester"

with open("%s" %(filename), 'wb') as csvfile:
    writer = csv.writer(csvfile, delimiter=',')

    writer.writerow(["entity_id",
                     "firstname",
                     "lastname",
                     "outgoing_caller_id",
                     "language",
                     "enabled",
                     "ring_seconds",
                     "simultaneous_calls",
                     "supervision_enabled",
                     "call_transfer_enabled",
                     "call_record_enabled",
                     "online_call_record_enabled",
                     "username",
                     "password",
                     "cti_profile_name",
                     "cti_profile_enabled",
                     "line_protocol",
                     "line_site",
                     "context",
                     "sip_username",
                     "sip_secret",
                     "exten",
                     "incall_exten",
                     "incall_context"
                     ])

    for user in range(add_users):
        exten = first_user + user
        writer.writerow([1,
                         first_name,
                         exten,
                         "default",
                         "fr_FR",
                         1,
                         30,
                         5,
                         1,
                         1,
                         0,
                         0,
                         exten,
                         "1234",
                         "Agent",
                         1,
                         "sip",
                         line_site,
                         context,
                         exten,
                         exten,
                         exten,
                         "",
                         ""
                         ])
