+/* 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) {
+ PDEBUG(DEBUG_GSM, "Got RTP peer info (%08x,%d) connecting RTP... \n", rtp->ip, rtp->port);
+ send_mncc_rtp_connect();
+ }
+}
+
+/* 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) {
+ PDEBUG(DEBUG_GSM, "PROGRESS with RTP peer info, sent to BSC (%08x,%d) with media %d, pt %d\n", param->progressinfo.rtpinfo.ip, param->progressinfo.rtpinfo.port, param->progressinfo.rtpinfo.media_types[0], param->progressinfo.rtpinfo.payload_types[0]);
+
+ /* modify channel to givne type, also sets media type */
+ modify_lchan(param->progressinfo.rtpinfo.media_types[0]);
+
+ /* connect RTP */
+ p_g_rtp_ip_remote = param->progressinfo.rtpinfo.ip;
+ p_g_rtp_port_remote = param->progressinfo.rtpinfo.port;
+ /* p_g_media_type is already set by modify_lchan() */
+ p_g_payload_type = param->progressinfo.rtpinfo.payload_types[0];
+ send_mncc_rtp_connect();
+ }
+}
+