[OpenSIPS-Users] mediaproxy relay on none default route interface failed

2009-09-10 Thread Jiang Jinke
Dear All,

I tried to make the relay to listen to the none default route
interface, but failed.

Below is my configuration info and my env.

Using the latest mediaproxy-2.3.8 on CentOS 5.3.

I had media-dispatcher and media-relay running on my server which has
multiple NIC interface,
two public ips which are belong to two different provider.

for example:
eth0: 192.168.88.12
eth1: 203.xx.xx.xx
eth2: 63.xx.xx.xx
eth3: 10.11.12.21

route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric RefUse Iface
63.xx.xx.320.0.0.0 255.255.255.240 U 0  00 eth2
203.xx.xx.128  0.0.0.0 255.255.255.192 U 0  00 eth1
10.11.12.0  0.0.0.0 255.255.255.0   U 0  00 eth3
192.168.88.00.0.0.0 255.255.255.0   U 0  00 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0  00 eth3
0.0.0.0 203.xx.xx.129  0.0.0.0 UG0  00 eth1

But I notice that the relay are always binding to the one that has
default route
as said in the document.
I can use two machine of course, but is it possible to have two
separate relay that will
only sent out packet from the interface it's listening to.

my config file is:
[Relay]
dispatchers = 63.xx.xx.xx 203.xx.xx.xx
port_range = 3:4
log_level = DEBUG
[Dispatcher]
socket_path = dispatcher.sock
listen_management = 127.0.0.1
log_level = DEBUG
relay_timeout = 5
[TLS]
certs_path = tls
[Database]
[Radius]
[OpenSIPS]
socket_path = '/var/run/opensips.sock'
max_connections = 20

I tried to use the media_relay_avp before calling use_media_proxy();
but it seems the relay still listening to the other interface which
has the default route.

The script of opensips is below:
$avp(s:media_relay) = 63.xx.xx.xx;
use_media_proxy();

Regards,
--
Jinke Jiang



the debug log of mediaproxy:
Sep 10 18:16:54 ssw1 media-dispatcher[21925]: debug: Issuing update
command to relay at 63.xx.xx.xx
Sep 10 18:16:54 ssw1 media-relay[21930]: debug: Received new SDP offer
Sep 10 18:16:54 ssw1 media-relay[21930]:
mediaproxy.mediacontrol.StreamListenerProtocol starting on 30028
Sep 10 18:16:54 ssw1 media-relay[21930]:
mediaproxy.mediacontrol.StreamListenerProtocol starting on 30029
Sep 10 18:16:54 ssw1 media-relay[21930]:
mediaproxy.mediacontrol.StreamListenerProtocol starting on 30030
Sep 10 18:16:54 ssw1 media-relay[21930]:
mediaproxy.mediacontrol.StreamListenerProtocol starting on 30031
Sep 10 18:16:54 ssw1 media-relay[21930]: debug: Added new stream:
(audio) 10.10.101.147:20562 (RTP: Unknown, RTCP: Unknown) -
203.xx.xx.xx:30028 -

203.xx.xx.xx:30030 - Unknown (RTP: Unknown, RTCP: Unknown)
Sep 10 18:16:54 ssw1 media-relay[21930]: debug: created new session
4022675...@10.10.101.147: 8...@test.com (3297793466) --
0086135x...@test.com
Sep 10 18:16:55 ssw1 media-dispatcher[21925]: debug: Issuing update
command to relay at 63.xx.xx.xx
Sep 10 18:16:55 ssw1 media-relay[21930]: debug: updating existing
session 4022675...@10.10.101.147: 8...@test.com (3297793466) --
0086135x...@test.com
Sep 10 18:16:55 ssw1 media-relay[21930]: debug: Received updated SDP answer
Sep 10 18:16:55 ssw1 media-relay[21930]: debug: Got initial answer
from callee for stream: (audio) 10.10.101.147:20562 (RTP: Unknown,
RTCP: Unknown) -

203.xx.xx.xx:30028 - 203.xx.xx.xx:30030 - 203.xx.xx.15x:18550
(RTP: Unknown, RTCP: Unknown)
Sep 10 18:16:56 ssw1 media-relay[21930]: debug: Got traffic
information for stream: (audio) 10.10.101.147:20562 (RTP:
119.145.xx.xx:20562, RTCP: Unknown) -

