MGCP_Templates: Some more convenience extraction functions
Change-Id: I2fc121b1d90327c879a096773ecc5c04faad07d7
This commit is contained in:
parent
5cfa867ba1
commit
1fe7481174
|
@ -273,20 +273,33 @@ module MGCP_Templates {
|
|||
return "";
|
||||
}
|
||||
|
||||
function f_MgcpResp_extract_conn_id(MgcpResponse resp) return MgcpConnectionId {
|
||||
function f_MgcpResp_extract_par(MgcpResponse resp, MgcpInfoCode code) return charstring {
|
||||
var MgcpMessage msg := {
|
||||
response := resp
|
||||
}
|
||||
return str2hex(f_mgcp_extract_par(msg, "I"));
|
||||
return f_mgcp_extract_par(msg, code);
|
||||
}
|
||||
|
||||
function f_MgcpCmd_extract_call_id(MgcpCommand cmd) return MgcpCallId {
|
||||
function f_MgcpCmd_extract_par(MgcpCommand cmd, MgcpInfoCode code) return charstring {
|
||||
var MgcpMessage msg := {
|
||||
command := cmd
|
||||
}
|
||||
return str2hex(f_mgcp_extract_par(msg, "C"));
|
||||
return f_mgcp_extract_par(msg, code);
|
||||
}
|
||||
|
||||
function f_MgcpResp_extract_conn_id(MgcpResponse resp) return MgcpConnectionId {
|
||||
return str2hex(f_MgcpResp_extract_par(resp, "I"));
|
||||
}
|
||||
|
||||
function f_MgcpCmd_extract_call_id(MgcpCommand cmd) return MgcpCallId {
|
||||
return str2hex(f_MgcpCmd_extract_par(cmd, "C"));
|
||||
}
|
||||
|
||||
function f_MgcpCmd_extract_conn_id(MgcpCommand cmd) return MgcpConnectionId {
|
||||
return str2hex(f_MgcpCmd_extract_par(cmd, "I"));
|
||||
}
|
||||
|
||||
|
||||
function f_mgcp_alloc_tid() return MgcpTransId {
|
||||
return int2str(float2int(rnd()*2147483647.0));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue