cancel
Showing results for 
Search instead for 
Did you mean: 

Error to invoke a Customstate Python - IVR

former_member340454
Participant
0 Kudos

Hello,

I am using the Customstate element to invoke a Python customizer method, but when I tested the IVR calling the Customstate I got the error below.

>>>> ERR> <type 'exceptions.AttributeError'> : ICustomize instance has no attribute 'getQueueById'

My code, where I set the method name to call.

from Env        import *

from ICustomize import *

from IVRUtil    import *

from ADO        import *

class Get_Queue_Number(ICustomize):

  # NOTE: Keep name, Filename and class name identical.

  # ========================================================================

  def __init__(self, AppConf):

    # Call the base class constructor

    ICustomize.__init__(self, AppConf)

   

  def getQueueById(self, params): 

BR

Rodrigo

Accepted Solutions (1)

Accepted Solutions (1)

former_member250653
Participant
0 Kudos

Hi Rodrigo,

make sure that your filename of the IVR customizer file is Get_Queue_Number.py.

BR,

Thomas

former_member340454
Participant
0 Kudos

Hi Thomas,

The filename is already with the same name of class and I get this error!

I looked everywhere and I didn´t find where is the error!!!

BR

Rodrigo

former_member187604
Contributor
0 Kudos

Hello

Couple things you could check:

1) intendation used in the customizer file, see e.g. https://docs.python.org/2.7/reference/lexical_analysis.html#indentation

2) some examples from SAP Note 1951158 - SAP Contact Center 7.0 - IVR Samples (there are some with customizers you can build on)


BR,
-Lasse

former_member340454
Participant
0 Kudos

Hi Lasse,

The Indentation seems to be Ok. Is there some logs to verify and confirm that?

I am using the VIP IVR code sample from the SAP Note 1951158 to make my customstate.

BR

Rodrigo

former_member250653
Participant
0 Kudos

Hi Rodrigo,

if you send me your customizer file, then I can check it on my side.

My opinion is, that Copy & Paste in SCN is no solution for that because here you can't see the right intendation. It's important to always use the right amount of spaces for intendation. Python is very sensitive for that.

BR,

Thomas

former_member340454
Participant
0 Kudos

Hi Thomas.

Ok. I know the Python is very sensitive

Follow the file link.

BR

Rodrigo

former_member250653
Participant
0 Kudos

Hi Rodrigo,

In your initial post you wrote the following error line:

>>>> ERR> <type 'exceptions.AttributeError'> : ICustomize instance has no attribute 'getQueueById'

In your customizer file you defined "def getCustomerById(self, params)", but not "def getQueueById(self, params)". This has to be the reason for this error.

This means, in your IVR at the customstate you have to use "getCustomerById" instead of "getQueueById", or you have to define getQueueById in your customizer instead of getCustomerById.

I didn't test it but I guess you will have another problem.

You wrote:

SELECT [MobilePhone] FROM DimAgentProfile WITH(NOLOCK) WHERE UserInitials = 'UserInitials'

ODBC = CEMODBC.ODBCConnection("VWU_DSN", self.m_E, ["XXX"])

recordset = ODBC.execute(UserInitials)

This will not work, because you didn't write the SQL statement as String.

I would try:

sqlCmd = "SELECT [MobilePhone] FROM DimAgentProfile WITH(NOLOCK) WHERE UserInitials = ?"

ODBC = CEMODBC.ODBCConnection("VWU_DSN", self.m_E, ["XXX"])

recordset = ODBC.execute(sqlCmd, (UserInitials))

BR,

Thomas

former_member340454
Participant
0 Kudos

Hi Thomas,

It works

Many Many Many Thanks

Best Regards

Rodrigo

former_member250653
Participant
0 Kudos

You are welcome

Answers (0)