203.xx.xx.xx:30028 - 203.xx.xx.xx:30030 - 203.xx.xx.15x:18550
(RTP: Unknown, RTCP: Unknown)
Sep 10 18:16:56 ssw1 media-relay[21930]: debug: Got traffic
information for stream: (audio) 10.10.101.147:20562 (RTP:
119.145.xx.xx:20562, RTCP: Unknown) -

203.xx.xx.xx:30028 - 203.xx.xx.xx:30030 - 203.xx.xx.15x:18550
(RTP: 203.xx.xx.15x:18550, RTCP: Unknown)
Sep 10 18:16:58 ssw1 media-relay[21930]: debug: Got traffic
information for stream: (audio) 10.10.101.147:20562 (RTP:
119.145.xx.xx:20562, RTCP: Unknown) -

203.xx.xx.xx:30028 - 203.xx.xx.xx:30030 - 203.xx.xx.15x:18550
(RTP: 203.xx.xx.15x:18550, RTCP: 203.xx.xx.15x:18551)
Sep 10 18:17:03 ssw1 media-dispatcher[21925]: debug: Issuing update
command to relay at 63.xx.xx.xx
Sep 10 18:17:03 ssw1 media-relay[21930]: debug: updating existing
session 4022675...@10.10.101.147: 8...@test.com (3297793466) --
0086135x...@test.com
Sep 10 18:17:03 ssw1 media-relay[21930]: debug: Received updated SDP answer
Sep 10 18:17:03 ssw1 media-relay[21930]: debug: Unchanged stream:
(audio) 10.10.101.147:20562 (RTP: 119.145.xx.xx:20562, RTCP: Unknown)
-

203.xx.xx.xx:30028 - 203.xx.xx.xx:30030 - 203.xx.xx.15x:18550
(RTP: 203.xx.xx.15x:18550, RTCP: 203.xx.xx.15x:18551)
Sep 10 18:17:04 ssw1 media-dispatcher[21925]: debug: Issuing remove
command to relay at 63.xx.xx.xx
Sep 10 18:17:04 ssw1 media-relay[21930]: debug: removing session
4022675...@10.10.101.147: 8...@test.com 

Re: [OpenSIPS-Users] mediaproxy relay on none default route interface failed

2009-09-10 Thread Raúl Alexis Betancor Santana
On Thursday 10 September 2009 11:56:00 Ghaith ALKAYYEM wrote:
 Hello,

 I think it's not possible to use two separate relays on the same server,
 I tried that a lot then I switched to RTPproxy.

That's not true, you could run as many Realys as you want on the same server, 
only have to patch mediaproxy-relay to be able to call it with a 
diferent .cfg as the default one, have diferent listen ports and no more.


-- 
Raúl Alexis Betancor Santana
Dimensión Virtual

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


Re: [OpenSIPS-Users] mediaproxy relay on none default route interface failed

2009-09-10 Thread Jiang Jinke
Dear Raúl,

Thanks for the idea. But I'm wondering if there is another way to do
this easily.

Regards,
Jinke Jiang

2009/9/10 Raúl Alexis Betancor Santana r...@dimension-virtual.com:
 On Thursday 10 September 2009 11:56:00 Ghaith ALKAYYEM wrote:
 Hello,

 I think it's not possible to use two separate relays on the same server,
 I tried that a lot then I switched to RTPproxy.

 That's not true, you could run as many Realys as you want on the same server,
 only have to patch mediaproxy-relay to be able to call it with a
 diferent .cfg as the default one, have diferent listen ports and no more.


 --
 Raúl Alexis Betancor Santana
 Dimensión Virtual

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


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


Re: [OpenSIPS-Users] mediaproxy relay on none default route interface failed

2009-09-10 Thread Raúl Alexis Betancor Santana
On Thursday 10 September 2009 15:02:21 Dan Pascu wrote:
 You don't need to patch anything. Just unpack mediaproxy in as many
 different directories as you need, run ./build_inplace and modify each
 config.ini in those directories as needed. Then run mediaproxy from
 those directories and each of them will use the local config.ini from
 its own directory.

