Use dynamic RTP payload types starting from 96
authorAndreas Eversberg <jolly@eversberg.eu>
Sat, 18 Feb 2012 08:49:57 +0000 (09:49 +0100)
committerAndreas Eversberg <jolly@eversberg.eu>
Sat, 18 Feb 2012 08:49:57 +0000 (09:49 +0100)
gsm_bs.cpp

index 92a2ffc..9ce9321 100644 (file)
@@ -296,6 +296,7 @@ void Pgsm_bs::select_payload_type(struct gsm_mncc *mncc, unsigned char *payload_
        if ((mncc->fields & MNCC_F_BEARER_CAP)) {
                /* select preferred payload type from list */
                int i;
+               uint8_t dynamic_type = 96;
 
                add_trace("bearer", "capa", "given by MS");
                for (i = 0; mncc->bearer_cap.speech_ver[i] >= 0; i++) {
@@ -309,17 +310,17 @@ void Pgsm_bs::select_payload_type(struct gsm_mncc *mncc, unsigned char *payload_
                        case 2:
                                add_trace("speech", "version", "EFR given");
                                media_type = MEDIA_TYPE_GSM_EFR;
-                               payload_type = 100 + *payloads;
+                               payload_type = dynamic_type++;
                                break;
                        case 4:
                                add_trace("speech", "version", "AMR given");
                                media_type = MEDIA_TYPE_AMR;
-                               payload_type = 100 + *payloads;
+                               payload_type = dynamic_type++;
                                break;
                        case 1:
                                add_trace("speech", "version", "Half Rate given");
                                media_type = MEDIA_TYPE_GSM_HR;
-                               payload_type = 100 + *payloads;
+                               payload_type = dynamic_type++;
                                break;
                        default:
                                add_trace("speech", "version", "%d given", mncc->bearer_cap.speech_ver[i]);