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);
53 int release(struct join_relation *relation, int location, int cause);
55 char j_caller[32]; /* caller number */
56 char j_caller_id[32]; /* caller id to signal */
57 char j_dialed[1024]; /* dial string of (all) number(s) */
58 char j_todial[32]; /* overlap dialing (part not signalled yet) */
59 int j_multicause, j_multilocation;
61 int j_pid; /* pid of join to generate bridge id */
62 struct lcr_work j_updatebridge; /* bridge must be updated */
63 struct join_relation *j_relation; /* list of endpoints that are related to the join */
65 int j_partyline; /* if set, join is conference room */
66 int j_partyline_jingle; /* also play jingle on join/leave */
68 unsigned int j_3pty; /* other join if a 3pty-bridge is requested */
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, char *newkeypad);
74 void play_jingle(int in);
77 void joinpbx_debug(class JoinPBX *joinpbx, const char *function);
78 int joinpbx_countrelations(unsigned int join_id);
79 int track_notify(int oldstate, int notify);