<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello,<br>
</p>
<br>
<div class="moz-cite-prefix">On 30.03.18 14:44, Igor Olhovskiy
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:0daf2c9c-1e6a-4777-8b7f-9182e543bed2@Spark">
<title></title>
<div name="messageBodySection" style="font-size: 14px;
font-family: -apple-system, BlinkMacSystemFont, sans-serif;">Hi!
<div><br>
</div>
<div>I’m trying to get SDP body in my var.</div>
<div><br>
</div>
<div>I’m using smth like this</div>
<div><br>
</div>
<div>
<div> if (KSR.textops.has_body() ~= -1 and
KSR.textops.has_body_type("application/sdp") ~= -1) then</div>
<div> KSR.textops.get_body_part("application/sdp",
"$var(pbody)»)</div>
</div>
<div> local sdp_body = KSR.pv.get("$var(pbody)")<br>
</div>
<div> ….<br>
</div>
<div> end</div>
<div><br>
</div>
<div>But in logs i see this</div>
<div>
<div>LUA {INVITE}: 7(20794) DEBUG: <core>
[core/parser/msg_parser.c:183]: get_hdr_field():
content_length=470</div>
<div>LUA {INVITE}: 7(20794) DEBUG: app_lua
[app_lua_sr.c:1496]: sr_kemi_lua_exec_func_ex(): param[0]
for: has_body_type is str: application/sdp</div>
<div>LUA {INVITE}: 7(20794) DEBUG: textops [textops.c:3083]:
has_body_helper(): content type is 196611</div>
<div>LUA {INVITE}: 7(20794) DEBUG: app_lua
[app_lua_sr.c:1496]: sr_kemi_lua_exec_func_ex(): param[0]
for: get_body_part is str: application/sdp</div>
<div>LUA {INVITE}: 7(20794) DEBUG: app_lua
[app_lua_sr.c:1496]: sr_kemi_lua_exec_func_ex(): param[1]
for: get_body_part is str: $var(pbody)</div>
<div>LUA {INVITE}: 7(20794) DEBUG: <core>
[core/pvapi.c:396]: pv_cache_lookup(): pvar [$var(pbody)]
found in cache</div>
<div>LUA {INVITE}: 7(20794) DEBUG: <core>
[core/parser/msg_parser.c:89]: get_hdr_field(): found end of
header</div>
<div>LUA {INVITE}: 7(20794) INFO: <core>
[core/msg_translator.c:1694]: get_boundary(): Content-Type
hdr has no params <application/sdp></div>
<div>LUA {INVITE}: 7(20794) ERROR: textops [textops.c:2468]:
ki_get_body_part_helper(): Cannot get boundary. Is body
multipart?</div>
</div>
</div>
</blockquote>
Was there a multi-part body? If not, get the body with $rb variable.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<blockquote type="cite"
cite="mid:0daf2c9c-1e6a-4777-8b7f-9182e543bed2@Spark">
<div name="messageBodySection" style="font-size: 14px;
font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
<div>
</div>
<div><br>
</div>
<div>So, in sdp_body var i got 0. What is wrong here?</div>
</div>
<div name="messageSignatureSection" style="font-size: 14px;
font-family: -apple-system, BlinkMacSystemFont, sans-serif;"><br>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - April 16-18, 2018, Berlin - <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
</body>
</html>