[OpenSIPS-Users] Confused about rtpproxy_offer() w/s Flags

2019-02-13 Thread Mark Farmer
I'm struggling to understand the w & s flags to rtpproxy_offer etc.

The documentation is a little unclear, is there any difference between the
two? I seem to have had better results using w but I don't understand why
that might be.

TIA
Mark.

-- 
Mark Farmer
farm...@gmail.com
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Check config files before stop opensips service

2019-02-13 Thread Mickael Hubert
I would like to know, if there is a way to check opensips's config files
before stop service.
Ex: If I do a syntax error into cfg files (with opensips started), I want
to "ban" the daemon shutdown (service opensips stop)

I'm playing with opensips.service and opensips -C -f $config to try to
reach my goal, but I'm not be able to do at this moment...

Do you have an idea please ?
Thanks in advance
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] RTPProxy No Audio on Outbound Calls

2019-02-13 Thread John Quick
Mark,

You can detect if the INVITE came from your Asterisk by testing the $si
pseudo-variable.
That will allow you to identify the direction of the call. I usually set a
flag for this purpose. For example:
If ($si == "my.ast.er.isk")
setflag(DIR_OUT);

At the point where you engage the rtpproxy, you will then be able to reverse
the internal/external parameters for the function call depending on the
direction of the call

If (isflagset(DIR_OUT)) {
rtpproxy_offer("corfei");
} else {
rtpproxy_offer("corfie");
}

The same flag should still be valid in the onreply handler where you can do
something similar. [Not sure if I have ie/ei the right way round in my
example].

That said, I'm not sure this topology is a good one to be using.
I would generally try to avoid having the media proxy behind NAT and also
using it in bridging mode - it makes life too complicated.

P.S. Looks like you sorted out the problems with the call to do_routing().

John Quick
Smartvox Limited



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] RTPProxy No Audio on Outbound Calls

2019-02-13 Thread Mark Farmer
Hello everyone, all help gratefully received, I've been slogging away at
this for ages!

I have OpenSIPS 2.4.4 & RTPProxy behind 1:1 NAT's (different hosts).

RTPProxy runs so:
/usr/local/bin/rtpproxy -s unix:/var/run/rtpproxy/rtpproxy.sock -u rtpproxy
rtpproxy -p /var/run/rtpproxy/rtpproxy.pid -s udp:10.96.16.58 7722 -l
10.96.0.58 10.98.0.58 -A ext.ip.addr.ess 10.98.0.58 -d DBUG LOG_LOCAL0 -m
1 -M 2

OpenSIPS is sitting between my provider & an Asterisk server which has
phones registered.

When I make calls 'Provider -> OpenSIPS/RTPProxy -> Asterisk -> Phone' all
is good, 2 way audio.
But when the call flows in the opposite direction, I get no audio since SDP
is the same as the 1st call.

How do I get it to reverse the rtpproxy_offer/answer flags?

These are the bits that handles it all:

route[RTPPROXY] {

if (is_method("BYE|CANCEL")) {
rtpproxy_unforce();
}

if (is_method("INVITE")) {
rtpproxy_offer("corwfie");
}
}

onreply_route[DROUTING] {

if (is_method("BYE|CANCEL")) {
sip_trace("tid","d");
rtpproxy_unforce();
}

if ($rs=~"(2[0-9][0-9])") {
rtpproxy_answer("corwfei");
}
}



-- 
Mark Farmer
farm...@gmail.com
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


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

2019-02-13 Thread 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.




diff --git a/modules/rtpengine/rtpengine.c b/modules/rtpengine/rtpengine.c
index 2d1a1d3..d9dc4df 100644
--- a/modules/rtpengine/rtpengine.c
+++ b/modules/rtpengine/rtpengine.c
@@ -1666,6 +1666,7 @@ static int parse_flags(struct ng_flags_parse *ng_flags, struct sip_msg *msg,
 		if (!val.s) {
 			bitem = bencode_str(bencode_item_buffer(ng_flags->flags), &key);
 			if (!bitem) {
+LM_ERR("XXX ng_flags->glags => %p\n", ng_flags->flags);
 err = "no more memory";
 goto error;
 			}
@@ -1766,8 +1767,10 @@ static bencode_item_t *rtpe_function_call(bencode_buffer_t *bencbuf, struct sip_
 
 	ng_flags.to = (op == OP_DELETE) ? 0 : 1;
 
-	if (parse_flags(&ng_flags, msg, &op, flags_str))
-		goto error;
+	if (op != OP_DELETE) {
+		if (parse_flags(&ng_flags, msg, &op, flags_str))
+			goto error;
+	}
 
 	/* only add those if any flags were given at all */
 	if (ng_flags.direction && ng_flags.direction->child)
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] tls -> udp

2019-02-13 Thread John Quick
Hi Johan,

I've configured Proxy servers to do this a few times.
You should do the following:
1) For Requests going from TLS to UDP, change any occurrence of
"transport=tls" in the R-URI parameters. I use the following to do this:
subst_uri('/transport=tls/transport=udp/I');

2) Make sure OpenSIPS adds correct Record-Route headers. 
Default behaviour in this case is to add 2 RR headers when you call
record_route(). Make sure double_rr has not been disabled in the modparam
section.
One header describes the TLS socket and the other header describes the UDP
socket. These are needed for sequential Loose-Routed requests later in the
dialogue.

3) Just before you relay the request over UDP, call the force_send_socket()
function. For example:
force_send_socket(udp:12.34.56.78:5060);

Hope this helps.

John Quick
Smartvox Limited



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users