cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
766
Views
0
Helpful
2
Replies

Cobras Import to Connection smtp notification devices

jeff.singh_2
Level 3
Level 3

                   Hi, I have imported 13000 users from 3 unity systems onto single Unity connection 8.6 cluster. all ok except the smtp notification device gets imported as 'text pager 1'.

i have to edit the from filed for this notification , the bulk edit allows you to choose 'smtp' device but not text pager 1 - is there anyway i can change this in bulk.

Can i use subscriber dump to export an existing user with the text pager 1 field and then do an update - what fields willm i require for the csv.

thanks...jeff

1 Accepted Solution

Accepted Solutions

lindborg
Cisco Employee
Cisco Employee

If you just want to update all SMTP based notification devices that are named "text pager 1" (case insensitive) to some static text you can use this script with the Python Scripting Host for Unity Connection which can be downloaded here:

http://www.ciscounitytools.com/Applications/CxN/PythonScriptingHost/PythonScriptingHost.html

just change the static text to whatever you want (up to 256 characters). If you want to limit it to only notification devices currently active or the like, it's easy enough to change that query.

===================

import clr

clr.AddReference('System.Data')

clr.AddReference('Cisco.Unity.Connection.PythonScriptingHost')

from System.Data import DataTable

from Cisco.Unity.Connection.PythonScriptingHost import ProcDataType

Helpers.SetActiveDatabase("UnityDirDb")

query = 'SELECT ObjectId from vw_Notificationdevicesmtp WHERE fn_tolower(displayname)=?'

dtDevices = Helpers.CreateDataTable(query,"text pager 1")

assert dtDevices.Rows.Count>0,"No notification devices named 'text pager 1' found!"

strStaticText = 'To check voice messages please dial 54321 and sign in with you extension and password'

for device in dtDevices.Rows:

   print ('updating:'+device['objectid'])

   Helpers.StartNewCommand('csp_NotificationDeviceSMTPModify')

   Helpers.AddCommandParam('pObjectid',ProcDataType.Char,device['ObjectId'])

   Helpers.AddCommandParam('pStaticText',ProcDataType.LVarChar,strStaticText)

   Helpers.ExecutProc_NoRet()

View solution in original post

2 Replies 2

lindborg
Cisco Employee
Cisco Employee

If you just want to update all SMTP based notification devices that are named "text pager 1" (case insensitive) to some static text you can use this script with the Python Scripting Host for Unity Connection which can be downloaded here:

http://www.ciscounitytools.com/Applications/CxN/PythonScriptingHost/PythonScriptingHost.html

just change the static text to whatever you want (up to 256 characters). If you want to limit it to only notification devices currently active or the like, it's easy enough to change that query.

===================

import clr

clr.AddReference('System.Data')

clr.AddReference('Cisco.Unity.Connection.PythonScriptingHost')

from System.Data import DataTable

from Cisco.Unity.Connection.PythonScriptingHost import ProcDataType

Helpers.SetActiveDatabase("UnityDirDb")

query = 'SELECT ObjectId from vw_Notificationdevicesmtp WHERE fn_tolower(displayname)=?'

dtDevices = Helpers.CreateDataTable(query,"text pager 1")

assert dtDevices.Rows.Count>0,"No notification devices named 'text pager 1' found!"

strStaticText = 'To check voice messages please dial 54321 and sign in with you extension and password'

for device in dtDevices.Rows:

   print ('updating:'+device['objectid'])

   Helpers.StartNewCommand('csp_NotificationDeviceSMTPModify')

   Helpers.AddCommandParam('pObjectid',ProcDataType.Char,device['ObjectId'])

   Helpers.AddCommandParam('pStaticText',ProcDataType.LVarChar,strStaticText)

   Helpers.ExecutProc_NoRet()

Thanks for your help, did the trick for me.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: