+/* RTP create indication */
+void Pgsm::rtp_create_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc *mncc)
+{
+ struct gsm_mncc_rtp *rtp = (struct gsm_mncc_rtp *) mncc;
+
+ /* send queued setup, as we received remote RTP info */
+ if (p_g_setup_pending) {
+ struct lcr_msg *message;
+
+ message = p_g_setup_pending;
+ PDEBUG(DEBUG_GSM, "Got RTP peer info (%08x,%d) forwarding setup\n", rtp->ip, rtp->port);
+ message->param.setup.rtpinfo.ip = rtp->ip;
+ message->param.setup.rtpinfo.port = rtp->port;
+ message_put(message);
+ p_g_setup_pending = NULL;
+ }
+ if (p_g_connect_pending) {
+ struct gsm_mncc_rtp *nrtp;
+
+ PDEBUG(DEBUG_GSM, "Got RTP peer info (%08x,%d) connecting RTP... \n", rtp->ip, rtp->port);
+ nrtp = (struct gsm_mncc_rtp *) create_mncc(MNCC_RTP_CONNECT, p_g_callref);
+ nrtp->ip = p_g_rtp_ip_remote;
+ nrtp->port = p_g_rtp_port_remote;
+ send_and_free_mncc(p_g_lcr_gsm, nrtp->msg_type, nrtp);
+ }
+}
+
+/* RTP connect indication */
+void Pgsm::rtp_connect_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc *mncc)
+{
+ struct lcr_msg *message;
+ struct gsm_mncc_rtp *rtp = (struct gsm_mncc_rtp *) mncc;
+
+ if (p_g_connect_pending) {
+ message = p_g_connect_pending;
+ PDEBUG(DEBUG_GSM, "Got RTP peer info (%08x,%d) forwarding connect\n", rtp->ip, rtp->port);
+ message->param.connectinfo.rtpinfo.ip = rtp->ip;
+ message->param.connectinfo.rtpinfo.port = rtp->port;
+ message_put(message);
+ p_g_connect_pending = NULL;
+ }
+}
+
+/* MESSAGE_PROGRESS */
+void Pgsm::message_progress(unsigned int epoint_id, int message_id, union parameter *param)
+{
+ if (param->progressinfo.progress == 8) {
+ PDEBUG(DEBUG_GSM, "Remote provides tones for us\n");
+ p_g_tones = 1;
+ }
+
+ if (param->progressinfo.rtpinfo.port) {
+ struct gsm_mncc_rtp *rtp;
+
+ PDEBUG(DEBUG_GSM, "CONNECT with RTP peer info, sent to BSC (%08x,%d)\n", param->progressinfo.rtpinfo.ip, param->progressinfo.rtpinfo.port);
+ rtp = (struct gsm_mncc_rtp *) create_mncc(MNCC_RTP_CONNECT, p_g_callref);
+ rtp->ip = param->progressinfo.rtpinfo.ip;
+ rtp->port = param->progressinfo.rtpinfo.port;
+ send_and_free_mncc(p_g_lcr_gsm, rtp->msg_type, rtp);
+ }
+}
+