Asterisk - The Open Source Telephony Project  21.4.1
Data Structures | Functions
parking_devicestate.c File Reference

Call Parking Device State Management. More...

#include "asterisk.h"
#include "asterisk/logger.h"
#include "res_parking.h"
#include "asterisk/devicestate.h"

Go to the source code of this file.

Data Structures

struct  parking_lot_extension_inuse_search
 

Functions

int load_parking_devstate (void)
 Register Parking devstate handler. More...
 
static enum ast_device_state metermaidstate (const char *data)
 
static int parking_lot_search_context_extension_inuse (void *obj, void *arg, int flags)
 
void parking_notify_metermaids (int exten, const char *context, enum ast_device_state state)
 Notify metermaids that we've changed an extension. More...
 
static int retrieve_parked_user_targeted (void *obj, void *arg, int flags)
 
void unload_parking_devstate (void)
 Unregister Parking devstate handler. More...
 

Detailed Description

Call Parking Device State Management.

Author
Jonathan Rose jrose.nosp@m.@dig.nosp@m.ium.c.nosp@m.om

Definition in file parking_devicestate.c.

Function Documentation

int load_parking_devstate ( void  )

Register Parking devstate handler.

Since
12.0.0

Definition at line 121 of file parking_devicestate.c.

References ast_devstate_prov_add().

122 {
123  return ast_devstate_prov_add("Park", metermaidstate);
124 }
int ast_devstate_prov_add(const char *label, ast_devstate_prov_cb_type callback)
Add device state provider.
Definition: devicestate.c:391
void parking_notify_metermaids ( int  exten,
const char *  context,
enum ast_device_state  state 
)

Notify metermaids that we've changed an extension.

Since
12.0.0
Parameters
extenExtension of the call parked/unparked
contextContext of the call parked/unparked
statenew device state

Definition at line 108 of file parking_devicestate.c.

References ast_debug, ast_devstate2str(), AST_DEVSTATE_CACHABLE, and ast_devstate_changed().

109 {
110  ast_debug(4, "Notification of state change to metermaids %d@%s\n to state '%s'\n",
111  exten, context, ast_devstate2str(state));
112 
113  ast_devstate_changed(state, AST_DEVSTATE_CACHABLE, "park:%d@%s", exten, context);
114 }
const char * ast_devstate2str(enum ast_device_state devstate) attribute_pure
Convert device state to text string for output.
Definition: devicestate.c:237
int ast_devstate_changed(enum ast_device_state state, enum ast_devstate_cache cachable, const char *fmt,...)
Tells Asterisk the State for Device is changed.
Definition: devicestate.c:510
#define ast_debug(level,...)
Log a DEBUG message.
void unload_parking_devstate ( void  )

Unregister Parking devstate handler.

Since
12.0.0

Definition at line 116 of file parking_devicestate.c.

References ast_devstate_prov_del().

117 {
118  ast_devstate_prov_del("Park");
119 }
int ast_devstate_prov_del(const char *label)
Remove device state provider.
Definition: devicestate.c:418