4 extern int new_callref;
7 struct mncc_q_entry *next;
9 char data[0]; /* struct gsm_mncc */
18 struct interface *interface; /* interface this instance is associated to */
19 struct lcr_gsm *gsm_ms_next; /* list of MS instances, in case of MS */
20 char name[16]; /* name of MS instance, in case of MS */
21 int type; /* LCR_GSM_TYPE_*/
23 struct lcr_fd mncc_lfd; /* Unix domain socket to OpenBSC MNCC */
24 struct mncc_q_entry *mncc_q_hd;
25 struct mncc_q_entry *mncc_q_tail;
26 struct lcr_timer socket_retry; /* Timer to re-try connecting to BSC socket */
27 struct sockaddr_un sun; /* Socket address of MNCC socket */
31 class Pgsm : public Port
34 Pgsm(int type, char *portname, struct port_settings *settings, struct interface *interface);
37 char p_g_interface_name[64];
38 int p_g_tones; /* set, if tones are to be generated */
39 int p_g_earlyb; /* set, if patterns are available */
40 struct lcr_gsm *p_g_lcr_gsm; /* pointer to network/ms instance */
41 unsigned int p_g_callref; /* ref by OpenBSC/Osmocom-BB */
42 struct lcr_work p_g_delete; /* queue destruction of GSM port instance */
43 unsigned int p_g_mode; /* data/transparent mode */
44 int p_g_gsm_b_sock; /* gsm bchannel socket */
45 struct lcr_fd p_g_gsm_b_fd; /* event node */
46 int p_g_gsm_b_index; /* gsm bchannel socket index to use */
47 int p_g_gsm_b_active; /* gsm bchannel socket is activated */
48 struct lcr_msg *p_g_notify_pending; /* queue for NOTIFY if not connected */
49 struct lcr_msg *p_g_setup_pending; /* queue SETUP until RTP is created */
50 struct lcr_msg *p_g_connect_pending; /* queue CONNECT until RTP is created and connected */
51 void *p_g_encoder, *p_g_decoder; /* gsm handle */
52 signed short p_g_rxdata[160]; /* receive audio buffer */
53 int p_g_rxpos; /* position in audio buffer 0..159 */
54 int p_g_tch_connected; /* indicates if audio is connected */
56 int p_g_rtp_bridge; /* if we use a bridge */
57 unsigned int p_g_rtp_ip_remote; /* stores ip */
58 unsigned short p_g_rtp_port_remote; /* stores port */
60 void frame_send(void *_frame);
61 void frame_receive(void *_frame);
62 int bridge_rx(unsigned char *data, int len);
64 int hunt_bchannel(void);
65 void call_conf_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc *gsm);
66 void call_proc_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc *mncc);
67 void alert_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc *mncc);
68 void setup_cnf(unsigned int msg_type, unsigned int callref, struct gsm_mncc *mncc);
69 void setup_compl_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc *mncc);
70 void disc_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc *mncc);
71 void rel_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc *mncc);
72 void notify_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc *mncc);
73 void rtp_create_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc *mncc);
74 void rtp_connect_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc *mncc);
75 void message_notify(unsigned int epoint_id, int message_id, union parameter *param);
76 void message_progress(unsigned int epoint_id, int message_id, union parameter *param);
77 void message_alerting(unsigned int epoint_id, int message_id, union parameter *param);
78 void message_connect(unsigned int epoint_id, int message_id, union parameter *param);
79 void message_disconnect(unsigned int epoint_id, int message_id, union parameter *param);
80 void message_release(unsigned int epoint_id, int message_id, union parameter *param);
81 int message_epoint(unsigned int epoint_id, int message_id, union parameter *param);
84 struct gsm_mncc *create_mncc(int msg_type, unsigned int callref);
85 int send_and_free_mncc(struct lcr_gsm *lcr_gsm, unsigned int msg_type, void *data);
86 void gsm_trace_header(const char *interface_name, class Pgsm *port, unsigned int msg_type, int direction);
87 int gsm_conf(struct gsm_conf *gsm_conf, char *conf_error);
90 int mncc_socket_retry_cb(struct lcr_timer *timer, void *inst, int index);