Home
Introduction
Contents
1. function getFirstRowQuery Squery Sarr colnames FALSE Sparam NULL This function is the procedure to recover a single row from the query that returns one or more rows It returns a row with fields if the query returns at least one row otherwise it returns an empty array or FALSE in case of error The parameters query Sarr colnames and param have the same purposes as the ones described in the fetchTable function Example Let s suppose that we want to print on the screen the number of entries in the table myTable whose field1 has as value value Squery SELECT COUNT FROM myTable WHERE fieldi SarrParam array S valuel Sresult SpDB gt getFirstRowQuery Squery FALSE SarrParam if Sresult FALSE enho tr Ouery Error Ll BSpDB cerrMsg else phe SresesuItIlU s m function beginTransaction This function is the procedure to initiate a transaction Remember that a transaction is used when we want the database to return to its previous state if an unwanted or unexpected event occurs m function rollBack This function is the rollBack procedure for a transaction function commit This function is the commit procedure for a transaction Example Let s suppose that we want to create a function that inserts value1 and value2 in field1 and field2 on myTable1 respectively this table has id as an auto incrementing id field Later on myTable2 we
2. Elastix Development Guidance Manual VERSIONS Version Elastix Date Created by Details Version 1 2 3 0 01 16 12 Alberto Santos Initial documentation Introduction The present manual will serve as a guide for developers that wish to use the Elastix Framework to create new modules In this manual we ll explain how to create a new Elastix module Basics of the Elastix Framework and how to convert our new module into an Elastix Addon 1 Creation of a new Elastix module To create a new module on Elastix we must use Developer and addon included on the Elastix Market Place 1 1 Installation of the Developer addon To proceed with the installation we have to go to Elastix GUI Addons We must be logged in as administrators H Addon Market fld Filter by Available s Name Q Showing 1 10 of 17 gt gt i by Apstel Apste l Visual Dialpian is an innovative visual modeling platform that enables average Elastik users to create validate and p il R Ceploy dialpians in an easy convenient and natural way With Visual Dialpian users can cfficdentiy generate simple and complex 4 Calplans just by dragging and dropping from the 150 available call management objects Location After the installation the Visual Dia plan menu will appear under the PBX tab M info Call Center 2 1 99 11 beta by PaloSanto Solutions P Implemer a professional call center from within your Glastix server With
3. as well as having 755 permissions To use it we must execute the following code in the function we wish to use from our library exec usr bin elastix helper script privileged parameter Soutput Sret script privileged is the name of the privileged script found on that path m parameter is the parameter that will be given to the script script privileged One or more parameters can be given to it simply separate them with spaces itis also possible not to give parameters If the value of ret is 0 that means that there were no problems themes This folder is the view layer Inside this folder we will find another folder named default which contains all the themes available for the module For example a module may have a grid as main view this means that it will need a theme a tpl file containing filters for the grid in case they exist otherwise a tpl file would not be needed and it is also possible that a form is shown when we press a button for which we would need another tpl file with the form fields Below we will show a typical template for a tpl theme and another for a form Continues in the next page Typical template for a module with a grid theme table width 99 border 0 cellspacing 0 cellpadding 0 align center gt tr class letral2 gt td width 12 6 align left gt lt input class button type submit name new value SNew gt lt td gt lt td width 10 align
4. 1 eq 2 then update elastix dbprocess update SpathModule setup db Spreversion fi Clean rm rf RPM BUILD ROOT preun if 51 eg 0 then Validation for desinstall this rpm echo Delete example menus elastix menuremove modname Here you should call to elastix dbprocess for deleting the same way that it was for install just that instead of word install goes word delete But this is not often used due to the databases usually are not deleted Ix files sdefattr asterisk asterisk localstatedir www html usr share elastix module installer changelog Mon Jan 30 2012 Alberto Santos lt asantos palosanto com gt 2 2 0 1 Initial version 4 3 Finalization of the certification process Once the RPM is created one proceeds with signing the Elastix Software Certification agreement and sending the rom package to PaloSanto Solutions to the email address addons palosanto com with a copy to asantos palosanto com along with a users manual in order to continue with its certification revisions Once this is approved it will go on to become a part of the Elastix repositories and will be turned into an Elastix Addon If you have any doubts about the certification process or any other aspect of the Elastix Framework you can send an email to any of the addresses mentioned previously or visit our web page at http addons elastix org
5. The value of INPUT TYPE can be one of the following TEXTAREA TEXT CHECKBOX PASSWORD HIDDEN FILE RADIO SELECT or DATE Where each of these words represents the element desired Below we show some examples of each of these types of elements After these examples more about the other elements of the array will be explained TEXTAREA Example A textarea is wanted with the label descripci n and 6 columns and 4 rows SarrFormElements array description gt array ULABRL gt CPIUDOGSOTIDLIONER I REQUIRED gt ves INPUT TIPE gt TEXTAREA INPUT EXTRA PARAM gt array style gt width 400px VAL OAT LON TYPE gt text VALIDATION EXTRA PARAM gt MM3 ROWS gt 4 COOLS m gt E TEXT Example An input is wanted to enter the name of a client SarrFormElements array name gt array neo gt trpUMAe REQUIRED gt yes ANPUT TYPE gt HI G INPUT EXTRA PARAM gt array style gt width 200px Vee wel eee gt text VALIDATION EXTRA PARAM gt TM dy CHECKBOX Example A checkbox is wanted that says Enable SarrFormElements array enable gt grravr ULABELU gt _ tCrIEHaDIe J REDUIRED gt yes ee TIFE gt UBECRBOX INPUT EXTRA PARAM gt TM VALIDATION TIPET gt UDeXLt VALIDATION BATRA PARAM gt HM dy E NOTE When creating el
6. elastix framework gt 2 2 0 25 description Elastix Module Example prep setup n modname SInstall rm rf RPM BUILD ROOT Files provided by all Elastix modules mkdir p SRPM BUILD ROOT var www html mv modules RPM BUILD ROOT var www html The following folder should contain all the data that is required by the installer that cannot be handled by RPM mkdir p SRPM BUILD ROOT usr share elastix module installer namej fversionj release mv setup SRPM BUILD ROOT usr share elastix module installer namej fversionj release mv menu xml RPM BUILD ROOT usr share elastix module installer name fversionj 9 release pre mkdir p usr share elastix module installer namej version release touch usr share elastix module installer name version release preversion modname info if S1 eq 2 J then rpm q queryformat VERSION RELEASE name gt usr share elastix module installer name versionj release preversion modname info Tr post pathModule usr share elastix module installer name versionj e release Run installer script to fix up ACLs and add module to Elastix menus elastix menumerge SpathModule menu xml pathSQLiteDB var www db mkdir p SpathSQLiteDB preversion cat pathModule preversion modname info if 1 eq 1 J then install The installer database elastix dbprocess install SpathModule setup db elif
7. show the help embedded in the module Below there is a simple example of the code in this file This help will only show the title of the module followed by a brief description and an image in the indicated path html header link rel stylesheet href themes STHEMENAME styles css gt lt link rel stylesheet href themes STHEMENAME help css gt lt header gt lt body gt hl node name lt h1 gt p align Justify gt This is the embedded help for my module lt p gt lt div gt lt img src modules Snode_id images image png border 0 gt lt div gt lt div gt Figure 1 lt div gt lt br gt lt body gt lt html gt images In this folder all the module s images will be saved for example the icon images used in the embedded help etc lang As we know the Elastix Framework supports language translation This folder stores the translations for our module Each translation for each language is stored in a different file according to the following chart File Language bg lang Bulgarian br lang Portuguese ca lang Catalan cn lang Simplified Chinese da lang Danish de lang German en lang English el lang Greek es lang Spanish fa lang Persian fr lang French it lang ltalian hu lang Hungarian hr lang Croatian pl lang Polish ro lang Romanian ru lang Russian sl lang Slovenian sv lang owedish ko lang Korean ja lang Japanese sr lang Serbian Therefore if we wan
8. PCI E Boards Location After the installation the Khomp menu will appear as top level menu main tabs Developer 2 3 0 4 by PaloSanto Solutions inside Eastix s web Ul Modules created through t s addon can range anywhere from embedded webpages to forms and tables where information can be stored and presented Location After the installation the Developers tab will appear next to the Addons tab P Elastix s Developer addon provides a friendly user interface for creating custom modules and choosing where to piace them Jd Image 1 Identifying the addon Developer Once we ve identified the addon we click on its respective Install button After this the addon installation process begins and we must wait a few minutes for the installation to end y Addon Market pw Q Addon elastix developer was successfully Installed Updated Filter by Available Name Q Showing 1 10 of 12 pj Apstel Visual Dialplan 3 2 00 1 by Apstel k Apstel Visual Dialplan is an innovative visual modeling platform that enables average Elastix users to create validate and deploy dialplans in an easy A convenient and natural way With Visual Dialplan users can efficiently generate simple and complex dialplans just by dragging and dropping from the 42 150 available call management objects 9 Location After the installation the Visual Dialplan menu will appear under the PBX tab More info Call Center 2 1 3 1 INST
9. day in two digits then space followed by the month in three letter format then space and the year in four digits If one wants to change this format one would simply have to place in INPUT EXTRA PARAM the new format and if we want we can also enter the time by using TIME gt true For example if we want the format to be yyyy mm dd h m s INPUT EXTRA PARAM arrev TIIME true FORMAT gt IY m d eHriwMrSB As could be seen in the previous examples there are indexes where all coincided and others that were simply specific to the type of element like for example the index COLS in TEXTAREA Now we will explain about obligatory and common indexes LABEL The value of this index as its name suggests will be the descriptive label that is shown beside an element REQUIRED The value of this index can be yes or no if it is yes then this field is obligatory in order to be able to save the form otherwise this can be left blank INPUT TYPE Type of element already described previously INPUT EXTRA PARAM Additional input parameters can be extra styles or attributes These must be passed as an array otherwise it must be an empty string VALIDATION TYPE Indicates the type of validation that will be applied to the value entered by the user The values can be the following text he user can enter anything ereg A regular X expression must be passed in VALIDATION EXTRA PARAM and
10. elastix The parameter log is the text that will be written in the log If the SlogFILE file doesn t exist it creates it if it already exists it adds the text to the end of the Slog file Once more it s important to remember that the httpd service used by Elastix has asterisk as a user meaning that it will only be able to write to files to which asterisk has permissions In case that logFILE doesn t exist there is no problem since asterisk is owner of the var log elastix folder so that it will be able to create files there without any problems Example If we want to write You have entered the test module in a log called myModule log we would have to do the following writeLOG myModule log You have entered the test module In this way the log myModule log will be created if it doesn t exist containing the following Jan 19 14 48 11 You have entered the test module The date to the left is the date of the server at the moment of writing the message in the log 2 2 paloSantoDB class php Class This class is in charge of creating an object with the connection to a database The objective of this class is to encapsulate the database connection process so that the developer will simply have to instance this class and carry out the queries he needs Its not necessary to include this class in our module since the Elastix framework already takes care of this To instance the class we must pass
11. for the string passed as a parameter in the keys of the language array of the framework and module lang file inside lang folder on the module it will choose the corresponding folder to the language in which the Elastix server is configured in case it finds it the function returns the value of the array for that key otherwise it will return the same string passed as parameter Example If we have selected Spanish as our language and we want a translation of Hi this is my first module which is previously defined in es lang we simply need to do the following Lranslarte cr Hri this 18 my Tire module n function getParameter parameter This function is used when we want to obtain a parameter that has been sent by POST or GET First it searches for the parameter in the array POST and if it exists it will return POST parameter If it doesn t exist it ll look up in the array GET if it exists it will return GET parameter if it doesn t exist in _POST nor GET the function returns NULL Example Let s assume that we have a module with a save button with the name save and we want to know if that button was pressed We would have to do the following if getParameter save In this way it will enter if if the save button was pressed m function obtenerClaveCyrusAdmin ruta base This function returns the admin password for Cyrus The parameter ruta base must be entered a
12. kinds of users The Elastix framework includes it automatically To instance the class one must pass the DSN string for the connection to the database acl db or one can also pass it an object that is an instance of the class paloDB that was passed the DSN for acl db The variable arrConf elastix dsn acl already contains the DSN for acl db this variable is created by the framework Therefore if we want to instance this class in our module we would do the following global SarrConf SpACL new paloACL sarrConf elastix dsn J acl This class is somewhat delicate and could compromise the system if used incorrectly It is recommended to only use the functions described below and to let the Elastix default modules take care of other user administration tasks m function getUserExtension username Procedure to obtain the extension of a user through the username As can be imagined the username parameter is the name of the user whose associated extension we want to obtain Example Let us suppose that we want to obtain the extension associated with the user that is logged on qusername p SGESSIDONI SIBSLIE uger Sextension SpACL gt getUserExtension username function isUserAdministratorGroup Susername Procedure to find out if a user belongs to the administrator group or not Here too the parameter Susername is the name of the user about whom we want to learn whether it belongs or d
13. the DSN of the database Example Let s suppose that we want to instance a paloDB class in our module to create a connection to a mysql database named myBase accessible just by the root We would have to do the following Sdsn generarDSNSistema root myBase SpDB new paloDB Sdsn Once this class is instanced remember to pass it for reference to the other functions required this will be very important especially when we work with transactions Below we ve detailed some of its functions function genQuery Squery param NULL Is the procedure to execute a SQL sentence that does not return queues or results In case of an error it assigns to the variable class this errMsg It is only used to manipulate data of the database The parameter Squery is the string that contains the query that will be executed The parameter param is an array that is only passed on to this function when parameterized queries are carried out it is recommended that all queries are parameterized especially when there are variables entered into the server by the client Example Lets suppose that we want to insert a new entry in the table myTable The fields are field1 and field2 with the values value1 and value2 respectively and arrive to the server by the client We would have to do the following let s suppose that we have already instanced the class with the corresponding base s DSN in the pD
14. ALL by PaloSanto Solutions T Implement a professional call center from within your Elastix server With this official Call Center module Elastix administrators will be able to easily create and modify agents outbound campaigns customizable forms clients information handle inbound calls generate detailed reports and much more Location After the installation the Call Center tab will appear next to the Extras tab More info Developer 2 2 0 2 UNINSTALL XX by PaloSanto Solutions Elastix s Developer addon provides a friendly user interface for creating custom modules and choosing where to place them inside Elastix s web UI Modules created through this addon can range anywhere from embedded webpages to forms and tables where information can be stored and 5 KJ presented Location After the installation the Developers tab will appear next to the Addons tab More info Image 2 End of the installation of the Developer addon m After this we must exit the GUI and login again as administrator We should see a new menu tab with the name Developer We will refer to this addon as Elastix Developer 1 2 Using the Elastix Developer Elastix Developer allows us to transparently create the initial skeleton for the code necessary to create an Elastix module which can help save hours of work in many cases The Elastix Developer has three submenus but the one we are interested is named Build Module
15. B variable Squery INSERT INTO myTable fieldli field2 VALUES SarrParam array Svaluel Svalue2 Sresult SpDB gt genQuery Squery SarrParam if Sresult FALSE eclo Cri Duer Error ISBDH COrrMsgs else Goo Uri Query Successfully executed The order in which the array SarrParam is placed is very important since queries will be assigned according to this order n function fetchTable query arr colnames FALSE param NULL Is the procedure that recovers all the rows resulting from an SQL petition that returns one or more rows The parameters query and param have the same purpose as the ones described in the previous function The parameter Sarr colnames will be FALSE if we want that each tuple has and incremental number as an index if it is TRUE each tuple will have the name of the column as an index Example Let s suppose that we want to print on the screen the values of the column field1 from the table myTable when field2 has as value value2 and we assume that we already have the object pDB Squery SELECT fieldl FROM myTable WHERE field2 2 SarrParam array S value2 Sresult SpDB gt fetchTable Squery TRUE SarrParam if Sresult FALSE econo tr Query rror D2500B errMSg elsef if count Sresult gt OM foreach Sresuit as Svalue Ono Svalues rigid lt or JU else echo ri ere 18 BO data I0 Che criteria pearc
16. and is the first submenu The function of the Build module is to generate the code skeleton of our new module so we can continue with the development by extending this initial code As we create the module from here we will generate the following process The menu or menus within the Elastix Web interface That is we won t have to modify the database menu db manually The code skeleton which will be placed in a folder with the same name as the module s ID This folder will itself be located inside the folder var www htm1 modules which is where all the Elastix modules are found That is we won t have to create this folder manually Prototype screens There are three types of screens form report and frame Let s see how the module looks 2o Build Module Fd Save Required field General Information Module Name Your Name Group Permission administrator Operator x extension Module Id Your e mail Call Center Location Module Level Level 2 Level 1 Parent E Exists Level 1 Parent Level 1 Parent Id Name Module Description Module Type Form Field Name gt gt Type Field Type Text lt lt Image 3 The module builder included in the addon Developer As we can observe the Build module is divided into three parts General information m Location m Module Description General Information This section allows us to define the name and unique i
17. d and the parameter onchange select is the event that will be associated to the combo each time the combo s value is changed function addHTMLAction html This function allows adding a new html type element to the grid The parameter html is the html code to be added m function addFilterControl msg amp SarrData SarrFilter array Salways activated false This function allows adding a filter controller to the grid purple colored messages show up when the filter is applied The parameter Smsg is the message that will appear when the filer is applied the parameter SarrData is the array with the data that lets us know if the filter is being applied or not the parameter SarrFilter is an array that lets us associated two or more filters as a single one where the array s key is the name of the filter s element and the value is the default value it will have The parameter always activated will be true if we want it to always show the filter controller otherwise it is left on false 2 7 Class paloSantoJSON class php This class is used to code in JSON format It can be of great help when an AJAX petition is made to the server in order to send the answer to the client in JSON format It codes a three element array whose indexes are error where errors are stored in case there are any statusResponse which stores the response s status which is set to OK by default and message which stores the wanted response We m
18. de once modules Smodule name configs default conf php include file language agree to elastix configuration if file language not exists then include language by default en elang get language base dir dirname SERVER SCRIPT FILENAME Slang file modules module name lang lang lang if file exists Sbase dir lang file include once Slang file else include once modules module name lang en lang global variables global SarrConf global SarrConfModule global SarrlLlang global arrLangModule earrConf array merge arrConf sarrConfModule SarrLang array merge S arrlang SarrLangModule folder path for custom templates sLemplates dir imsert oarrcConr rtemplates dirty sarrLonf I templates Odzr jsi bthemes Slocal templates dir Sbase dir modules module name Stemplates dir orsbanrITLHNEUSTtIZ conexion resource 3PDB new paloDB arrConf dsn conn database SpDB In this case we do not use a database fractions JCT lon getAcLtrion Js econrent Mj switch Saction case save Scontent saveTestModule Ssmarty emodule name el0cal templates dir break default view form content viewFormTestModule Ssmarty Smodule name flOoDBI templates cir 7 break return Seontenc function viewFormTestModule Ssmarty module name l1ocal templates dir 5arrFormTestModule coreatePFieldFormt SoForm new paloForm Ssmarty Sar
19. dentifier of the module as well as the information of the person creating the module so that they ll appear in the header comments of every PHP program file It also allows us to configure the level of accessibility that the module will have through the parameter Group permission General Information Module Name Your Name Group Permission administrator Operator extension Module Id Your e mail Call Center Image 4 General information section within the module builder Location In this section we must setup the location within the general menu where we will place the new module By default this section starts at level 2 Location Module Level Level 2 Level 1 Parent Exists No Level 1 Parent Name Level 1 Parent Id Image 5 Section where the module s location is configured If we select level 3 then new fields will appear automatically for level 1 and level 2 identifiers Location Module Level Level 1 Parent Exists No Level 1 Parent Name Level 1 Parent Id Level 2 Parent Name Level 2 Parent Id Image 6 New fields appear if it says that the module will be level 3 To clarify the meaning of the fields shown in this section let s look at the following table Field Name Description Module Level Here we define the hierarchy level of the module Level 1 Parent Exists Here we define whether we place a new menu under an existing parent menu of level 1 or if we c
20. divorced gt Ltr DIVvorceq s conan cing gt Ur LORSDILIANQ 4 SarrFields array name gt array LABEL gt tr Name REQUIRED gt yes ANUT TIPES gt Thal z INPUT EXTRA PARAM RUM VALIDATION TYPE gt text VALIDATION EXTRA PARAM n lasst name E gender Hemsrr1 gt array LABEL REQUIRED Lae ae ANPUT EXTRA FARAN VALIDATION TYPE VALIDATION EXTRA PARAM i gt array LABEL URERDQUIRED ANPUT TIEN INPUT BATRA PARAM VALIDATION TYPE VALIDATION EXTRA PARAM gt array LABEL REQUIRED INPUT TIFE INPUT EXTRA PARAM VALIDATION TYPE VALIDATION EXTRA PARAM marital BISLus gt array LADEL RBQUIRED ANPUT TITE INPUT EXTRA PARAM tr beast Name ves Pe TEXT Vr rm 7 text s VI rm tri Gencer yes SADIOT Sgender text we oe a 6 ea ves s Taye vm 7 email Vr rm Ctr Marrtal Status yes y OLET marital status VALIDATION TYPE text VALIDATION EXTRA PARAM m dy 2 return SarrFields function getAction if getParameter save return save else return report gt Test Module Save m Required field Name Last Name Gender Male Female Email Marital Status Single gt Image 8 View of the form type module according to the code described previously 2 6 Class paloSantoGrid clas
21. e value SSAVE gt lt td gt lt td align right nowrap gt lt span class letral2 gt lt span class required gt lt span gt SREQUIRED FIELD lt span gt lt td gt lt tr gt lt table gt lt table class tabForm style font size lopx width 100 gt tr class letral2 lt td align left width 130px gt lt b gt Sname LABEL lt span class required gt lt span gt lt b gt lt td gt lt td align left name INPUT td lt tr gt tr class letral2 td align left gt lt b gt Slast name LABEL lt span class required span b td lt td align left gt Slast name INPUT td lt tr gt tr class letral2 lt td align left gt lt b gt Sgender LABEL lt span class required gt lt span gt lt b gt lt td gt lt td align left gt Sgender INPUT lt td gt lt tr gt tr class letral2 lt td align left gt lt b gt Semail LABEL lt span class required gt lt span gt lt b gt lt td gt lt td align left gt Semail INPUT lt td gt lt tr gt lt tr class letral2 lt td align left gt lt b gt Smarital status LABEL lt span class required gt lt span gt lt b gt lt td gt lt td align left gt Smarital status INPUT lt td gt lt tr gt lt table gt File index php php include once libs paloSantoForm class php function moduleContent amp Ssmarty module name include module files inclu
22. e applied to the database corresponding to the name of the folder These scripts wil have the names 1 schema sql 2 schema sql 3 schema sql etc usually you will only need one the prefix number is important because it indicates the execution order For sqlite3 databases tables are created and entries are added by default in case they re necessary but for mysql databases it is also necessary to create the database CREATE DATABASE dbname followed by a USE dbname so that from there one can continue creating tables and the rest In the folder update there will be a folder for each database with the same name as the database Inside each of these folders will be another folder named version sql that will contain the update sql scripts The name of these scripts is very important they must have the following structure number_ lastVersion_ newVersion sql Where number is the order of execution for the script lastVersion is the last existing version newVersion is the new version to be launched This script will only be executed in versions lower than newVersion Example What will be the name for update sql script for 1 An update script that must be the first to be executed and in its moment the last launched version was 2 2 0 2 only versions lower than 2 2 0 3 must be executed 2 Another update script that is the second to be executed and in its moment the last launched version was 2 2 0 6 only version
23. ed by default with a file named default conf php this file must contain the basic configuration for the module NS Below there are two DSNs used in Elastix m Sqlite3 sqlite3 SarrConf elastix dbdir base db Mysql We can use the function generarDSNSistema Generate DSN System which returns the connection string This function can be found in var www html libs misc lib php Below we ll see the function in more detail Note The following information is only available in Spanish We are providing a translation for explanation purposes P Funci n para construir un DSN para conectarse a varias bases de datos frecuentemente utilizadas en Elastix Para cada base de datos reconocida se busca la clave en etc elastix conf o en etc amportal conf seg n corresponda Translation Function to build a DSN to connect to multiple databases frequently used in Elastix The key for each recognized database is looked up on one of the following files etc elastix conf or etc amportal conf param string sNombreUsuario User name to interrogate param string sNombreDB Database name for DSN param string ruta_base Base route for library inclusion return mixed NULL if the user is not recognized or the DSN with the correspondent key function generarDSNSistema sNombreUsuario sNombreDB ruta basez help In this folder we can find a file named id modulo hlp This is the file that is used to
24. efault and place the css we want they must have the extension css The framework will take care of including these files automatically index php The file index php of our module represents the control layer the framework is responsible of directing the petition to this file calling on the function moduleContent This file is in charge of communicating with the view and model layers If we used the Elastix Developer to create the module we will see that this file is already written with a default template We can make all the modifications we need over this template according to the requirement of our module 2 Using the Elastix Framework We have created our module with a basic configuration but we still do not have a clear knowledge of the different facilities and libraries offered to us by the Elastix framework In the following sections we will detail some of these libraries and classes with their most important functions All of these libraries are found at var www html libs 2 1 Library misc lib php In this library we will find several types of functions It is not necessary to include it in the module since the Elastix framework is in charge of this task We will list the most relevant functions and the ones we will use often function tr s This is the function required for text translation It receives the text to translate as a string parameter The function works in the following way The function looks
25. ements of this type the framework automatically creates two elements one is the actual checkbox and the other is a hidden element whose value is on in case the checkbox is activated or off otherwise Therefore if in our module we want to know if the checkbox was activated or not we would have to do the following Senable getParameter enable ifi lbenablge on elsef PASSWORD Example A field is wanted where the user enters a password SarrFormElements array passworg gt array LABEL REQUIRED INPUT TYPE INPUT EXTRA PARAM VALIDATION TYPE VALIDATION EXTRA PARAM dy Ir HIDDEN Example gt Cri Password gt yes gt PASSWORD ourrav stvie gt wizgthiz0Upx gt text gt nmn A hidden field is wanted in order to store a user s id SarrFormElements array a gt array LABEL REQUIRED INEU TITE INPUT EXTRA PARAN VALIDATION TYPE VALIDATION EXTRA PARAM dy T FILE Example gt um gt yes gt HIDDEN gt T gt Tess gt nmn A field is wanted in order to pass it the path of a file SarrFormElements array file gt array REQUIRED aes TIPA ANPUT EXTRA PARAM VAGI DATION TII VALIDATION EXTRA PARAM LABEL gt GIqUEIISUL gt ves gt File gt gt gt filename gt nm RADIO Example Two radi
26. eoy male T male JJMi PamsSrLy oassron mb title UCr Valzdatrion Error J pemearly lassign mo message Ir The gender can only De male or i f male s return viewFormTestModule Ssmarty module name PIOUEI templates cir elseif lin array omarilal status array single w2dowed marr iedg dgivorced oohabDiting JJ PEBmarcy oassign mb tible ur vValigaLtzon Error reMarty assign mp message tCr Ihe marital status can only be singie i wridowed married divorced or oconsbrItlegi Jg return viewFormTestModule Ssmarty module name PloDSI templates cir elsef PaMRTLy oossrogni i mb title Cr Messsyge 5 smessage tr The following data was entered lt br gt message lt b gt tr Name lt b gt htmlentities name br b tr Last Name lt b gt otmilentities slast mane lt or jose Cr Conder I lt b gt htmlentities Sgender lt br b tr Email b htmlentities sSemail br JOD Le era ce Brace sey Dee eee Clee eter t ai Status pemarcy lassign mp massage message return viewFormTestModule Ssmarty module name local templates dir function createFieldForm Sgender array male gt tri Male Tremel gt Tr Femaig J7 omarital status array Lingle gt Crt eine eS waco gt tr Nigo0wOeg marr2ieq gt cr Marr2ieg J
27. eturns the value of a keyword in the file The parameter Slista is the array that contains the configuration file The parameter Sclave is the keyword to be searched for in the file Example Let s suppose that we have the file etc myModule conf with the same information that was described above and we want to do the following if password is equal to 12345 then we will change it to new12345 include once Iibs paloSantoConfig class php SpConfig new paloConfig etc myModule conf s s Sscontent pConfig leer configuracion FALSE Spassword pConfig privado get _valor Scontent password if Spassword 12345 SarrReplaces array password gt new12345 PeCOntiG escripbiz Configuracion arreep laces 7 2 5 Class paloSantoForm class php This class is used to easily manage the form type modules It is necessary to include itin our module in case we wish to use it The builder for this class has the following form function paloForm amp Ssmarty SarrFormElements Where Ssmarty is an instance of smarty which is passed to the function moduleContent in our module and arrFormElements is an array of arrays that contains the elements of the form In the main array the indexes represent the id of the element and in the secondary array there must always exist an index named INPUT TYPE that indicates the type of element that is required
28. ful controls such as navigation buttons are included automatically After generating the necessary code with the Build module it is easier to link the Grid with a database in order to show useful information n Framed Embeds an arbitrary URL in the screen Very useful when we want to integrate external applications in the Elastix Web Interface An example of this is the integration of vtigerCRM Module Description Module Type Field Name gt gt Grid Framed Type Field Type Text v lt lt Image 7 Creation of a Form type screen Buttons gt gt lt lt help us to add or remove fields from our form As we save the information established for the new module the following directory tree wil be created in documentRoot modules where documentRoot is var www html for Elastix There s and exception for framed modules where the module is simply a link to an existing URL id module As you will note a module has the same general architecture of the C framework MVC2 web architecture Therefore we define this as a dre MVC2 within another MVC2 a recursive definition of grade 2 help G3 ose This allows us to make a similarity between the folders that have D ndesh the following relations e themes is the view layer Ma index php is the control layer e libs is the model layer libs eye 1 3 Brief description of every folder created inside the module configs This folder is creat
29. hat contains an HTML form To do this take a form template which is passed in the parameter templateName and insert into it the elements of the form The parameter Stitle is the title that the form will have and the parameter arrPreFilledValues is an array that contains the default values for the form where the index is the element s id and its value is the value that the field would have by default m function validateForm SarrCollectedVars This function returns TRUE in case that the data entered into the form was correct and otherwise FALSE The parameter arrCollectedVars contains the values entered into the form Example Let s suppose that we want a form type module that has the following fields Name which is a text box Last name which is a text box Gender which is a radio button that can be either masculine or feminine Email that is a text box and Marriage status that can either be single widowed married divorced or civil union All of these fields are required There is also a Save button that when pressed validates the data entered in case of an error it maintains the persistence of the data and the error is indicated otherwise it shows a message showing the data entered File themes default form tpl lt table width 100 border 0 cellspacing 0 cellpadding 4 align center gt tr class letral2 gt lt td align left gt lt input class button type submit name sav
30. ibute the parameter Salt is the label that will be shown for the element the parameter icon is the path to an image that will be the element s representative icon and the parameter onclick is the event that will be linked when clicking on that element optional function addInputTextAction name input add Slabel New Row Svalue input Stask add Sonkeypress text null This element allows adding an element to the grid with the type input text The parameter name input is the element s name attribute the parameter Slabel is the label that will be shown for the element the parameter value input is the input s default value the parameter Stask is the action that is sent to the server when the button associated to the text box is pressed and the onkeypress text parameter is the event that will be associated with the textbox each time a key is pressed m function addComboAction name select cmb label New Row Sdata array S selected null Stask add sonchange select null This function allows adding an element to the grid with the type combo box The parameter name select is the element s name attribute the parameter Slabe is the label that will be shown for the element and the parameter data is an array with the combo s data the parameter selected is the element selected by default the parameter task is the action that is sent to the server when the button associated to the combo is presse
31. l menulist are all the modules and each module is described with the label menuitem where the attribute menuid is the id of the module the attribute desc is the label that will be shown in the web interface the attribute parent is the id of the module that will contain it the attribute module can be yes if it is an actual module or no if it is a parent module or if it is a link type module the attribute link is the link to which the module will lead and the module order is the order that the module will occupy In the label permission are detailed the user groups that will have access to the module by default Now the only thing to be done is to use the script elastix menumerge giving it the XML file so that the Elastix integration is carried out Also if we want to remove a menu the script elastix menuremove is executed giving it the menu s id This must be carried out in the spec file The folder modules contains all the modules included in the addon The folder setup contains configuration files or necessary scripts for the correct functioning of a module Also in case of a local database being used it will count with a folder named db Inside this folder there will have to be a file named db info and three folders install update and delete The file db info contains necessary information about the database It has a header indicating the name of the database then the keyw
32. left gt amp nbsp amp nbsp lt td gt td width 10 align right gt i9filter type LABEL amp nbsp amp nbsp i filter type INPUT nbsp snbsp i9filrter txt INPUT lt input class button type submit name show value SSHOW lt td gt lt tr gt lt table gt As we can see this theme has a New button with a filter Typical template for a module with a form theme table width 99 border 0 cellspacing 0 cellpadding 4 align center gt lt tr class letral2 lt td align left gt lt input class button type submit name save value SSAVE gt lt td gt lt tr gt lt table gt lt br gt lt div class tabForm style font size 16px height auto width 100 gt lt table style font size 16px width 100 cellspacing 0 cellpadding 8 gt tr class letral2 lt td align left width 130px gt lt b gt Smanufacturer LABEL lt b gt lt td gt lt td align left gt Smanufacturer INPUT lt td gt lt tr gt lt table gt lt div gt For this form it is enough to have a Save button with a field named manufacturer These are basic templates in fact we can make them as complex as we require If we want to include javascripts in our module we only need to create a folder named js inside themes default and place the javascripts we want they must have the extension js If we want to include css we need to create a folder named css inside themes d
33. o buttons are wanted in order to indicate the gender of a person Sgender array m eee ly Uu gt Ur Frere ie 7 SarrFormElements array gender gt errey IDABEL gt vcr Genger REQUIRED gt yes ANPUT TIPE gt RADIO INPUT EXTRA PARAM gt Sgender VALIDATION TITE gt Perec VAGIDATION EXTRA 2a gt Tm dF SELECT Example A combo is desired to select the payment method that a client will realize with the options cash credit card check or bank transfer epaymentMethod array cash gt tr Cash Ureglt card gt _tr Credit LATO Jj GODOSOE gt r Loek y Dank transrer gt tri Bave Iransrer Jo SarrFormElements array paymentMethod gt array DAGEL gt tr Payment Method REQUIRED gt yes Leo ee gt UOELECI ANPUT EXINA PARAM gt SpaymentMethod VALIDATION TITE gt text VALIDATION EXTRA PARAM gt M Le DATE Example A field is wanted in order to enter the date in which a payment took place SarrFormElements array paymentDate gt array LABEL gt Er Paymen Date REQUIRED gt yes ANPUT IIPIPET gt DATE INPUT EXTRA PARAM M VALIDATION TYPE gt ereg VALIDATION EXTRA PARAM gt 5IISOIGgIL IIII 2 1 8paecBr T tainume y iS3JIItSpacer ITIItsOiQg2Et2 4 5 Js The format by default for the date is the
34. oesn t belong to the administrator group Example lf we want our module to carry out certain tasks if the logged user is in the administrator group and others if he is not we could do the following vPusername p SEJSSION Glasrtix user if S pACL gt isUserAdministratorGroup Susername elsef 2 4 Class paloSantoConfig class php This class is very useful especially for parsing configuration files allowing us to read or write to them It is necessary to include this class in our module in case we require it include once l1ibs paloSantoConfig class php This class has the following builder function paloConfig directorio Sarchivo Sseparador separador regexp Susuario proceso NULL Where Sdirectorio directory is the path where the file is found Sarchivo file is the file to be parsed separador separator is the string that separates the keywords with its value separador regexp is a regular expression to be interpreted as a separator and usuario proceso process user is the user that initiates the process As can be observed only directorio and archivo are required parameters the rest are optional and have default values Lets suppose that we have the configuration file etc myModule conf which contains the following user user password 12345 email user domain com privileges all Now we will instance to the class paloConfig to parse this file SpC
35. on name type permissions etc Example We want to create the file menu xml for a parent module named Parent Module with id parent module located under the PBX module in position 6 There will also be two other modules The first will be Test Module with id test module located inside parent module in the first position and the module Link Module with id link module which is the link type module to access the server through the 8080 port By default only users with the administrator group can gain access to these modules lt xml version 1 0 encoding UTF 8 lt module gt lt menulist gt menuitem wWenauld parent module desc Parent Module parent pbxconfig module no link orderz 6 permissions group id 1 name administrator desc total access gt lt group gt lt permissions gt lt menuitem gt lt menuitem menuide tesc module desc Test Module parent parenL module module veo Iaxnk or dere ol1 5 permissions group id 1 name administrator desc total access gt lt group gt lt permissions gt lt menuitem gt Omenultem menuld link module desc Link Module parent parent module module no link http NAME SERVER 8080 order 62 gt lt permissions gt group id 1 name administrator desc total access gt lt group gt lt permissions gt lt menuitem gt lt menulisetc gt lt module gt As can be seen inside the labe
36. onfig new paloConfig etc myModule conf s s In this way we will go to parse the file etc myModule conf which has as separator the symbol and can be or not be accompanied with blank spaces to either side Now we will detail some of the main functions of the class paloConfig x function leer configuracion bComentarios true This procedure initiates the reading of a file by storing it in an associative array that is returned as an answer If the parameter bComentarios is FALSE then only the values that are not comments in the array will be found and the return array will have as indexes the keywords in the file but if it is TRUE then in the returned array one will find both comments and configuration values and the indexes for this will be numerical function escribir configuracion Sarr reemplazos Soverwrite FALSE This procedure is used to write in the configuration file The parameter arr reemplazos is an array that contains the changes to be made where the index of the array represents the keyword to be modified in the file If the keyword is found in the file then it is modified and if it is not found then it adds it If the parameter Soverwrite is FALSE then the changes contained in Sarr reemplazos will be made but the rest of the file will be kept intact but if it is TRUE then the file will be overwritten by Sarr reemplazos function privado get valor 1lista clave Procedure that r
37. ord ignore backup that will be yes in case you do not wish to make a backup of an existing database with that name otherwise it will be no It also has the keyword engine that indicates the engine used by the database in Elastix we use sglite3 or mysql then the keyword path that indicates the path where the database is located for sqlite3 it s Ivarwww db and for mysql it is var lib lmysql and finally the keyword deletable which will be yes if one wishes to be able to eliminate the database when the package is uninstalled otherwise it will be no having this field in yes doesn t mean that the database will be eliminated automatically when the package is uninstalled it simply opens that possibility what you will need to do is place a database elimination script in the delete folder Example Build a db info file for an addon that will have a sqlite3 database named myDBSglite which must have a backup in case it exists and it must not be deletable and a mysql database named myDBMysal with the same characteristics myDBSgqlite ignore backup no engine sqlite3 path var www db deletable no myDBMysq1 ignore backup no engine mysql path var lib mysqgl deletable no In the folder install there will be a folder for each database with the same name as the database Inside this folder will be sql scripts that will only be executed when the package is installed and will b
38. rFormTestModule begin Form data persistence to errors and other events 2 DATA _POST VomAe Ly Cass ign sea lt Lr save ssmarLty oassrogn REQUIRED FIELD tr Beguired zxelg j5s Ssmarty assion loon images list png ehtmlForm oForm fetchForm local templates dir form tpl tr Test Mognle DATA Scontent lt form method POST style margin bottom 0 action menu module name gt htmiForm lt form gt return eoDntentr function saveTestModule Ssmarty module name local templates dir SarrFormTestModule createFieldForm SoForm new paloForm Ssmarty SarrFormTestModule if SoForm gt validateForm POST Validation basic not empty and VALIDATION TYPE Ppamasriy osssiogn mb cite Ir VAIIGNLIOMS Error SarrErrores SoForm arrErroresValidacion POIIrEPPTOIMSE lt b gt DrIUIBe teligwing Lielas CONTAIN errors 7 lt 7o gt lt or7 gt IIULE Breer er error es amp amp count Sarrkrrores gt OQ 4 foreachi oarrErrores as 3k 3v SatrErrorMog Q EE s sEmsrrLy oassign mb message SELFEFrPOIMSg return viewFormTestModule smarty module name PlossI LONDIGLOS dir elsef Here are extra validations Sname getParameter name 9last name getParameter last name Sgender getParameter gender Semail getParameter email pmarital status ge_rarameter Marital status It lin arvay gencer srr
39. reate a new one To locate the new module under an existing menu we pick Yes and it will automatically display a list with the existing modules of level 1 If we pick No we will create a new level 1 menu then two new fields will appear to specify the name and the identifier Level 1 Parent Name Here we define the name of the parent module e d The first letter should be capital Level 1 Parent Id Here we define the identifier of the parent RH module All in lower case and with no spaces Level 2 Parent Exists This option will appear if we choose level 3 in the field Module level Similarly to what happens in Level 1 Parent Exists if we choose No then two more fields will appear Level 2 Parent Name Here we define the name of the level 2 parent ax module The first letter should be capitalized Level 2 Parent Id Here we define the identifier of the level 2 parent BEEN UO module All in lower case and with no spaces Module description This last section is the most interesting since it is where the actual content of the module is created Below we ll explain the three types of modules that can be created m Form Is used to gather data from the user The Build module counts with support for the most common types of HTML fields such as text selection date text area check box radio password hidden and file Grid t shows data organized in the form of a table where some use
40. ries shown in the grid The element msg will be the confirmation message that will appear the parameter task will be the element s name attribute the alt paramenter is the label that will be shown for the element and the parameter asLink is TRUE if the element will be a link otherwise it will be a submit type input function addLinkAction Shref action add Salt New Row Sicon null Sonclick null This function allows adding a link type element to the grid The parameter href is where the link goes the parameter Salt is the label that will be shown for the element the parameter Sicon is the path to an image that will be the elements representative icon and the parameter Sonclick is the element that will be linked when that link is clicked optional function addSubmitAction Stask add Salt New Row Sicon null onclick null This function allows adding a submit type element to the grid The parameter task is the element s name attribute the parameter Salt is the label that will be shown for the element the parameter Sicon is the path to an image that will be the element s representative icon and the parameter onclick is the event that will be linked to when clicking on that element optional m function addButtonAction name add Salt New Row Sicon null S onclick javascript click This function allows adding a button type element to the grid The parameter name is the element s name attr
41. s var www htm1 if we call this function outside of this path This function parses the file etc elastix conf and searches for the keyword cyrususerpwd in case it finds it it will return its value otherwise it will return palosanto which is the default password function obtenerClaveAMIAdmin ruta base This function returns the AMI password Asterisk Manager Interface for the admin user The parameter ruta base must be passed as var www htm1 if we call this function outside of this path This function searches for the password in the file etc elastix conf if the keyword amiadminpwd is found it returns its value otherwise it will return elastix456 which is the default AMI password in Elastix function generarDSNSistema sNombreUsuario SsNombreDB eruta base We have seen this function before in this manual now we will explain more about it As we said before this function returns the DSN Data Source Name for a connection with mysql The parameter ruta base must be passed as var www htm1 if we call this function outside of that path The parameter sNombreUsuario is the user we use to connect to mysql it can be root or asteriskuser The parameter sNombreDB is the name of the mysql database to which we will connect m function writeLOG SlogFILE log This function allows writing in a log The parameter SlogFILE is the name of the log file which will be located under var log
42. s function must receive as parameter a text that will be sent to the server The server must answer the text translated to the language selected on the Elastix server in case we have that translation otherwise it will return the same text In the client an alert with the text returned by the server must be shown File testModule themes default js Javascript js function getTextTranslate text var arrAction new Array arrAction mnmenu testModule acrAction action translate arrAction textc text arrAction rawmode yes request index php arrAction false function arrData statusResponse error the JSON response alert arrData Archivo testModule index php lt php inclols once libs palo5antoForm class php include once libs paloSantoJSON class php function moduleContent amp S smarty Smodule name Typical headers of the module like the last example my vaction getAction j Soontent Ww switehisaction i case save scontent saveTestModule smarty S module name local templates dir break case translate content translateText i break default view form Scontent viewFormTestModule Ssmarty Smodule name local templates dir break j return content Here goes the functions saveTestModule and viewFormTestModule like the last example ui function translateText jsonObject new PaloSantoJSON 5tex
43. s lower than 2 2 0 7 must be executed For the first script it would be 7 2 2 0 2 2 2 0 3 sql For the second script it would be 2 2 2 0 6 2 2 0 7 sql Note that it will always be Z astVersion lt newVersion also the execution order for the scripts goes hand in hand with the versions that is the higher the order number the higher the versions In an installation apart from executing the scripts from the install folder all the scripts in the update folder are executed The delete folder also contains folders with the same name as the database which will contain sql scripts for the uninstallation of the database with the names 1 dbname sql 2 dbname sql 3 dbname sqrl etc b The script in charge of reading and executing these files is elastix dbprocess that must be invoked in the spec file 4 2 Spec file Once the source is built it is a question of creating the spec file to finish with the RPM building or packaging process Below we show a small example from a spec file without going into more details since it is assumed that the developer has clear knowledge in regards to the building of RPM packages sdefine modname example Summary Elastix Module Example Name elastix modname Version 2 2 0 Release 1 License GPL Group Applications System pOUrCeys S Imognameg SIVEISIONJ oOIPD amp E ease tgZ BuildRoot tmppath name version root BuilgdArch noarch Prereq
44. s php This class allows us to easily manage grid type modules It is necessary to include it in our module in case we wish to use it The builder for this class has the following form function paloSantoGrid smarty Where smarty is an instance of smarty which is passed to the function _moduleContent of our module This class has the following functions function addNew Stask add Salt New Row SasLink false This function allows adding an element to the grid whose functionality is of adding a new piece of data to be shown in the grill The parameter Stask will be the name attribute for the element the parameter Salt is the label that will be shown for the element and the parameter SasLink is TRUE if the element will be the link otherwise it will be a submit type input n function customAction Stask task Salt Custom Action Simg SasLink false This function allows adding an element to the grid The parameter Stask will be the name attribute of the element the parameter Salt is the label that will be shown for the element and the parameter asLink is TRUE if the element is a link otherwise it will be a submit type input and the parameter Simg is the path to an image that will be the representative icon of the element function deleteList Smsg Stask remove Salt Delete Selected SasLink false This function allows adding an element to the grid whose functionality is to eliminate one or more ent
45. t getParameter text 9 Lranslarted Iristexr s 5 sonUbJ enLt osot message translated return jsonObject createJSON function getAction if getParameter Save return save elseif getParameter action translate return translate else return report 4 Convert a module into an addon It is common to get confused and to think that a module and an addon are the same thing In the end the two generally end up becoming a new menu in Elastix However an addon is something much more complex than a module An addon is a software package certified by PaloSanto Solutions and that is available in RPM format through the official repository An addon can contain a module but can also contain other software components written in any language supported by Elastix The installation of an addon is carried out simply and intuitively through the Addons menu from the Elastix Web Interface That said it is important to clear up that an Elastix module can be converted into an addon To do this it is necessary to package the module in RPM format and to start the interoperable software certification with Elastix 4 1 Source skeleton for packaging Usually the source will contain an XML file and two main folders The file and the folders are respectively menu xml modules and setup m The file menu xml is an XML that contains the modules that will be integrated into Elastix including locati
46. t to create the translation of our module to Spanish we need to create a file in this folder named es lang This file is basically a single array in which the key is the word to translate and the value is the translated key For example lt php global SarrLangModule SarrLangModule array Module gt Modulo This is a test module gt Este es un m dulo prueba 7 gt b libs As was mentioned previously this is our model layer In this folder there will be a library that will be in charge of making queries to databases modifying files etc b 9 Our apache service works using the user asterisk so we will only have access to files and folders to which asterisk has access You will not be able to read or write to a file or folder that has for example only root permissions console commands that require root privileges This can lead i brary becoming a potential security hole But what happens if our script or library must use commands that require root privileges That is when the script elastix helper comes into play 1 4 Use of elastix helper elastix helper is a script located in usr bin This script allows the execution of privileged scripts found in the following folder usr share elastix privileged Its here where we l find the script that will carry out tasks that require root privileges This script must be owned by root and belong to the root group
47. the user will only be allowed to enter a text that matches the regular expression that was entered filename Validates that what is entered into that field is the name of a file domain Validates that what is entered into that field is the name of a domain filepath Validates that what is entered into that field is a path to a file ip Validates that what is entered into that field is an IP address mask Validates that what is entered into that field is a network mask ip mask Validates that what is entered into that field is an IP address followed by and the network mask in decimal format numeric Validates that what is entered into that field is a number float Validates that what is entered into that field is a floating number decimal with a point as a separator numeric array Validates that what is entered into that field is an array whose elements are numbers ereg array Validates that what is entered into that field is an array with values that must match the regular expression passed in VALIDATION EXTRA_PARAM email Validates that what is entered into that field is an email address VALIDATION EXTRA PARAM An additional parameter is passed in case VALIDATION TYPE is required as is the case with ereg Below are described the functions that this class offers function fetchForm StemplateName title SarrPreFilledValues array This function generates a chain t
48. ths official Call Center module Bastix administrators will be able to easily create and modify agents outbound campaigns customizable forms dlents information handle inbound calls generate detailed reports and much more Location After the installation the Call Center tab will appear next to the Extras tab More info Call Center Suite 4 0 1centos5 BUY by DialApplet DialApplet DialApolet Call Center Suite is a complete solution to manage Call Centers and Contact Centers platform It permits advanced contro and supervision tools in real time of all calis and offers the opportunity of managing outbound inbound and blending campaigns Location After the installation DialApolet will be accessible by going to http your elastix ip accress cialapplet web Note DialApolet uses ports 5038 5432 and 23383 by Oefauit You may need to modiy your firewall nues in order for this addon to run properly Also you may need to update the elastix addons package before installing DislApplet s Call Center Suite as root user yum update elastix addons More info Channel Khomp beta 4 1 14 by Khomp The Channel Khomp along with its KWebPortsl provide a user friendly web interface for communication between Khomp devices K3L API and Asterisk using all the advanced features of signaling signal processing configuration and monitoring products provided by Khomp Khomp Addon provides all the software needed to work with Khomp EBS PCI anc
49. ust include this class in our module in case we want to use it The builder is the following m function PaloSantoJSON It has the following functions m function createJSON Codes the response in JSON with the format mentioned previously function set error Serror Sets the value of the error index with what is contained in the parameter Serror function set status 5status Sets the value of the index statusResponse with what is contained in the parameter status function set message Smessage oets the value for the index message with what is contained in the parameter message 3 AJAX in Elastix The Elastix Framework also counts with a JavaScript function to carry out AJAX petitions This function is the following function request url arrParams recursive callback The parameter url is the address to which the petition is made it will usually be index php The parameter arrParams is an array that contains the parameters that the server will receive The parameter recursive is a boolean this will be TRUE if we want the same AJAX petition to be carried out again once the server answers and if we want to stop it at any moment the function callback must return TRUE Finally the parameter callback is a function that will be invoked each time the server responds Example If you wish to create a JavaScript function that carries out an AJAX petition to the module testModule thi
50. want to insert the id of the entry we recently registered on id myTable1 of myTable1 and the actual date of the field date Note There cannot be another entry with the exact same values both in field 1 and field2 function insertRegister Svaluel Svalue2 amp SpDB amp SerrMsg i SpDB beginTransaction Squeryl INSERT INTO myTablel fieldi field2 VALUES SarrParaml array Svaluel Svalue2 Sresultl SpDB gt genQuery Squeryl SarrParaml1 if Sresultl FALSE SpDB 5 rollBack g4 SerrMsg SpDB gt errMsg return FALSE elsef equery2 INSERT INTO myTable2 id myTablel date VALUES SELECT id FROM myTablel WHERE fieldi AND field2 SarrParam2 array Svaluel Svalue2 date Y m d H i s Sresult2 SpDB gt genQuery Squery2 SarrParam2 if Sresult2 FALSE SDpDB rollBack SerrMsg SpDB gt errMsg return FALSE else SpDB commit return TRUE As we can observe the object 5pDB was passed by reference to the function which is necessary so that the transaction has the desired behavior NOTE Take into account that there are database engines that do not support transactions such as the MyISAM mySQL engine In these cases we must assure that the table we want to use has a compatible engine with transactions such as InnoDB or BDB 2 3 Class paloSantoACL class php This class is in charge of administrating access control lists for the different
Download Pdf Manuals
Related Search
Introduction introduction introduction letter introduction synonym introduction paragraph introduction to statistics introduction to ai introduction to python introduction definition introduction to computer introduction to psychology introduction to ammunition introduction paragraph examples introduction to information security introduction email template introduction to sociology introduction email introduction to algorithms introduction tarkov introduction to statistical learning introduction to generative ai introduction to machine learning introduction to algorithms pdf introduction to artificial intelligence introduction to quantum mechanics introduction to cybersecurity
Related Contents
LOREX Technology CVC6945 Security Camera User Manual Vision TC2-HDBT Canon PowerShot SD630 User's Manual Bose 301 Series Speaker System User Manual Sistema de frenos de disco Multiquip ST6125G User's Manual Manuel d`utilisation du chargeur bikerbest 取扱説明書 - 日立の家電品 Samsung 40" 1080p 3D LED HDTV Copyright © All rights reserved.
Failed to retrieve file