rtpengine_manage() fails when called from failure_route[] with additional flags.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

rtpengine_manage() fails when called from failure_route[] with additional flags.

Vitalii Aleksandrov
Hi,

I use only rtpengine_manage() function of
rtpengine_{offer,answer,delete} and it is called from different
locations like request_route, onreply_route, failure_route.

To have everything in one place I call a route[RTPENGINE_MANAGE] which
in its turn prepares rtpengine parameters string (ICE, profiles, flags)
and calls rtpengine_manage(). When this route is called from
failure_route rtpengine_manage() is supposed to behave like
rtpengine_delete() and it does. The only problem is that when it
receives flags in its parameters string (no-rtcp-attribute in my case)
it fails with "rtpengine:parse_flags: error processing flag
`no-rtcp-attribute': no more memory" message instead of just ignoring
useless for delete operation parameters.

Attaching the patch that fixed this problem for me. Not sure if this is
a bug or lack of module documentation.




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

rtpengine_delete.diff (943 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rtpengine_manage() fails when called from failure_route[] with additional flags.

Răzvan Crainea-2
Hi, Vitalii!

It looks you are running out of memory. Make sure you have properly
adjusted opensips with enough private memory.

I don't think your patch is correct, since it does not parse flags for
delete commands, although someone might need them.

Best regards,
Razvan

On 2/13/19 3:09 PM, Vitalii Aleksandrov wrote:

> Hi,
>
> I use only rtpengine_manage() function of
> rtpengine_{offer,answer,delete} and it is called from different
> locations like request_route, onreply_route, failure_route.
>
> To have everything in one place I call a route[RTPENGINE_MANAGE] which
> in its turn prepares rtpengine parameters string (ICE, profiles, flags)
> and calls rtpengine_manage(). When this route is called from
> failure_route rtpengine_manage() is supposed to behave like
> rtpengine_delete() and it does. The only problem is that when it
> receives flags in its parameters string (no-rtcp-attribute in my case)
> it fails with "rtpengine:parse_flags: error processing flag
> `no-rtcp-attribute': no more memory" message instead of just ignoring
> useless for delete operation parameters.
>
> Attaching the patch that fixed this problem for me. Not sure if this is
> a bug or lack of module documentation.
>
>
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

--
Răzvan Crainea
OpenSIPS Core Developer
   http://www.opensips-solutions.com
Meet the OpenSIPS team at the next OpenSIPS Summit:
   https://www.opensips.org/events

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: rtpengine_manage() fails when called from failure_route[] with additional flags.

Vitalii Aleksandrov
Hi Razvan,

It's not a memory issue. If you check a few lines higher before my patch
you'll find this:
>         if (op == OP_OFFER || op == OP_ANSWER) {
>                 ng_flags.flags = bencode_list(bencbuf);
>                 .......
>         }

ng_flags.flags bencode list is created only for OP_OFFER and OP_ANSWER
and stays NULL for OP_DELETE operation. That's the reason why flags
parsing fails for delete.



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: rtpengine_manage() fails when called from failure_route[] with additional flags.

Vitalii Aleksandrov
In reply to this post by Răzvan Crainea-2
Agree that flags for OP_DELETE are important.
This patch fixes flags for me and OP_DELETE removes proper branch
instead of the whole call:

diff --git a/modules/rtpengine/rtpengine.c b/modules/rtpengine/rtpengine.c
index 2d1a1d3..6eba189 100644
--- a/modules/rtpengine/rtpengine.c
+++ b/modules/rtpengine/rtpengine.c
@@ -1760,6 +1760,8 @@ static bencode_item_t
*rtpe_function_call(bencode_buffer_t *bencbuf, struct sip_
                         goto error;
                 }
                 bencode_dictionary_add_str(ng_flags.dict, "sdp", &body);
+       } else if (op == OP_DELETE) {
+               ng_flags.flags = bencode_list(bencbuf);
         }


> Hi, Vitalii!
>
> It looks you are running out of memory. Make sure you have properly
> adjusted opensips with enough private memory.
>
> I don't think your patch is correct, since it does not parse flags for
> delete commands, although someone might need them.
>
> Best regards,
> Razvan
>
> On 2/13/19 3:09 PM, Vitalii Aleksandrov wrote:
>> Hi,
>>
>> I use only rtpengine_manage() function of
>> rtpengine_{offer,answer,delete} and it is called from different
>> locations like request_route, onreply_route, failure_route.
>>
>> To have everything in one place I call a route[RTPENGINE_MANAGE]
>> which in its turn prepares rtpengine parameters string (ICE,
>> profiles, flags) and calls rtpengine_manage(). When this route is
>> called from failure_route rtpengine_manage() is supposed to behave
>> like rtpengine_delete() and it does. The only problem is that when it
>> receives flags in its parameters string (no-rtcp-attribute in my
>> case) it fails with "rtpengine:parse_flags: error processing flag
>> `no-rtcp-attribute': no more memory" message instead of just ignoring
>> useless for delete operation parameters.
>>
>> Attaching the patch that fixed this problem for me. Not sure if this
>> is a bug or lack of module documentation.
>>
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users