library/MGCP_Templates: Apply MGCP AddressType based on provided address
Change-Id: I1212abd31f6a4758105675908a1b7cb841caa3dd
This commit is contained in:
parent
cb4c59d131
commit
384e949cd2
|
@ -310,13 +310,13 @@ module MGCP_Templates {
|
||||||
integer rtp_port, SDP_fmt_list fmts,
|
integer rtp_port, SDP_fmt_list fmts,
|
||||||
SDP_attribute_list attributes) := {
|
SDP_attribute_list attributes) := {
|
||||||
protocol_version := 0,
|
protocol_version := 0,
|
||||||
origin := ts_SDP_origin(local_addr, session_id, session_version),
|
origin := ts_SDP_origin(local_addr, session_id, session_version, f_mgcp_addr2addrtype(local_addr)),
|
||||||
session_name := "-",
|
session_name := "-",
|
||||||
information := omit,
|
information := omit,
|
||||||
uri := omit,
|
uri := omit,
|
||||||
emails := omit,
|
emails := omit,
|
||||||
phone_numbers := omit,
|
phone_numbers := omit,
|
||||||
connection := ts_SDP_connection_IP(remote_addr),
|
connection := ts_SDP_connection_IP(remote_addr, f_mgcp_addr2addrtype(remote_addr)),
|
||||||
bandwidth := omit,
|
bandwidth := omit,
|
||||||
times := { ts_SDP_time("0","0") },
|
times := { ts_SDP_time("0","0") },
|
||||||
timezone_adjustments := omit,
|
timezone_adjustments := omit,
|
||||||
|
@ -341,6 +341,15 @@ module MGCP_Templates {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function f_mgcp_addr2addrtype(charstring addr) return charstring {
|
||||||
|
for (var integer i := 0; i < lengthof(addr); i := i + 1) {
|
||||||
|
if (addr[i] == ":") {
|
||||||
|
return "IP6";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "IP4";
|
||||||
|
}
|
||||||
|
|
||||||
/* -1 is wildcard, positive is translated as string */
|
/* -1 is wildcard, positive is translated as string */
|
||||||
function f_mgcp_osmux_cid_encode(MgcpOsmuxCID osmux_cid) return charstring {
|
function f_mgcp_osmux_cid_encode(MgcpOsmuxCID osmux_cid) return charstring {
|
||||||
if (osmux_cid == -1) {
|
if (osmux_cid == -1) {
|
||||||
|
|
Loading…
Reference in New Issue