ATech Machine LIBRA-02 M Informacje Techniczne Strona 400

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 734
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 399
; *** This line should have no line breaks
readsql=SELECT COUNT(status) FROM ast_hotdesk WHERE status = '1' AND
location = '${ARG1}'
If there are no other agents logged into the device, we update the login status for this
user with the HOTDESK_STATUS() function:
; Continuation of the valid_login extension below
same => n,Set(USERS_LOGGED_IN=${HOTDESK_CHECK_PHONE_
LOGINS(${LOCATION})})
same => n,GotoIf($[${USERS_LOGGED_IN} > 0]?logout_login,1)
same => n(set_login_status),NoOp()
; Set the status for the phone to '1' and where the agent is logged into
same => n,Set(HOTDESK_STATUS(${E})=1,${LOCATION})
same => n,GotoIf($[${ODBCROWS} < 1]?error,1)
same => n,Playback(agent-loginok)
same => n,Hangup()
We create a write function in func_odbc.conf like so:
[STATUS]
prefix=HOTDESK
dsn=asterisk
; *** This line should have no line breaks
writesql=UPDATE ast_hotdesk SET status = '${VAL1}',
location = '${VAL2}' WHERE extension = '${ARG1}'
The syntax is very similar to the readsql syntax discussed earlier in the chapter, but
there are a few new things here, so let’s discuss them before moving on.
The first thing you may have noticed is that we now have both ${VALx} and ${ARGx}
variables in our SQL statement. These contain the values we pass to the function from
the dialplan. In this case, we have two VAL variables and a single ARG variable that were
set from the dialplan via this statement:
Set(HOTDESK_STATUS(${E})=1,${LOCATION})
Notice the syntax is slightly different from that of the read-style function. This signals
to Asterisk that you want to perform a write (this is the same syntax as that used for
other dialplan functions).
We are passing the value of the ${E} variable to the HOTDESK_STATUS() function, whose
value is then accessible in the SQL statement within func_odbc.conf with the ${ARG1}
variable. We then pass two values: 1 and ${LOCATION}. These are available to the SQL
statement in the ${VAL1} and ${VAL2} variables, respectively.
As mentioned previously, if we had to log out one or more agents before logging this
one in, we would check this with the logout_login extension. This dialplan logic will
utilize the ODBC_FETCH() function to pop information off the information stack returned
by the HOTDESK_LOGGED_IN_USER() function. More than likely this will execute only one
364 | Chapter 16: Relational Database Integration
Przeglądanie stron 399
1 2 ... 395 396 397 398 399 400 401 402 403 404 405 ... 733 734

Komentarze do niniejszej Instrukcji

Brak uwag

Iei-integration MPCIE-USB3 manuels

Manuels d'utilisation et guides de l'utilisateur pour Matériel Iei-integration MPCIE-USB3.
Nous fournissons des manuels en pdf 1 Iei-integration MPCIE-USB3 à télécharger gratuitement par type de document : Manuel de l'utilisateur






Plus de produits et de manuels pour Matériel Iei-integration

Modèles Type de document
MPCIE-3G Manuel de l'utilisateur   IEI Integration MPCIE-3G User Manual [en] , 14 pages
WAFER-CV-D25502_N26002 Manuel de l'utilisateur   IEI Integration WAFER-CV-D25502_N26002 User Manual [en] , 182 pages
IDD-936160 Manuel de l'utilisateur   IEI Integration IDD-936160 User Manual, 1 pages
IDD-936260A Manuel de l'utilisateur   IEI Integration IDD-936260A User Manual, 1 pages
IDD-9364120A Manuel de l'utilisateur   IEI Integration IDD-9364120A User Manual, 1 pages
IDDV-6304140A Manuel de l'utilisateur   IEI Integration IDDV-6304140A User Manual, 5 pages
IDD-930160-KIT v1.00 Manuel de l'utilisateur   IEI Integration IDD-930160-KIT v1.00 User Manual, 1 pages
IDD-241100 Manuel de l'utilisateur   IEI Integration IDD-241100 User Manual, 3 pages
PM-P006UPS Manuel de l'utilisateur   IEI Integration PM-P006UPS User Manual, 50 pages
IDDUPS-636260А Manuel de l'utilisateur   IEI Integration IDDUPS-636260А User Manual, 52 pages