So ... killing flies with bazookas ...
So ... when having to update, need to update n instances, instead of only 
one ..
So ... wasting hard disk (I know it's cheap ... but wasting anyway) ...

I think it's easier to patch media-relay to be able to pass the config file as 
a param, as on many other programs around the world ..
 
 Alternatively, if you want to use a system wide installation, you can
 copy the binaries from /usr/bin to a number of different directories
 and add a config.ini in each directory. Then run those binaries from
 those directories instead of /usr/bin/ and each binary will use the
 config.ini file in its own directory to overwrite settings from the
 global /etc/mediaproxy/config.ini.

... no coments

 Mediaproxy uses 2 configuration files. The global one resides in /etc/
 mediaproxy/config.ini. On top of that if a config.ini is present in
 the same directory as the binary (media-relay  media-dispatcher) that
 one will be used to overwrite the settings from the global one having
 priority over it.

I have no tested that ... but anyway it requires me to been duplicating 
installations  ... I still think that a simple param like -c configfile is 
better.

-- 
Raúl Alexis Betancor Santana
Dimensión Virtual

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


Re: [OpenSIPS-Users] mediaproxy relay on none default route interface failed

2009-09-10 Thread Jiang Jinke
Thanks for the detail instruction.
I just use a symlink into the directory, it's working properly now.

Just like below:
/usr/local/relay1/media-relay   - /usr/bin/media-relay
/usr/local/relay2/media-relay   - /usr/bin/media-relay

Regards,
Jinke Jiang

On Thu, Sep 10, 2009 at 10:02 PM, Dan Pascu d...@ag-projects.com wrote:

 On 10 Sep 2009, at 15:47, Raúl Alexis Betancor Santana wrote:

 On Thursday 10 September 2009 11:56:00 Ghaith ALKAYYEM wrote:
 Hello,

 I think it's not possible to use two separate relays on the same
 server,
 I tried that a lot then I switched to RTPproxy.

 That's not true, you could run as many Realys as you want on the
 same server,
 only have to patch mediaproxy-relay to be able to call it with a
 diferent .cfg as the default one, have diferent listen ports and no
 more.

 You don't need to patch anything. Just unpack mediaproxy in as many
 different directories as you need, run ./build_inplace and modify each
 config.ini in those directories as needed. Then run mediaproxy from
 those directories and each of them will use the local config.ini from
 its own directory.

 Alternatively, if you want to use a system wide installation, you can
 copy the binaries from /usr/bin to a number of different directories
 and add a config.ini in each directory. Then run those binaries from
 those directories instead of /usr/bin/ and each binary will use the
 config.ini file in its own directory to overwrite settings from the
 global /etc/mediaproxy/config.ini.

 Mediaproxy uses 2 configuration files. The global one resides in /etc/
 mediaproxy/config.ini. On top of that if a config.ini is present in
 the same directory as the binary (media-relay  media-dispatcher) that
 one will be used to overwrite the settings from the global one having
 priority over it.

 --
 Dan




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


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


Re: [OpenSIPS-Users] mediaproxy relay on none default route interface failed

2009-09-10 Thread Ghaith ALKAYYEM
Does the dispatcher work on the same machine also?
Could you provide me with more details about running these two
instances?

Regards.

On Thu, 2009-09-10 at 23:39 +0800, Jiang Jinke wrote:
 Thanks for the detail instruction.
 I just use a symlink into the directory, it's working properly now.
 
 Just like below:
 /usr/local/relay1/media-relay   - /usr/bin/media-relay
 /usr/local/relay2/media-relay   - /usr/bin/media-relay
 
 Regards,
 Jinke Jiang
 
 On Thu, Sep 10, 2009 at 10:02 PM, Dan Pascu d...@ag-projects.com wrote:
 
  On 10 Sep 2009, at 15:47, Raúl Alexis Betancor Santana wrote:
 
  On Thursday 10 September 2009 11:56:00 Ghaith ALKAYYEM wrote:
  Hello,
 
  I think it's not possible to use two separate relays on the same
  server,
  I tried that a lot then I switched to RTPproxy.
 
  That's not true, you could run as many Realys as you want on the
  same server,
  only have to patch mediaproxy-relay to be able to call it with a
  diferent .cfg as the default one, have diferent listen ports and no
  more.
 
  You don't need to patch anything. Just unpack mediaproxy in as many
  different directories as you need, run ./build_inplace and modify each
  config.ini in those directories as needed. Then run mediaproxy from
  those directories and each of them will use the local config.ini from
  its own directory.
 
  Alternatively, if you want to use a system wide installation, you can
  copy the binaries from /usr/bin to a number of different directories
  and add a config.ini in each directory. Then run those binaries from
  those directories instead of /usr/bin/ and each binary will use the
  config.ini file in its own directory to overwrite settings from the
  global /etc/mediaproxy/config.ini.
 
  Mediaproxy uses 2 configuration files. The global one resides in /etc/
  mediaproxy/config.ini. On top of that if a config.ini is present in
  the same directory as the binary (media-relay  media-dispatcher) that
  one will be used to overwrite the settings from the global one having
  priority over it.
 
  --
  Dan
 
 
 
 
  ___
  Users mailing list
  Users@lists.opensips.org
  http://lists.opensips.org/cgi-bin/mailman/listinfo/users
 
 
 ___
 Users mailing list
 Users@lists.opensips.org
 http://lists.opensips.org/cgi-bin/mailman/listinfo/users


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


Re: [OpenSIPS-Users] mediaproxy relay on none default route interface failed

2009-09-10 Thread Raúl Alexis Betancor Santana
On Thursday 10 September 2009 22:25:39 Dan Pascu wrote:
 On 10 Sep 2009, at 18:00, Raúl Alexis Betancor Santana wrote:
  So ... killing flies with bazookas ...
  So ... when having to update, need to update n instances, instead of
  only
  one ..
  So ... wasting hard disk (I know it's cheap ... but wasting
  anyway) ...

 I'm pretty sure you felt smart and clever while wording your indignant
 reply. Indeed, you absolutely had to put me into my rightful place and
 I deserved every dot and comma in it. What was in my mind trying to
 suggest some alternatives that work with the software as it is and do
 not require patching or a new version? But for a strange reason I
 cannot pinpoint, I do not feel motivated by your rhetoric. No sir.
 Shamefully I must admit that it made me think that I can spend my time
 better elsewhere. Imagine that good sir. I'm so ashamed. It also made
 me have unclean thoughts about you. It made me think that maybe you
 have a size problem and you're compensating. Can you imagine that? So,
 good sir, maybe you should fire more of your aggressive indignation
 towards me to break this unclean thinking in my mind and finally make
 me see the light. Forget about asking nicely or, God forbid,
 contributing back. That's for pussies and it only weakens one's
 character.

Every time we have talked about this ... you always react the same ... as If 
I was fighting against you ... I don't know from where you get that feeling 
from my words.

I'm only expressing my opinion, your are free to ignore it if you don't like 
it.

Yes you gave a solucion and I arge that a better solucion (and from a desing 
point of view and from the KISS principles, easier) it's so simple add a -c 
config param.
Do you want the patch? ... they are just 4 lines, I did it for 2.3.4 version 
of mediaproxy, also for callcontrol and other very good software you have 
developed but that lacks THAT SIMPLE option, to be able to set the config 
file to use from the command line ... as 99% of other software allow you.

  I still think that a simple param like -c configfile is better.

 That may be, but I made a principle of not helping people that hate me
 or abuse me verbally. 

I don't think I have abused you ... if you think soo it's your problem. I only 
express my opinion and comment other possible solutions.

 Besides, free in free software doesn't stand 
 for let's use that software that is free of charge and then feel free
 to abuse the developer. It stands for fell free to improve it and
 contribute back. Wait, scratch that. From you I wouldn't even want
 patches. The contribution you made is already more than enough...

Dan, sincerily .. you don't like to hear opinions that are agains yours ... 
and that's not good.
If you don't want my patches, you are free to ignore them. Not always a patch 
is needed to improve a software or to contribute to it, most of time another 
point of view about a problem it's enought.

-- 
Raúl Alexis Betancor Santana
Dimensión Virtual

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


Re: [OpenSIPS-Users] mediaproxy relay on none default route interface failed

2009-09-10 Thread Iñaki Baz Castillo
El Jueves, 10 de Septiembre de 2009, Dan Pascu escribió:
  That's not true, you could run as many Realys as you want on the  
  same server,
  only have to patch mediaproxy-relay to be able to call it with a
  diferent .cfg as the default one, have diferent listen ports and no  
  more.
 
 You don't need to patch anything. Just unpack mediaproxy in as many  
 different directories as you need, run ./build_inplace and modify each  
 config.ini in those directories as needed. Then run mediaproxy from  
 those directories and each of them will use the local config.ini from  
 its own directory.

Is this really preferable to a single and so common -c CONFIG_FILE 
commandline option?

A -c option would break nothing since the absence of it means default 
config file. Also a -c option allows deb usual installation and upgrade 
(the only requeriment would be create N init scripts having each one a 
different -c config file and PID file).

Perhaps you suggest the above solution as a feasible workaround without 
patching the code. I expect it because I cannot imagine how managing N full 
installations of N mediaproxies can be better than a simple -c option 
involving a single installation of the software.

Of course this is just my opinion. Take is as a suggestion and not as a 
demand.

Regards.

-- 
Iñaki Baz Castillo i...@aliax.net

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