1 /*****************************************************************************\
3 ** Linux Call Router **
5 **---------------------------------------------------------------------------**
6 ** Copyright: Andreas Eversberg **
8 ** join header file for pbx joins **
10 \*****************************************************************************/
15 * joins connect interfaces together
16 * joins are linked in a chain
17 * interfaces can have 0, 1 or more references to a join
18 * the join can have many references to interfaces
19 * joins receive and send messages
22 #define RECORD_BUFFER_SIZE 16000
24 enum { /* relation types */
25 RELATION_TYPE_CALLING, /* initiator of a join */
26 RELATION_TYPE_SETUP, /* interface which is to be set up */
27 RELATION_TYPE_CONNECT, /* interface is connected */
30 enum { /* states that results from last notification */
31 NOTIFY_STATE_ACTIVE, /* just the normal case, the party is active */
32 NOTIFY_STATE_SUSPEND, /* the party is inactive, because she has parked */
33 NOTIFY_STATE_HOLD, /* the party is inactive, because she holds the line */
34 NOTIFY_STATE_CONFERENCE, /* the parties joined a conference */
38 struct join_relation { /* relation to an interface */
39 struct join_relation *next; /* next node */
40 int type; /* type of relation */
41 unsigned int epoint_id; /* interface to link join to */
42 int channel_state; /* if audio is available */
43 int rx_state; /* current state of what we received from endpoint */
44 int tx_state; /* current state of what we sent to endpoint */
47 class JoinPBX : public Join
50 JoinPBX(class Endpoint *epoint);
52 void message_epoint(unsigned int epoint_id, int message, union parameter *param);
54 int release(struct join_relation *relation, int location, int cause);
56 char j_caller[32]; /* caller number */
57 char j_caller_id[32]; /* caller id to signal */
58 char j_dialed[1024]; /* dial string of (all) number(s) */
59 char j_todial[32]; /* overlap dialing (part not signalled yet) */
60 int j_multicause, j_multilocation;
62 int j_pid; /* pid of join to generate bridge id */
63 int j_updatebridge; /* bridge must be updated */
64 struct join_relation *j_relation; /* list of endpoints that are related to the join */
66 int j_partyline; /* if set, join is conference room */
67 int j_partyline_jingle; /* also play jingle on join/leave */
70 void bridge_data(unsigned int epoint_from, struct join_relation *relation_from, union parameter *param);
71 void remove_relation(struct join_relation *relation);
72 struct join_relation *add_relation(void);
73 int out_setup(unsigned int epoint_id, int message, union parameter *param, char *newnumber);
74 void play_jingle(int in);
77 void joinpbx_debug(class JoinPBX *joinpbx, char *function);
78 int joinpbx_countrelations(unsigned int join_id);
79 int track_notify(int oldstate, int notify);