Skip to content

Commit 9613c03

Browse files
committed
change error for converted to WAV because the codec [%s] is not supported
1 parent fc41765 commit 9613c03

File tree

2 files changed

+61
-1
lines changed

2 files changed

+61
-1
lines changed

calltable.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1699,7 +1699,7 @@ Call::convertRawToWav() {
16991699
system(cmd);
17001700
break;
17011701
default:
1702-
syslog(LOG_ERR, "Call [%s] cannot be converted to WAV, unknown payloadtype [%d]\n", rawf->filename.c_str(), rawf->codec);
1702+
syslog(LOG_ERR, "Call [%s] cannot be converted to WAV because the codec [%s] is not supported.\n", rawf->filename.c_str(), codec2text(rawf->codec));
17031703
}
17041704
if(!sverb.noaudiounlink) unlink(rawf->filename.c_str());
17051705
}

codecs.h

+60
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,66 @@
3737
#define PAYLOAD_XOPUS48 342
3838
#define PAYLOAD_TELEVENT 400
3939

40+
const char *codec2text(int codec) {
41+
switch(codec) {
42+
case PAYLOAD_PCMU:
43+
return "G.711 ulaw";
44+
case PAYLOAD_GSM:
45+
return "GSM";
46+
case PAYLOAD_G723:
47+
return "G.723";
48+
case PAYLOAD_PCMA:
49+
return "G.711 alaw";
50+
case PAYLOAD_G722:
51+
return "G.722";
52+
case PAYLOAD_G729:
53+
return "G.729";
54+
case PAYLOAD_ILBC:
55+
return "iLBC";
56+
case PAYLOAD_SPEEX:
57+
return "speex";
58+
case PAYLOAD_CLEARMODE:
59+
return "clearmode";
60+
case PAYLOAD_SILK:
61+
case PAYLOAD_SILK8:
62+
case PAYLOAD_SILK12:
63+
case PAYLOAD_SILK16:
64+
case PAYLOAD_SILK24:
65+
return "SILK";
66+
case PAYLOAD_ISAC:
67+
case PAYLOAD_ISAC16:
68+
case PAYLOAD_ISAC32:
69+
return "iSAC";
70+
case PAYLOAD_OPUS:
71+
case PAYLOAD_OPUS8:
72+
case PAYLOAD_OPUS12:
73+
case PAYLOAD_OPUS16:
74+
case PAYLOAD_OPUS24:
75+
case PAYLOAD_OPUS48:
76+
return "OPUS";
77+
case PAYLOAD_AMR:
78+
return "amr";
79+
case PAYLOAD_G72218:
80+
case PAYLOAD_G722112:
81+
case PAYLOAD_G722116:
82+
case PAYLOAD_G722124:
83+
case PAYLOAD_G722132:
84+
case PAYLOAD_G722148:
85+
return "G.722.1";
86+
case PAYLOAD_XOPUS:
87+
case PAYLOAD_XOPUS8:
88+
case PAYLOAD_XOPUS12:
89+
case PAYLOAD_XOPUS16:
90+
case PAYLOAD_XOPUS24:
91+
case PAYLOAD_XOPUS48:
92+
return "XOPUS";
93+
case PAYLOAD_TELEVENT:
94+
return "TELEPHONE EVENT";
95+
default:
96+
return "UNKNOWN CODEC NUMBER";
97+
}
98+
}
99+
40100
#define USE_ILBC_ENHANCER 0
41101
#define ILBC_MS 30
42102
/* #define ILBC_MS 20 */

0 commit comments

Comments
 (0)