Author Topic: Call Flow for Useridentification  (Read 2479 times)

mwagner

  • Newbie
  • *
  • Posts: 12
  • Karma: 1
    • View Profile
Call Flow for Useridentification
« on: December 01, 2015, 05:12:38 PM »
Hi,

I'd like to post one of my Call Flow applications to share it with you and maybe get some constructive feedback (bugs, improvements). This Call Flow do a user authentication with some security features:
-   PIN MD5 hashing
-   Blocked PIN if maximum try has reached
-   LOG entrées for successful logins
-   Admin notification by mail if login fails.

It can identify the "user" by two ways:

1. By the Caller ID.

2. By extension and password.


For 1: There is the need for a database entrée which assign the CallerID to the extension.

How to create that:
a.)   Open a SSH connection to your Askozia. User: root, Password: yourAdminPassword
b.)   Type in :
Code: [Select]
asterisk –rc.)   You can now change database entrées with the command database ….
d.)   To create a database entrée for the identification by Caller id, type in the following: database put CALLERIDTOEXTEN TheCallerIdYouWantToEnableWithout00Prefix Extension
Example to assign the Caller ID 49123456789 to the extension 101:
Code: [Select]
database put CALLERIDTOEXTEN 49123456789 101

For 2: To make it work, there has to be database entrées for the following thinks:
-   MD5 hash of the PIN for the extension you want to enable (it has to be set manually or with an other Call Flow): database put PIN TheExtensionYouWantToEnable MD5hashOfPIN
Example - MD5 hash of the PIN Code 1234 for the extension 101:
Code: [Select]
database put PIN 101 81dc9bdb52d04dc20036dbd8313ed055
You can also create a simple Call Flow to create this entrée. Please see the attached image for this.

-   The initialization of the variable GLOBALPINTRY for the extension: database put GLOBALPINTRY Extension 0
Example - initialize the extension 101:  
Code: [Select]
database put GLOBALPINTRY 101 0
-   The admin Email Address:
Code: [Select]
database put EMAIL ADMIN email@admin.com
Important 1: Out of the box, Askozia doesn’t safe the database. So after a reboot, everything is lost. This function comes with Askozia 4.1 and has to be enabled: http://www.askozia.com/handbook/index.php?title=System#Storage -> Check Persistence (Askozia has to be rebooted one time before the persistence works.)

Important 2: To make the Call Flow working, the following database entrées have to exist, too:

/CALLFLOWVARIABLES/CC                             : Countrycode (ex. 49 for Germany)                      
/CALLFLOWVARIABLES/GLOBALPINTRYMAX       : Number of maximum try’s before the PIN is blocked global ( ex. 9)                        
/CALLFLOWVARIABLES/LENGHTOFEXTEN           : length of the local extensions (ex. 3)                        
/CALLFLOWVARIABLES/LOCALPREFIX                : Countrycode + Citycode + Number but without extension (ex. 4930123456 for an extension with the external number 004930123456-101)
/CALLFLOWVARIABLES/MAXLENGHTOFPIN         : maximum length of used PIN codes  (ex. 10)                    
/CALLFLOWVARIABLES/MAXTRYPINENTRY         : necessary for the read-module (ex. 3)                    
/CALLFLOWVARIABLES/PINTRYMAX                  : maximum wrong PIN try before the Call Flow ends (The caller can call again until GLOBALPINTRYMAX is reached)                        
/CALLFLOWVARIABLES/WAITTIMEFORUSERENTRY : wait-time for the read-module (ex. 20)

Important 3: You have to put your announcement to module 119.

I tried to put a lot of commentaries in the Call Flow and I hope everything is clear. Please feel free to use this Call Flow and report your bugs or improvements. On my system, this CallFlow is working without bugs.

I put some information’s in the database which already exists in Askozia (Email addresses, Mailbox PIN Codes, …) I did that because I didn’t find out how to access to this data in a Call Flow. So if someone knows how, I’m open to learn.

If this post starts a constructive exchange, I'd like to post other Call Flows in the future, too.

My System:
Askozia 4.1.2
Incoming numbers: Siptrunk
Incoming provider: Sipgate Team Siptrunk