Build intersection of two comma separated lists?
Benoit Panizzon via sr-users <[email protected]>
| Newsgroups | gmane.comp.voip.ser |
|---|---|
| Organization | ImproWare AG |
| Message-ID | <[email protected]> |
Hi Team
I would like to remove some codec for some connections between
endpoints with SDOPS funktion sdp_keep_codecs_by_name()
Is there anything like an intersection function? Is there an easy way
to build such a function with existing functionality?
example:
$var(src_codecs) = "PCMA,G722,telephony-event";
$var(dst_codecs) = "PCMA,G729,AMR-WB,telephony-event";
$dlg_var(codec_filter) = intersection($var(src_codecs),$var(dst_codecs));
$dlg_var(codec_filter) should become the intersection of both lists:
=> "PCMA,telephony-event"
In Requests and manage_reply I then could use to make sure only codecs
supported by both endpoints are allowed through.
if (sdp_content()) {
sdp_keep_codecs_by_name($dlg_var(codec_filter),"audio");
}
For those who are questioning, why I try to do this:
We have a mobile operator on one end and it generates a HUGE SDP with
all codecs supported by the mobile devices. This sometimes leads to
fragmented UDP packets either getting truncated or not getting through
some customer firewall at all.
Mit freundlichen Grüssen
-Benoît Panizzon-
--
I m p r o W a r e A G - Leiter Commerce Kunden
______________________________________________________
Zurlindenstrasse 29 Tel +41 61 826 93 00
CH-4133 Pratteln Fax +41 61 826 93 01
Schweiz Web http://www.imp.ch
______________________________________________________
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the sender!