[SR-Users] KEMI get_body_part

Daniel-Constantin Mierla miconda at gmail.com
Mon Apr 2 08:28:43 CEST 2018


Hello,


On 30.03.18 14:44, Igor Olhovskiy wrote:
> Hi!
>
> I’m trying to get SDP body in my var.
>
> I’m using smth like this
>
>     if (KSR.textops.has_body() ~= -1 and
> KSR.textops.has_body_type("application/sdp") ~= -1) then
>         KSR.textops.get_body_part("application/sdp", "$var(pbody)»)
>   local sdp_body = KSR.pv.get("$var(pbody)")
>   ….
>     end
>
> But in logs i see this
> LUA {INVITE}:  7(20794) DEBUG: <core> [core/parser/msg_parser.c:183]:
> get_hdr_field(): content_length=470
> 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
> LUA {INVITE}:  7(20794) DEBUG: textops [textops.c:3083]:
> has_body_helper(): content type is 196611
> 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
> 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)
> LUA {INVITE}:  7(20794) DEBUG: <core> [core/pvapi.c:396]:
> pv_cache_lookup(): pvar [$var(pbody)] found in cache
> LUA {INVITE}:  7(20794) DEBUG: <core> [core/parser/msg_parser.c:89]:
> get_hdr_field(): found end of header
> LUA {INVITE}:  7(20794) INFO: <core> [core/msg_translator.c:1694]:
> get_boundary(): Content-Type hdr has no params <application/sdp>
> LUA {INVITE}:  7(20794) ERROR: textops [textops.c:2468]:
> ki_get_body_part_helper(): Cannot get boundary. Is body multipart?
Was there a multi-part body? If not, get the body with $rb variable.

Cheers,
Daniel

>
> So, in sdp_body var i got 0. What is wrong here?
>

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - April 16-18, 2018, Berlin - www.asipto.com
Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20180402/115a7d36/attachment.html>


More information about the sr-users mailing list