Closed Woersty closed 7 years ago
Please check pull request #50. It solved the problem for me.
Thank you for this hint. Will try today and give feedback later. Haven't seen it but honestly I have not searched deeply.
BR Christian
Wie ist die Syntax denn von -m ?
add a pattern for the codecs you want to use, e.g. -m "G.711*", wildcards are supported. All other codecs will be removed before making an INVITE connection
Ok, clear now. Thanks. Works. Geil 👍
Ähm, wie gebe ich mehrere Codecs an? (How to enter more than one valid codec?)
-m "G.711* G.722*"
is not valid.
More than one codec is not supported when not defined by a wildcard, because I did not think about it.
I will try to make a better/extended solution in the next week.
For your example you can use -m "G.7*"
You saved my day anyway!
@Woersty: Can you please replace Manager::AdjustMediaFormats in main.cpp by the following code:
void Manager::AdjustMediaFormats( bool local, const OpalConnection & connection, OpalMediaFormatList & mediaFormats ) const { PStringArray mask; std::string s; istringstream ss(mediaFilter); while (getline(ss, s, ';')) { mask.AppendString("!"+s); } mediaFormats.Remove(mask); }
Multiple codecs can now be defined separated by semicolon (e.g. -m "G.711*;G.722*"
)
If you can confirm that it is working, I will create a new pull request
I works partially. My problem is, that the name for the G.722 codes seems to be different from G.722 Where can I get a list of possible codecs names?
Hello, I'm facing the same issue, from the opal libray log I've found this list: 0:00.266 sipcmd SIP Remote media formats set: G.722-64k,G.722.1-24k,G.722.1-32k,G.722.2,SILK-16,SpeexIETFWide-20.6k,SpeexWB,SpeexWide-20.6k,G.711-ALaw-64k,G.711-uLaw-64k,G.726-16k,G.726-24k,G.726-32k,G.726-40k,GSM-06.10,GSM-AMR,LPC-10,MS-GSM,MS-IMA-ADPCM,SILK-8,SpeexIETFNarrow-11k,SpeexIETFNarrow-15k,SpeexIETFNarrow-18.2k,SpeexIETFNarrow-24.6k,SpeexIETFNarrow-5.95k,SpeexIETFNarrow-8k,SpeexNB,SpeexWNarrow-8k,T.38,iLBC,iLBC-13k3,iLBC-15k2,UserInput/RFC2833,NamedSignalEvent,H.261,H.263,H.263plus,H.264,H.264-0,H.264-1,MPEG4,RFC4175_YCbCr-4:2:0,theora,MSRP,SIP-IM,T.140,H.224/H323AnnexQ
if you use the -o "path-to-logfile"
option without using the -m option, you will get a large debug output. make a grep 722
and you will get all available codec names for G.722 (4 in my FB7490)
Other possibility is to output all available codecs when using -m option (or a different new option)
EDIT:
Get a list of available and used Codecs when using -m option.
Replace Manager::AdjustMediaFormats in main.cpp with:
`
void Manager::AdjustMediaFormats(
bool local, ///< Media formats a local ones to be presented to remote
const OpalConnection & connection, ///< Connection that is about to use formats
OpalMediaFormatList & mediaFormats ///< Media formats to use
) const
{
std::cout << "available codecs:" << std::endl;
for (OpalMediaFormatList::iterator it1 = mediaFormats.begin(); it1!=mediaFormats.end(); it1++)
{
std::cout << " " << it1->GetName() << std::endl;
}
PStringArray mask;
std::string s;
istringstream ss(mediaFilter);
while (getline(ss, s, ';'))
{
mask.AppendString("!"+s);
}
mediaFormats.Remove(mask);
std::cout << "used codecs:" << std::endl;
for (OpalMediaFormatList::iterator it2 = mediaFormats.begin(); it2!=mediaFormats.end(); it2++)
{
std::cout << " " << it2->GetName() << std::endl;
}
}`
Works. My fault. Sorry. **m=G.722*** = G.722-64k,G.722.1-24k,G.722.1-32k,G.722.2
v=0
o=- 1487530317 1 IN IP4 169.254.80.70
s=text2sip/1.0.1
c=IN IP4 169.254.80.70
t=0 0
m=audio 5000 RTP/AVP 9 117 118 120
a=sendrecv
a=rtpmap:9 G722/8000/1
a=rtpmap:117 G7221/16000/1
a=fmtp:117 bitrate=24000
a=rtpmap:118 G7221/16000/1
a=fmtp:118 bitrate=32000
a=rtpmap:120 AMR-WB/16000/1
a=fmtp:120 octet-align=1
a=maxptime:20
*m=G.711;G.722** = G.711-ALaw-64k,G.711-uLaw-64k,G.722-64k,G.722.1-24k,G.722.1-32k,G.722.2
v=0
o=- 1487530630 1 IN IP4 169.254.80.70
s=text2sip/1.0.1
c=IN IP4 169.254.80.70
t=0 0
m=audio 5000 RTP/AVP 8 0 9 117 118 120
a=sendrecv
a=rtpmap:8 PCMA/8000/1
a=rtpmap:0 PCMU/8000/1
a=rtpmap:9 G722/8000/1
a=rtpmap:117 G7221/16000/1
a=fmtp:117 bitrate=24000
a=rtpmap:118 G7221/16000/1
a=fmtp:118 bitrate=32000
a=rtpmap:120 AMR-WB/16000/1
a=fmtp:120 octet-align=1
a=maxptime:20
**m=G.711*** = G.711-ALaw-64k,G.711-uLaw-64k
v=0
o=- 1487530759 1 IN IP4 169.254.80.70
s=text2sip/1.0.1
c=IN IP4 169.254.80.70
t=0 0
m=audio 5000 RTP/AVP 8 0
a=sendrecv
a=rtpmap:8 PCMA/8000/1
a=rtpmap:0 PCMU/8000/1
a=maxptime:240
You can merge it. Many thanks!
Just a comment: G.722 doesn't work with my FB7490 and Gigaset SL400 👎 So I will stay at G.711 only - but good that the option has multicodec support now. 🥇
Hi, do you see a way to disable all codecs except the codecs I want to use?
For me it is okay to use PCM16 and G.711a-law. I would prefer an option to set sipcmd to use just these but I'm lost in C++
The Invite is quite huge due to the very long list:
BR Christian