cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

IVC Checks list for ANumber

aldets
Participant
0 Likes
296

Hi,

I've got a question about customizing an IVR. The idea is that when a call comes in, the IVR checks if the number is in a VIP list (ie. txt file located in a shared folder). If it is, it's transfered to queue A, if not, it's transfered to queue B.

We have similar solution in a different application, but I'd like to implement it into SAP IVR. I've managed to compare ANumber to a defined var with a small amount of numbers, but currentrly the list contain hundreds and hundreds of phone numbers.

Any ideas or suggestions would be awesome.

Kind Regards,

Alder

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member594564
Participant

# coding=latin-1


import VER
VER.VER(__file__,
"""
Company:     K2 Consult
Filename:    Check_VIP_Number.py
Description: Custom Method to check VIP number from .csv file of VIP numbers.
Created:     27.02.2019
Modified:    -
""",
"1.0.0.0")


from Env        import *
from ICustomize import *
from IVRUtil    import *
from ADO        import *
import csv


class Check_VIP_Number(ICustomize):
  # Customizer for check existance of VIP number in file 
  # NOTE: Keep name, Filename and class name identical.
  # ========================================================================
    def __init__(self, AppConf):
    #self.checkVipInFile = checkVipInFile
        ICustomize.__init__(self, AppConf)
    def checkVipInFile(self, params):  
    # Path to .csv file with VIP numbers
        # be carefull with path to file, if your use windows, whatever you must use
        filename = '//your_shared_folder/numbers.csv'
        numbersList = []
        namesList = []
        with open(filename, 'r') as _filehandler:
            csv_file_reader = csv.DictReader(_filehandler)
            for row in csv_file_reader:
                numbersList.append(row['Number'])
                namesList.append(row['Name'])
    # Number of calling person
	# callerNumber is string
        callerNumber = params.get("callerNumber", None)
    # If number not exists
        if not callerNumber:
            return "ERROR"
    # If txt file with numbers not exists or unavailable
        if not _filehandler:
            return "ERROR"
    # check number in file
        if callerNumber in numbersList:
            return "OK", namesList[numbersList.index(callerNumber)]
        else:
            return "OK", None

We have identical task and few days ago I decide this by Python customizer on IVR.

It works simple: you store .csv file in shared folder with VIP numbers in first column and name in second column. When somebody call to this IVR, your script check existance of that number in .csv file. If number exists - script return caller name, call transfer to queue A and caller name write to log. If number not exists - script return None and call transfer to queue B. If you have some error or timeout on script - call transfer to queue B.

Check source code, I hope, it will useful for you.

NOTE: Be carefull with tabs and spaces in custom script. Use ONLY 4-space instead tab in your script. Your class name must be same as custom script file name

Former Member
0 Likes

Hi Alder,

As a starter I would recommend to check SAP note 1951158. The note contains some nice examples for IVRs and specially for your case there is VIP IVR example.

Br,
Jukka

aldets
Participant
0 Likes

Hi Jukka,

I'm familiar with the given SAP note. Unfortunetly that is not the solution I'm looking for. If I'm not mistaken the VIP IVR recommends to add VIP info to the internal Directory. We have tried silimar solution to show customer name, but if we have several hundred thousand customers, then the Directory is not the place to hold that information. SAP has even given us the same answer, that the Directory is not meant for that.

I'm mostly interested in checking the VIP status from a given file. Since info in that file can change on a daily basis. We rather not burden the Directory with such queries.

PS: I've tried to set up the VIP IVR, but the Customstate "Method name" won't save. It gives me missing or invalid attribute value.

Kind Regardsm

Alder