Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CMS data export/import 4

Status
Not open for further replies.

sgroepie

Technical User
Mar 13, 2007
13
0
0
GB
As we want to do some changes in the numbering plan also the data in CMS need to be changed.
This can all b done by hand but is a lot of work.

So is there a way to export all agent number from the dictonairy to a file, modify this (as put 1 digit in front of the numbers) and import it again to CMS ?

Or is there a place where i can find the data on the unix machine itself where i can edit the whole table?
 
CallFlow Extract from utilcall has a 'CMS Bulk Config' tool as part of the package - I think there is a 30 day trial as well.

 
This can be done fairly simple if you can access Informix database on CMS via Informix DBACCESS utility (via Unix). I responded to the similar question weeks ago (synonyms is the table where you can dump all the agent data).
 
You can easily export the logins from CMS. Select Dictionary>Report. Select the item(s) you wish to export, & use File for the destination, give a name & run. Then just FTP the file from CMS to your PC. Open with Excel & modify as needed.

I'm not that familiar with Informix, so I'll second BIS's suggestion. We use the CMS Bulk Config from Utilcall frequently. Works like a charm. Well worth the cost to purchase IMO.

We went through a dialplan conversion & site consolidation recently. Using this method saved me days of manual CMS changes!

Chris
 
Thanks guys, helpfull information.

Exporting can handy be done in CMS indeed, importing couldn't and the callflow extract tool looks good but for a one time need a bit too expensive.

I played a bit with the scripting of the CMS itself and after some digging i found out what to do and wrote a script fir the importing part.

I made 1 for adding and 1 for deleting bulk agents and maybe some other people might think it is handy too so i will put them underneed.

Script for adding agents:

------------------------------------------------
'LANGUAGE=ENU
'SERVERNAME=xxxxxxxxxxxx
Public Sub Main()

'Place a ";" separated file name agent.txt on the root of C drive
'This file needs to have the agent format: John Doe;1234 on every line
'This line will be read and split on the ";" and put in an array to add into CMS
'Script writen by sgroepie

l=0 'loop value for read loop
result=0 'Answer on adding
c=0 'counter for giving the messagebox

dim regel, a 'variabel for readline and for splitting on ";"
dim sString 'variable for information on adding data
dim NameArray(999) 'define array for agent name. All data is read into this from agents.txt
dim NumberArray(999) 'define array for agent number
dim fs, f 'define filesystem stuff for read

cvsSrv.Dictionary.ACD = 1

'Reads file one line at a time into name and number array
'Place the textfile on the root of C drive

Set fs=CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile("C:\agents.txt", 1)

Do While f.AtEndOfStream <> True
regel = f.ReadLine
a = split(regel,";")
NameArray(l) = a(0)
NumberArray(l) = a(1)
l=l+1
Loop 'keep reading in data until EOF hit.

f.Close 'close agents.txt file

Set f=Nothing 'clear f and fs
Set fs=Nothing

'Read all agents into string and display it in a messagebox

for c = 0 to l-1
sString = sString & NumberArray(c) & " - " & nameArray (c) & (Chr(13) & Chr(10))
next
result = msgbox (sString, 1, "Sure to Add these Agents?")
if result = 1 then

sString = "" 'make string empty for next use

'Add entries

b = cvsSrv.Dictionary.CreateOperation("Login Identifications",Op)
Op.Window.Top = 4490
Op.Window.Left = 4680
Op.Window.Width = 6000
Op.Window.Height = 2540

for c = 0 to l-1

If b Then
Op.SetProperty "login_id", NumberArray(c)
Op.SetProperty "ag_name", NameArray(c)

On Error Resume Next

if b = Op.DoAction("Add") then
else
sString = sString & " " & NumberArray(c) & (Chr(13) & Chr(10))
end if

End If

next

if sString <> "" then
msgbox sString, 64, "Following Agents Already Exist"
else
msgbox "All Agents Added", 64, "Operation Succesfull"
end if

If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Op.TaskID
Set Op = Nothing

end if

end Sub
------------------------------------------------

script for deleting

------------------------------------------------

'LANGUAGE=ENU
'SERVERNAME=xxxxxxxxx
Public Sub Main()

'Place a ";" separated file name agent.txt on the root of C drive
'This file needs to have the agent format: John DOe;1234 on every line
'This line will be read and split on the ";" and put in an array to delete in CMS
'Script writen by sgroepie

l=0 'loop value for read loop
result=0 'Answer on deleting
c=0 'counter for giving the messagebox

dim regel, a 'variabel for readline and for splitting on ";"
dim sString 'variable for information on adding data
dim NameArray(999) 'define array for agent name. All data is read into this from agents.txt
dim NumberArray(999) 'define array for agent number
dim fs, f 'define filesystem stuff for read

cvsSrv.Dictionary.ACD = 1

'Reads file one line at a time into name and number array
'Place the textfile on the root of C drive

Set fs=CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile("C:\agents.txt", 1)

Do While f.AtEndOfStream <> True
regel = f.ReadLine
a = split(regel,";")
NameArray(l) = a(0)
NumberArray(l) = a(1)
l=l+1
Loop 'keep reading in data until EOF hit.

f.Close 'close agents.txt file

Set f=Nothing 'clear f and fs
Set fs=Nothing

'Read all agents into string and display it in a messagebox

for c = 0 to l-1
sString = sString & NumberArray(c) & " - " & nameArray (c) & (Chr(13) & Chr(10))
next
result = msgbox (sString, 1, "Sure to Delete these Agents?")
if result = 1 then

sString = "" 'make string empty for next use

'Delete entries

b = cvsSrv.Dictionary.CreateOperation("Login Identifications",Op)
Op.Window.Top = 4490
Op.Window.Left = 4680
Op.Window.Width = 6000
Op.Window.Height = 2540

for c = 0 to l-1

If b Then
Op.SetProperty "login_id", NumberArray(c)
Op.SetProperty "ag_name", NameArray(c)

On Error Resume Next

if b = Op.DoAction("Delete") then
else
sString = sString & NumberArray(c) & " - " & nameArray (c) & (Chr(13) & Chr(10))
end if

End If

next
if sString <> "" then
msgbox sString, 64, "Following Agents Not in System"
else
msgbox "All Agents Deleted", 64, "Operation Succesfull"
end if

If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Op.TaskID
Set Op = Nothing

end if

end Sub
 
I built a tool that I use to export all the agents from the PBX and dump them into CMS. Haven't done it on anything larger than about 500 agents. I still have some work to do. I don't have it scripted to clear the dictionary out. I do provisioning so removing ID's hasn't been high on my priority list. DBACCESS is great if you know Informix.

James Middleton
ACSCI/ACSCD/MCSE
Xeta Technologies
jim.middleton@xeta.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top