Re: [OpenSIPS-Users] Opensips + rtpproxy + SBC

2015-10-16 Thread Trevor Steyn
HI Cedric,

As i understand using

modparam("rtpproxy", "rtpproxy_autobridge", 1)

Will let rtpproxy figure out which interface it needs to be offering the
session on based on the the IP address and port present in the command
frame.

Regards
Trevor Steyn




On 15/10/2015 17:26, Oceanet - Cédric BASSAGET wrote:
> Hello Trevor,
> I'm trying to understand how rtpproxy_autobridge works.
> Actually I'm using rtpproxy + opensips in bridge mode ( -l
> 10.0.95.10/public.ip.addr ) and calling rtpproxy_offer /
> rtpproxy_answer with i/e params regarding where the request comes from
> / goes to.
>
> Does autobridge makes it simplier ?
>
> Regards,
> Cédric


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


Re: [OpenSIPS-Users] Opensips + rtpproxy + SBC

2015-10-16 Thread Trevor Steyn
Hi No you shouldn't have to ,but this depends on your rtpproxy version
whether it support autobridge as i understand you have a custom forked
rtpproxy.

To be safe i would just use the "ie" as you have the control in the
script to make the right decisions.

Regards
Trevor Steyn


On 16/10/2015 16:40, Oceanet - Cédric BASSAGET wrote:
> Hello Trevor,
>
> So do I still need to call rtpproxy_offer / rtpproxy_answer with i/e
> params ?
>
> Regards,
> Cédric
>
> OCEANET
> ---
> [AGENCE DU MANS]
> 7, rue des Frênes
> ZAC de la Pointe
> 72190 SARGE LES LE MANS
> [t] +33 (0)2.43.50.26.50
> [f] +33 (0)2.43.72.21.14
>
> [AGENCE D'ANGERS]
> 5, rue Fleming
> Angers Technopole
> 49066 ANGERS
> [t] +33 (0)2.41.19.28.65
> [f] +33 (0)2.52.19.22.00
>
> On 16/10/2015 15:14, Trevor Steyn wrote:
>> HI Cedric,
>>
>> As i understand using
>>
>> modparam("rtpproxy", "rtpproxy_autobridge", 1)
>>
>> Will let rtpproxy figure out which interface it needs to be offering the
>> session on based on the the IP address and port present in the command
>> frame.
>>
>> Regards
>> Trevor Steyn
>>
>>
>>
>>
>> On 15/10/2015 17:26, Oceanet - Cédric BASSAGET wrote:
>>> Hello Trevor,
>>> I'm trying to understand how rtpproxy_autobridge works.
>>> Actually I'm using rtpproxy + opensips in bridge mode ( -l
>>> 10.0.95.10/public.ip.addr ) and calling rtpproxy_offer /
>>> rtpproxy_answer with i/e params regarding where the request comes from
>>> / goes to.
>>>
>>> Does autobridge makes it simplier ?
>>>
>>> Regards,
>>> Cédric
>


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


Re: [OpenSIPS-Users] opensips no voice

2015-10-13 Thread Trevor Steyn
Hi,

Why are you using both mediaproxy and rtpproxy?

If you plan on using both which is possible you should at least not let
the rtp port ranges overlap.

can you show us where you are using rtp relays on your routing scripts.

Regards
Trevor Steyn


On 13/10/2015 08:48, chiu ching cheng wrote:
> dear man :
>
> I have installed one opensips server with rtpproxy , mediaproxy ; When
> I test call with two ua , the signal seems OK . but no voice in two ua
> .  I check the log ,it's seems no any error except
> "ERROR:rtpproxy:force_rtp_proxy: Unable to parse body" .
>
> The debug level is 4 
>
> Does any idea for the reason ? firewall or something ?
>
> My configuration as follow :
>
> eth0 :172.31.18.253  eth0:1 :172.31.22.136
>
> /usr/bin/rtpproxy -l 172.31.18.253 -s udp:127.0.0.1:9000
> <http://127.0.0.1:9000> -F -m 35000 -M 65000
> /usr/local/bin/media-dispatcher
> /usr/local/bin/media-relay
>
> mediaproxy config.ini
> dispatchers = 172.31.18.253
> port_range = 35000:6
> advertised_ip = public for 172.31.18.253 ( not show for security)
> listen = 0.0.0.0
> listen_management = 0.0.0.0
> socket_path = /var/run/opensips/socket
>
>
>
> opensips.cfg 
> loadmodule "rtpproxy.so"
> modparam("rtpproxy", "rtpproxy_sock", "udp:localhost:9000") # CUSTOMIZE ME
>
> loadmodule "mediaproxy.so"
>
> #--- Default Values
> modparam("mediaproxy", "mediaproxy_socket",
> "/var/run/mediaproxy/dispatcher.sock")
> modparam("mediaproxy", "mediaproxy_timeout", 500)
> modparam("mediaproxy", "signaling_ip_avp", "$avp(nat_ip)")
> modparam("mediaproxy", "media_relay_avp", "$avp(media_relay)")
>
> thanks 
> Best Regard 
>
> JJ.chiou
>
>
> ___
> 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] Opensips + rtpproxy + SBC

2015-10-01 Thread Trevor Steyn
Normally if you are in bridge mode you will use the "ie" flags which i
dont see please can you post how you start rtpproxy.

Regards
Trevor Steyn


On 01/10/2015 08:47, Raistlin Majere wrote:
> Hi again,
>
> Well I have read a bit more about the modes and yes, we use brigde
> mode as OpenSIPS is behind both sides of the NAT not only on the WAN
> side,  OpenSIPs is within the firewall,
>
> So basically the engage_rtp_proxy is not a good idea.
>
> route[1] {
> if(!cache_fetch("local", "outerip_$var(destinationIp)", $avp(outerIp))) {
> get_outer_ip("$var(destinationIp)", "$avp(outerIp)");
> cache_store("local", "outerip_$var(destinationIp)", "$avp(outerIp)", 10);
> }
>
> $fs = $proto + ":" + $avp(outerIp);
>
> if (is_method("BYE|CANCEL")) {
> unforce_rtp_proxy();
> } else if (is_method("INVITE")){
> if (has_body("application/sdp")) {
> $var(trustconnectionip) = "%TRUSTCONNECTIONIP%";
> $var(ciptrusted) = "no";
> if ($var(trustconnectionip)=="yes") {
> $var(ciptrusted) = "yes";
> } else if ($var(trustconnectionip)=="auto") {
> $var(sdpc) = $(rb{sdp.line,c}{s.substr,9,0});
> if($td == $fd && $td != $var(sdpc)) {
> $var(ciptrusted) = "yes";
> }
> }
> if ($var(ciptrusted)=="yes") {
> rtpproxy_offer("focnr");
> } else {
> rtpproxy_offer("focn");
> }
> }
> }
>
> # Prevent $var(destinationPort) from getting default port number 5060
> for TLS if no port specified in R-URI.
> if($(ru{uri.port})=="" && $proto=="tls" &&
> $var(destinationPort)=="5060") {
> $var(destinationPort) = 5061;
> }
>
> # force the transport protocol to the same one the client used
> $du =
> "sip:"+$var(destinationIp)+":"+$var(destinationPort)+";transport="+$proto;
>
> t_on_reply("1");
>
> # for INVITEs enable some additional helper routes
> if (is_method("INVITE")) {
> t_on_failure("1");
> }
>
> if (!t_relay()) {
> xlog("L_INFO", "Relay error");
> sl_reply_error();
> }
> exit;
> }
>
> The route[1] is set in the main route under this conditions
>
> if (has_totag()) {
> # sequential request within a dialog should
> # take the path determined by record-routing
> if (loose_route()) {
> $var(destinationIp) = $avp(requestIp);
> $var(destinationPort) = $rp;
>
> if (is_method("INVITE")) {
> # even if in most of the cases is useless, do RR for
> # re-INVITEs alos, as some buggy clients do change route set
> # during the dialog.
> record_route();
> }
> # route it out to whatever destination was set by loose_route()
> # in $du (destination URI).
> route(1);
> ...
>exit;
> }
> 
>
> And if there is no REGISTER, PUBLISH, CANCEL
>
> route(1);
> }
>
>
>
> ___
> 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] Opensips + rtpproxy + SBC

2015-09-30 Thread Trevor Steyn
HI Raistlin,

from your script we cannot see where you are setting t_on_reply routes
as im sure this is where you are probably missing the rtpproxy_answer()
but cannot see why as that part of the script is missing


maybe you can also try use engage_rtp_proxy() and you wont have to worry
about the answer and you could remove the reply routes and just relay

if ($var(ciptrusted)=="yes") {
engage_rtp_proxy("focnr");
} else {
engage_rtpproxy("focn");
}

Regards
Trevor Steyn



 

On 30/09/2015 14:56, Raistlin Majere wrote:
> Hi,
>
> Recently the maintainer of the SIPs proxy in our company quit, and
> well I'm the new in charge of this project, the bad new is I had 0
> experience with SIP.  After some week I got my first case related to
> our "SIP proxy".
>
> We are using OpenSIP 1.8 within our Firewall to handle the protocol
> and the NAT that it will imply within a Firewall. The script my ex
> coworker did is working in 99% of cases but this specific case. 
>
> The customer has one setup like this
>
>
> PhoneA
> PhoneB
> PhoneC --- Call Manager --- Firewall --- SBC --- Farm of RTP Media servers
> 
> PhoneN
>
> The opensips instance is running within the firewall. The next IPs are
> fake but follow the "rules" of internal/external it is just to avoid
> problems
>
> Call Manager: 172.17.1.1
> Firewall: Internal Network 192.168.0.10
> Firewall: Extenal Network 62.1.1.10
> SBC: 210.200.100.100
> Farm of Media Servers: 210.200.100.128/25 <http://210.200.100.128/25>
>
> So the invite works as Expected but on the 180 Ringing either 200 OK
> the moment the messages traverse the SIP proxy, doesn't contain the
> "farm" IP but the SBC IP.
>
> This are the 180 Ringing:
>
> From SBC to the Firewall
>
> SIP/2.0 180 Ringing
> Via: SIP/2.0/UDP 62.1.1.10:5060;branch=z9hG4bKd091.937a047.0
> Via:
> SIP/2.0/UDP 
> 172.17.1.1:5060;rport=5060;received=172.17.1.1;branch=z9hG4bKac393424402
> From: <sip:5000@210.200.100.100
> <mailto:sip%3A5000@210.200.100.100>>;tag=1c393411873
> To: <sip:5001@210.200.100.100
> <mailto:sip%3A5001@210.200.100.100>;user=phone>;tag=gK08c71cc5
> Call-ID: 39341083229920151062@172.17.1.1
> <mailto:39341083229920151062@172.17.1.1>
> CSeq: 1 INVITE
> Record-Route: <sip:62.1.1.10:5060;r2=on;lr;did=6d8.933abaa6>
> Record-Route: <sip:192.168.0.10:5060;r2=on;lr;did=6d8.933abaa6>
> Contact: <sip:5001@210.200.100.100:5060
> <http://sip:5001@210.200.100.100:5060>>
> Allow:
> INVITE,ACK,CANCEL,BYE,REGISTER,REFER,INFO,SUBSCRIBE,NOTIFY,PRACK,UPDATE,OPTIONS,MESSAGE,PUBLISH
> Require: 100rel
> RSeq: 433990
> Content-Length:   266
> Content-Disposition: session; handling=required
> Content-Type: application/sdp
>
> v=0
> o=Sonus_UAC 176482 50736 IN IP4 210.200.100.100
> s=SIP Media Capabilities
> c=IN IP4 210.200.100.243
> t=0 0
> m=audio 61348 RTP/AVP 8 101
> a=rtpmap:8 PCMA/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-15
> a=sendrecv
> a=ptime:20
> a=silenceSupp:off - - - -
>
> After the firewall + Opensips have processed this message to the call
> center
>
> SIP/2.0 180 Ringing
> Via: SIP/2.0/UDP 172.17.1.1:5060;branch=z9hG4bKac393424402
> From: <sip:5000@210.200.100.100
> <mailto:sip%3A5000@210.200.100.100>>;tag=1c393411873
> To: <sip:5001@210.200.100.100
> <mailto:sip%3A5001@210.200.100.100>;user=phone>;tag=gK08c71cc5
> Call-ID: 39341083229920151062@172.17.1.1
> <mailto:39341083229920151062@172.17.1.1>
> CSeq: 1 INVITE
> Record-Route: <sip::62.1.1.10:5060;r2=on;lr;did=6d8.933abaa6>
> Record-Route: <sip:192.168.0.10:5060;r2=on;lr;did=6d8.933abaa6>
> Contact: <sip:5001@210.200.100.100 <mailto:sip%3A5001@210.200.100.100>>
> Allow:
> INVITE,ACK,CANCEL,BYE,REGISTER,REFER,INFO,SUBSCRIBE,NOTIFY,PRACK,UPDATE,OPTIONS,MESSAGE,PUBLISH
> Require: 100rel
> RSeq: 433990
> Content-Length: 295
> Content-Disposition: session; handling=required
> Content-Type: application/sdp
>
> v=0
> o=Sonus_UAC 176482 50736 IN IP4 210.200.100.100
> s=SIP Media Capabilities
> t=0 0
> m=audio 4845 RTP/AVP 8 101
> a=rtpmap:8 PCMA/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-15
> a=sendrecv
> a=ptime:20
> a=silenceSupp:off - - - -
> a=nortpproxy:yes
> c=IN IP4 210.200.100.100
> a=rtcp:4848
>
> 
>
> The RTP "acceptor" is created under the IP 210.200.100.100 instead of
> the IP 210.200.243 as the SIPproxy is changing the SDP connection
> information.
>
>
> This is the logic we are using in our script for the INVITE and for
> the onreply_route
>
> if (is_method("IN

Re: [OpenSIPS-Users] Opensips + rtpproxy + SBC

2015-09-30 Thread Trevor Steyn
HI Jose,

I was not aware its running in bridge mode, Could you post your how you
start rtpproxy?

also do you have the following in your module settings

modparam("rtpproxy", "rtpproxy_autobridge", 1)


I have a working config of bridgemode with rtpproxy will be happy to
share it with you just want to confirm your setup.

Regards
Trevor Steyn

also you dont use rtpproxy in re-invites this would cause re-invites to
skip rtpproxy im sure this is a mistake.



On 30/09/2015 17:05, Raistlin Majere wrote:
> First of all thanks for your quick response.
>
> At the moment this is the point where we have the t_on_reply for that
> onreply_route I sent in the previous email.
>
> route[1] {
> if(!cache_fetch("local", "outerip_$var(destinationIp)", $avp(outerIp))) {
> get_outer_ip("$var(destinationIp)", "$avp(outerIp)");
> cache_store("local", "outerip_$var(destinationIp)", "$avp(outerIp)", 10);
> }
>
> $fs = $proto + ":" + $avp(outerIp);
>
> if (is_method("BYE|CANCEL")) {
> unforce_rtp_proxy();
> } else if (is_method("INVITE")){
> if (has_body("application/sdp")) {
> $var(trustconnectionip) = "%TRUSTCONNECTIONIP%";
> $var(ciptrusted) = "no";
> if ($var(trustconnectionip)=="yes") {
> $var(ciptrusted) = "yes";
> } else if ($var(trustconnectionip)=="auto") {
> $var(sdpc) = $(rb{sdp.line,c}{s.substr,9,0});
> if($td == $fd && $td != $var(sdpc)) {
> $var(ciptrusted) = "yes";
> }
> }
> if ($var(ciptrusted)=="yes") {
> rtpproxy_offer("focnr");
> } else {
> rtpproxy_offer("focn");
> }
> }
> }
>
> # Prevent $var(destinationPort) from getting default port number 5060
> for TLS if no port specified in R-URI.
> if($(ru{uri.port})=="" && $proto=="tls" &&
> $var(destinationPort)=="5060") {
> $var(destinationPort) = 5061;
> }
>
> # force the transport protocol to the same one the client used
> $du =
> "sip:"+$var(destinationIp)+":"+$var(destinationPort)+";transport="+$proto;
>
> t_on_reply("1");
>
> # for INVITEs enable some additional helper routes
> if (is_method("INVITE")) {
> t_on_failure("1");
> }
>
> if (!t_relay()) {
> xlog("L_INFO", "Relay error");
> sl_reply_error();
> }
> exit;
> }
>
> The route[1] is set in the main route under this conditions
>
> if (has_totag()) {
> # sequential request within a dialog should
> # take the path determined by record-routing
> if (loose_route()) {
> $var(destinationIp) = $avp(requestIp);
> $var(destinationPort) = $rp;
>
> if (is_method("INVITE")) {
> # even if in most of the cases is useless, do RR for
> # re-INVITEs alos, as some buggy clients do change route set
> # during the dialog.
> record_route();
> }
> # route it out to whatever destination was set by loose_route()
> # in $du (destination URI).
> route(1);
> ...
>exit;
> }
> 
>
> And if there is no REGISTER, PUBLISH, CANCEL
>
> route(1);
> }
>
> About the engage_rtp_proxy I was actually thinking about it but I'm a
> bit scared because of the bridge mode, as it is a "generic" script, I
> need to identify all this cases and create configuration cases to make
> scripts automatically for those setups. 
>
> Srly, thanks for the response >.< I have only 1 week experience with
> this protocol and I'm having nightmares already.
>
> Kind regards
> Jose Palma
>
> 2015-09-30 16:51 GMT+02:00 Trevor Steyn <tre...@webon.co.za
> <mailto:tre...@webon.co.za>>:
>
> HI Raistlin,
>
> from your script we cannot see where you are setting t_on_reply
> routes as im sure this is where you are probably missing the
> rtpproxy_answer() but cannot see why as that part of the script is
> missing
>
>
> maybe you can also try use engage_rtp_proxy() and you wont have to
> worry about the answer and you could remove the reply routes and
> just relay
>
> if ($var(ciptrusted)=="yes") {
> engage_rtp_proxy("focnr");
> } else {
> engage_rtpproxy("focn");
> }
>
> Regards
> Trevor Steyn
>
>
>
>  
>
> On 30/09/2015 14:56, Raistlin Majere wrote:
>> Hi,
>>
>> Recently the maintainer of the SIPs proxy in our company quit,
>> and well I'm the new in charge of this project, the bad new is I
>> had 0 experience with SIP.  After some week I got my first case
>&g

Re: [OpenSIPS-Users] What rtpproxy version should i be using

2015-08-16 Thread Trevor Steyn
Hi Peter,

I am using the 1.2.1 from epel, This version makes CPU usage go to 100%
and stay's there consistently which is worrying.

Is there a problem with the one from epel?

Regards
Trevor Steyn


On 14/08/2015 15:00, Peter Lemenkov wrote:
 Hello All!

 I'd say stay with 1.2.1 if unsure / if something goes wrong with 2.x.x
 Btw are you using rtpproxy from EPEL repository or you compiled it by 
 yourself?

 2015-08-14 15:53 GMT+03:00 Trevor Steyn tre...@webon.co.za:
 Hi Opensips Users,

 I am running opensips 2.1 and am having some issues with rtpproxy I have
 tried both 1.2.1 and 2.0.0 with different results.

 Keep in mind i am using rtpproxy in bridge mode and using the
 re-packetization feauture also both IP's in the bridge are on the same
 physical interface just on differant vlans.

 My OS is Cenots 6

 1.2.1

 Works great the only issue i see is 100% CPU usage i have not had any
 bad quality with this version its just very worrying seeing 100% CPU
 usage all the time.

 2.0.0

 The CPU issue is resolved almost no CPU usage with a bunch of calls but
 when i turn on re-packetization the quality of the audio stream is terrible.

 I would like to choose a version and work on the issues alternativly if
 there is another version recommended for opensips i would like to go
 that route, I see there is a version on opensips.org

 http://opensips.org/pub/rtpproxy/

 But this version seems very old and Readme states its for Opnesips 1.6.4.

 Any guidance on my issues would be very much appreciated.


 Regards
 Trevor Steyn


 ___
 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


[OpenSIPS-Users] What rtpproxy version should i be using

2015-08-14 Thread Trevor Steyn
Hi Opensips Users,

I am running opensips 2.1 and am having some issues with rtpproxy I have
tried both 1.2.1 and 2.0.0 with different results.

Keep in mind i am using rtpproxy in bridge mode and using the
re-packetization feauture also both IP's in the bridge are on the same
physical interface just on differant vlans.

My OS is Cenots 6

1.2.1

Works great the only issue i see is 100% CPU usage i have not had any
bad quality with this version its just very worrying seeing 100% CPU
usage all the time.

2.0.0

The CPU issue is resolved almost no CPU usage with a bunch of calls but
when i turn on re-packetization the quality of the audio stream is terrible.

I would like to choose a version and work on the issues alternativly if
there is another version recommended for opensips i would like to go
that route, I see there is a version on opensips.org

http://opensips.org/pub/rtpproxy/

But this version seems very old and Readme states its for Opnesips 1.6.4.

Any guidance on my issues would be very much appreciated.


Regards
Trevor Steyn


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


Re: [OpenSIPS-Users] Managing Concurrent Calls

2015-08-13 Thread Trevor Steyn
Hi
The permissions module does this. The standard trunking script has support
for limiting channels.

Regards
Trevor Steyn
On 13 Aug 2015 6:14 PM, Terrance Devor ter.de...@gmail.com wrote:

 Hello Everyone,

 Was wondering what is the preferred and current means of managing
 concurrent calls per
 client IP address. I am thinking it has to do with the Dialog module
 however there is no number of channels field there.

 If we can take advantage of caching mechanism it would be great however, I
 think dialog table is constantly queried?

 Thanks in Advance,

 Terrance.

 ___
 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] Routing Based on $si and $Ri

2015-08-05 Thread Trevor Steyn
Ho Bogdan,

Thanks for this just want to make sure i am doing this the right way

So im my thinking i have the following tables in dialplan

*** 1. row ***
 id: 6
   dpid: 1
 pr: 1
   match_op: 0
  match_exp: 196.2.97.165_41.213.100.100
match_flags: 0
  subst_exp:
   repl_exp:
timerec:
   disabled: 0
  attrs: route=2,forced_socket=41.213.100.200
*** 2. row ***
 id: 4
   dpid: 1
 pr: 1
   match_op: 0
  match_exp: 196.2.97.165_41.213.100.200
match_flags: 0
  subst_exp:
   repl_exp: \2
timerec:
   disabled: 0
  attrs: route=1,forced_socket=41.213.100.100


In my script I will have something like this

if (dp_translate(1,/$si+_+$Ri,$avp(foo)) {
Do some routing
}

Is this the way you envisioned doing this, Also what is the correct way
to to get seperate AVP's for the attributes column i have not been able
to find the answer to this i currently manually get the attributes avp

Lets say my attributes column has the following
route=1;somethingelse=random

I currently get the route by using avp_subst like so
avp_subst($avp(foo)/$avp(string_custom_route)/,
'/.*Route=[^]*([^]*).*/\1/');

then i use ///$avp(string_custom_route)/ to route the call, I feel like
this is not good practice if you could guide me here i would appreciate it
as i have tried finding examples with no avail.

Regards
Trevor Steyn
  
/
On 05/08/2015 09:50, Bogdan-Andrei Iancu wrote:
 Hi Trevor,

 Why not using the dialplan module which allows you do operate with
 custom data, it does regexp search and caching too.

 Regards,
 Bogdan-Andrei Iancu
 OpenSIPS Founder and Developer
 http://www.opensips-solutions.com
 On 04.08.2015 21:32, Trevor Steyn wrote:
 Hi All,

 I would like to be able to route calls based on Source IP and
 Destination IP (always one of opensips IPs), As usual there are many
 ways to skin a cat,
 My first thought was to have a table such as the address table but
 modify the IP field to a concatenation of $si and $RI

 so you would have a table like this


 *** 1. row ***
   id: 6
  grp: 1
   ip: 196.2.97.165_41.213.100.100
 mask: 32
 port: 0
proto: udp
  pattern:
 context_info: Route=2;Forced_Socket=41.213.100.200

 So in the route script i would do something like this

 /check_cource_address(1,$si+_+$Ri) /

 Obviously i cannot just do this with the permissions module as it
 wont accept this in the IP field as it expects a valid IP,
 So before i go down that road i was wondering if anyone knows an out
 of the box way i can do this without impacting performance, I could
 easily use avp_ops for this but as far as i can see  it does a db
 query for every transaction, this is not something that needs to be
 called for every new sip transaction it should be loaded into memory
 at startup.

 Your thoughts would be appreciated I would just like to be pointed in
 the right (Best possible way to do this) direction.

 Regards
 Trevor Steyn





 ___
 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] Routing Based on $si and $Ri

2015-08-05 Thread Trevor Steyn
Thanks Bogdan,

You have been a great help this is way better and cleaner way than what
i was going towards.

And thanks for the great project.

Regards
Trevor Steyn


On 05/08/2015 12:17, Bogdan-Andrei Iancu wrote:
 Hi Trevor,

 The proper (as syntax) way of doing the lookup should be:

 dp_translate(1,$si_$Ri/$var(out),$avp(foo))

 Also, instead of using the attr, you can use directly the repl_exp to
 return some value.

 In terms of processing and unpacking the returned value, better use
 transformations. And to really simplify things, use ';' as separator
 rather than ',' (to have a string similar to a list of parameters:

 attrs: route=2;forced_socket=41.213.100.200


 $var(my_route) = $(avp(foo){param.value,route});

 See:
 http://www.opensips.org/Documentation/Script-Tran-2-1#toc52

 Regards,

 Bogdan-Andrei Iancu
 OpenSIPS Founder and Developer
 http://www.opensips-solutions.com

 On 05.08.2015 12:44, Trevor Steyn wrote:
 Ho Bogdan,

 Thanks for this just want to make sure i am doing this the right way

 So im my thinking i have the following tables in dialplan

 *** 1. row ***
   id: 6
 dpid: 1
   pr: 1
 match_op: 0
match_exp: 196.2.97.165_41.213.100.100
 match_flags: 0
subst_exp:
 repl_exp:
  timerec:
 disabled: 0
attrs: route=2,forced_socket=41.213.100.200
 *** 2. row ***
   id: 4
 dpid: 1
   pr: 1
 match_op: 0
match_exp: 196.2.97.165_41.213.100.200
 match_flags: 0
subst_exp:
 repl_exp: \2
  timerec:
 disabled: 0
attrs: route=1,forced_socket=41.213.100.100


 In my script I will have something like this

 if (dp_translate(1,/$si+_+$Ri,$avp(foo)) {
  Do some routing
 }

 Is this the way you envisioned doing this, Also what is the correct way
 to to get seperate AVP's for the attributes column i have not been able
 to find the answer to this i currently manually get the attributes avp

 Lets say my attributes column has the following
 route=1;somethingelse=random

 I currently get the route by using avp_subst like so
 avp_subst($avp(foo)/$avp(string_custom_route)/,
 '/.*Route=[^]*([^]*).*/\1/');

 then i use ///$avp(string_custom_route)/ to route the call, I feel like
 this is not good practice if you could guide me here i would
 appreciate it
 as i have tried finding examples with no avail.

 Regards
 Trevor Steyn
/
 On 05/08/2015 09:50, Bogdan-Andrei Iancu wrote:
 Hi Trevor,

 Why not using the dialplan module which allows you do operate with
 custom data, it does regexp search and caching too.

 Regards,
 Bogdan-Andrei Iancu
 OpenSIPS Founder and Developer
 http://www.opensips-solutions.com
 On 04.08.2015 21:32, Trevor Steyn wrote:
 Hi All,

 I would like to be able to route calls based on Source IP and
 Destination IP (always one of opensips IPs), As usual there are many
 ways to skin a cat,
 My first thought was to have a table such as the address table but
 modify the IP field to a concatenation of $si and $RI

 so you would have a table like this


 *** 1. row ***
id: 6
   grp: 1
ip: 196.2.97.165_41.213.100.100
  mask: 32
  port: 0
 proto: udp
   pattern:
 context_info: Route=2;Forced_Socket=41.213.100.200

 So in the route script i would do something like this

 /check_cource_address(1,$si+_+$Ri) /

 Obviously i cannot just do this with the permissions module as it
 wont accept this in the IP field as it expects a valid IP,
 So before i go down that road i was wondering if anyone knows an out
 of the box way i can do this without impacting performance, I could
 easily use avp_ops for this but as far as i can see  it does a db
 query for every transaction, this is not something that needs to be
 called for every new sip transaction it should be loaded into memory
 at startup.

 Your thoughts would be appreciated I would just like to be pointed in
 the right (Best possible way to do this) direction.

 Regards
 Trevor Steyn





 ___
 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


[OpenSIPS-Users] Routing Based on $si and $Ri

2015-08-04 Thread Trevor Steyn
Hi All,

I would like to be able to route calls based on Source IP and
Destination IP (always one of opensips IPs), As usual there are many
ways to skin a cat,
My first thought was to have a table such as the address table but
modify the IP field to a concatenation of $si and $RI

so you would have a table like this


*** 1. row ***
  id: 6
 grp: 1
  ip: 196.2.97.165_41.213.100.100
mask: 32
port: 0
   proto: udp
 pattern:
context_info: Route=2;Forced_Socket=41.213.100.200

So in the route script i would do something like this

/check_cource_address(1,$si+_+$Ri) /

Obviously i cannot just do this with the permissions module as it wont
accept this in the IP field as it expects a valid IP,
So before i go down that road i was wondering if anyone knows an out of
the box way i can do this without impacting performance, I could easily
use avp_ops for this but as far as i can see  it does a db query for
every transaction, this is not something that needs to be called for
every new sip transaction it should be loaded into memory at startup.

Your thoughts would be appreciated I would just like to be pointed in
the right (Best possible way to do this) direction.

Regards
Trevor Steyn



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


Re: [OpenSIPS-Users] With OpenSIPS-CP how to make a sip trunk between two opensips

2015-08-04 Thread Trevor Steyn
HI Kevin.

You have already added the ips to be trusted so all that needs to be
done is the routing it depends how you want to do it but simplest from
opensips-CP is probably the drouting module you can use prefix match to
route to other sip server,

On sip server 1 you would add a gateway in the dr_gatway table with the
ip of the sip server 2

and add a rule like the following

*** 1. row ***
 ruleid: 1
groupid: 1
 prefix: 2000
timerec:
   priority: 0
routeid:
 gwlist: your_sip_server_2
  attrs:

DB Layout: http://www.opensips.org/html/docs/db/db-schema-devel.html#AEN3101
Drouting Module:
http://www.opensips.org/html/docs/modules/2.1.x/drouting.html

Regards
Trevor Steyn


On 23/07/2015 20:36, Kevin Kokos wrote:
 Hi All,

 First of all, i'm a noob in the sip environment, network and even more
 in opensips so please excuse my lack of accuracy/knowledge.
 Here is my goal, in a test purpose (yes it can be weird), i have the
 following installation:

 SIP client (1000, registered on OpenSips 1) --- OpenSips 1
 (192.168.1.1) --- Opensips 2 (192.168.1.2) ---SIP client
 (2000, registered on OpenSips 2)

 The goal is for sip_client with account 1000 to be able to call
 sip_client with account 2000.It should be easy to do but i can't
 manage to configure it.

 Each OpenSips can be managed by Opensips-cp.

 From what i read, i saw the following step to do:
 -In the IP Auth tab, add the other sip server ip address in order to
 be trusted.
 =Both of sip server should be allowed to talk to each other. Is it
 enough for linking the two sip servers?
 -Make a dialplan. Use a prefix, create a dialplan which regex for
 identifying the prefix in the sip uri and add the ip address of the
 other sip server.
 =Let's choose 66 prefix for the Opensips 2 area. In dialing 661000
 from sip client 2000, we can have something like that for the
 dialplan: matching regex: ^661000[0-9].* Matching flags 0 Substitution
 regex (66100[0-9])@.*(;.*) Replacement expression sip:\1@192.168.1.1
 mailto:1@192.168.1.1
 -Make a dynamic routing. Give the other sip server ip address and
 strip the prefix.
 In that case: Address: 192.168.1.1 Strip 2 PRI Prefix #66

 Same thing in the opposite way on the other sip server.

 Someone could explain to me where i am wrong and/or maybe redirect me
 to a tutorial for dummies (wasn't able to find anything i understand
 in googling...maybe lake of good keyword) ? Thank you in advance.

 Kevin




 ___
 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] Fwd: opensips server dual network card configuration

2015-07-29 Thread Trevor Steyn
Hi Kevin, I dont 100% understand what you want to achieve here?

I assume you want something like this

Private UAC    Opensips Eth1 (private)Opensips Eth0 (public)
-- Public UAC

If you just want to route between the 2 networks you could look at
enabling multi homed setting
homed=1

or just use something like the following which I assume is less time
consuming for opensips.

 if ( is_method(INVITE)  src_ip==LOCAL_IP ) {
force_send_socket(PUBLIC_IP);
..
 }

you also need to make sure opensips is listening on the the other
interface for traffic by adding another listen line in your global config

listen=udp:NEW_IP:5060

Regards
Trevor Steyn


On 27/07/2015 15:47, kevinfang wrote:
 HI,
 I have a opensips servers in a private network, IP address:
 10.34.14.24, now I'm going to this private network address 1: 1 NAT to
 public networks, and modify the opensips.cfg profile. Register now
 through the public network clients can conduct video and audio
 communications, and work very well.

 Now I need to add a network card (IP: 192.168.100.100) on opensips
 server, and directly connected to a sip client (IP: 192.168.100.200)
 through this card.

 How should I modify opensips.cfg, make public sip client the private
 network sip client to communicate it?

 Attach opensips.cfg I now use:



 #
 # $Id$
 #
 # OpenSIPS residential configuration script
 # by OpenSIPS Solutions t...@opensips-solutions.com
 mailto:t...@opensips-solutions.com
 #
 # This script was generated via make menuconfig, from
 #   the Residential scenario.
 # You can enable / disable more features / functionalities by
 #   re-generating the scenario with different options.#
 #
 # Please refer to the Core CookBook at:
 #  http://www.opensips.org/Resources/DocsCookbooks
 # for a explanation of possible statements, functions and parameters.
 #


 ### Global Parameters #

 debug=3
 log_stderror=no
 log_facility=LOG_LOCAL0

 fork=yes
 children=4

 /* uncomment the following lines to enable debugging */
 #debug=6
 #fork=no
 #log_stderror=yes

 /* uncomment the next line to enable the auto temporary blacklisting of 
not available destinations (default disabled) */
 #disable_dns_blacklist=no

 /* uncomment the next line to enable IPv6 lookup after IPv4 dns 
lookup failures (default disabled) */
 #dns_try_ipv6=yes

 /* comment the next line to enable the auto discovery of local aliases
based on revers DNS on IPs */
 auto_aliases=no

 advertised_address=61.132.137.100
 alias=61.132.137.100

 listen=udp:10.34.14.24:5060 http://10.34.14.24:5060  # CUSTOMIZE ME
 #listen=udp:10.34.240.150:5060 http://10.34.240.150:5060

 disable_tcp=yes

 disable_tls=yes


 ### Modules Section 

 #set module path
 mpath=/usr/local/opensips/lib64/opensips/modules

  SIGNALING module
 loadmodule signaling.so

  StateLess module
 loadmodule sl.so

  Transaction Module
 loadmodule tm.so
 modparam(tm, fr_timer, 5)
 modparam(tm, fr_inv_timer, 30)
 modparam(tm, restart_fr_on_each_reply, 0)
 modparam(tm, onreply_avp_mode, 1)

  Record Route Module
 loadmodule rr.so
 /* do not append from tag to the RR (no need for this script) */
 modparam(rr, append_fromtag, 0)

  MAX ForWarD module
 loadmodule maxfwd.so

  SIP MSG OPerationS module
 loadmodule sipmsgops.so

  FIFO Management Interface
 loadmodule mi_fifo.so
 modparam(mi_fifo, fifo_name, /tmp/opensips_fifo)


  URI module
 loadmodule uri.so
 modparam(uri, use_uri_table, 0)






  USeR LOCation module
 loadmodule usrloc.so
 modparam(usrloc, nat_bflag, 10)
 modparam(usrloc, db_mode,   0)

  REGISTRAR module
 loadmodule registrar.so
 modparam(registrar, tcp_persistent_flag, 7)

 /* uncomment the next line not to allow more than 10 contacts per AOR */
 #modparam(registrar, max_contacts, 10)

  ACCounting module
 loadmodule acc.so
 /* what special events should be accounted ? */
 modparam(acc, early_media, 0)
 modparam(acc, report_cancels, 0)
 /* by default we do not adjust the direct of the sequential requests.
if you enable this parameter, be sure the enable append_fromtag
in rr module */
 modparam(acc, detect_direction, 0)
 modparam(acc, failed_transaction_flag, 3)
 /* account triggers (flags) */
 modparam(acc, log_flag, 1)
 modparam(acc, log_missed_flag, 2)

 ### Authenticated by MySQL ###
 loadmodule db_mysql.so
 loadmodule auth.so
 loadmodule auth_db.so

 modparam(usrloc, db_mode, 2)
 modparam(usrloc, db_url,
 mysql://opensips:opensipsrw@localhost/opensips)
 modparam(auth_db, calculate_ha1, yes)
 modparam(auth_db, password_column, password)
 modparam(auth_db, db_url,
 mysql://opensips:opensipsrw@localhost/opensips)
 modparam(auth_db, load_credentials, )
 ### End Authentivated by MySQL ###

 loadmodule domain.so
 modparam(domain,
 db_url,mysql://opensips:opensipsrw@localhost/opensips)
 modparam(domain, db_mode, 1)   # Use caching

 loadmodule nat_traversal.so
 modparam(nat_traversal, keepalive_interval, 90

Re: [OpenSIPS-Users] opensips-cp problem

2015-07-27 Thread Trevor Steyn
Hi Ahmed,

Have you set

short_open_tag = On ;  

In your php.ini file?

Also tailing your http error and access  logs might give you some
insight to your problem.


Regards
Trevor Steyn


On 27/07/2015 16:15, alneami_ah...@yahoo.co.uk wrote:
 Hi all,
 Well I am a new to opensips and I have installed opensips for the
 third times so far,

 until now I can go to the opensips-cp in the web and putting admin and
 admin password
 then blank page came out
 meaning it will not take me to the main.php and menu.php etc...

 I am using opensips-2.1.0 and debain whzeey. opensips-cp 6.1


 I had this problem for a month which I cant fix it.
 Any help will be appriciated ..

 Thanks and Regards

 Ahmed Alneami 


 ___
 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] topology hiding not accepting BYE before 200 OK

2015-07-27 Thread Trevor Steyn
Hi Anyone have any ideas on the below issue?

On 23/07/2015 17:12, Trevor Steyn wrote:
 Hi Guys,

 I seem to be having some trouble with the new topology_hiding module in
 opensips 2.1

 here is the call scenario

 UAC -- Opensips -- UAS

 UAC Sends Invite to UAS with topology hiding module
 UAS sends 180 with to-tag
 UAC sends BYE

 When the Bye is sent opensips loops the call till max forwards is reached

 from what i can see from the debugs the  Bye from UAC is accepted and
 matches the topology_hiding_match function but does not rewrite the
 destination IP so when the message passes t_relay() its sending the Bye
 to Itself from Itself.

 I have tried this without topology hiding and the BYE is relayed as it
 should
 .

 My route looks as follows


 route{
 script_trace( 3, $rm from $si, ruri=$ru, me);

 if (!mf_process_maxfwd_header(10)) {
 sl_send_reply(483,Too Many Hops);
 exit;
 }

 if ( check_source_address(1,$avp(trunk_attrs)) ) {
 # request comes from trunks
 setflag(IS_TRUNK);
 } else if ( is_from_gw() ) {
 # request comes from GWs
 } else {
 #send_reply(403,Forbidden);
 xlog(Message is not from Trunk or GW $si);
 #exit;
 }

 if (has_totag()) {
 # sequential request withing a dialog should
 # take the path determined by record-routing
 #if (loose_route()) {
 if(topology_hiding_match()) {

 # validate the sequential request against dialog
 if ( $DLG_status!=NULL  !validate_dialog() ) {
 xlog(In-Dialog $rm from $si (callid=$ci) is not valid
 according to dialog\n);
 ## exit;
 }

 if (is_method(BYE)) {
 setflag(ACC_DO); # do accounting ...
 setflag(ACC_FAILED); # ... even if the transaction fails
 } else if (is_method(INVITE)) {
 # even if in most of the cases is useless, do RR for
 # re-INVITEs alos, as some buggy clients do change route set
 # during the dialog.
 record_route();
 }

 # lets handle re-invites and offer proxy
 if (has_body(application/sdp))  {
 # Begin rtp session update gyrations
 if (method == INVITE) {
 # INVITE w/ SDP, so early neg
 # This is offer, reply is answer
 rtpproxy_offer(iewlz20);
 t_on_reply(1);
 } else if (method == ACK) {
 # ACK w/ SDP, so late neg (done now)
 # This is answer
 rtpproxy_answer(iewlz20);
 }
 }


 # route it out to whatever destination was set by loose_route()
 # in $du (destination URI).
 route(RELAY);
 } else {
 if ( is_method(ACK) ) {
 if ( t_check_trans() ) {
 # non loose-route, but stateful ACK; must be an ACK
 after
 # a 487 or e.g. 404 from upstream server
 t_relay();
 exit;
 } else {
 # ACK without matching transaction -
 # ignore and discard
 exit;
 }
 }
 sl_send_reply(404,Not here);
 }
 exit;
 }

  INITIAL REQUESTS

 if ( !isflagset(IS_TRUNK) ) {
 ## accept new calls only from trunks
 send_reply(403,Not from trunk);
 exit;
 }

 # CANCEL processing
 if (is_method(CANCEL)) {
 if (t_check_trans())
 t_relay();
 exit;
 } else if (!is_method(INVITE)) {
 send_reply(405,Method Not Allowed);
 exit;
 }

 if ($rU==NULL) {
 # request with no Username in RURI
 sl_send_reply(484,Address Incomplete);
 exit;
 }

 t_check_trans();

 # preloaded route checking
 if (loose_route()) {
 xlog(L_ERR,
 Attempt to route with preloaded Route's [$fu/$tu/$ru/$ci]);
 if (!is_method(ACK))
 sl_send_reply(403,Preload Route denied);
 exit;
 }

 # record routing
 record_route();

 setflag(ACC_DO); # do accounting



 # create dialog with timeout
 if ( !create_dialog(B) ) {
 send_reply(500,Internal Server Error);
 exit;
 }


 if (is_avp_set($avp(trunk_attrs))  $avp(trunk_attrs)=~^[0-9]+$) {
 get_profile_size(trunkCalls,$si,$var(size));
 if ( $(var(size){s.int}) = $(avp(trunk_attrs){s.int}) ) {
 send_reply(486,Busy Here);
 exit;
 }
 }
 set_dlg_profile(trunkCalls,$si);




 # apply transformations from dialplan table
 dp_translate(0,$rU/$rU);

 # route calls based on prefix
 if ( !do_routing(1

[OpenSIPS-Users] topology hiding not accepting BYE before 200 OK

2015-07-23 Thread Trevor Steyn
 10.10.16.2,
10.10.16.2, 0
Jul 23 16:01:16 [22780] DBG:tm:set_timer: relative timeout is 50
Jul 23 16:01:16 [22780] DBG:tm:insert_timer_unsafe: [4]: 0x7f81e1b448c0
(1580)
Jul 23 16:01:16 [22780] DBG:tm:insert_timer_unsafe: [0]: 0x7f81e1b448f0 (20)
Jul 23 16:01:16 [22780] DBG:tm:t_relay_to: new transaction fwd'ed
[Script Trace][/etc/opensips/opensips.cfg:341][me][core exit] - (BYE
from 10.10.16.2, ruri=sip:10.10.16.2;did=dbf.d239f4f3)
Jul 23 16:01:16 [22780] DBG:tm:t_unref: UNREF_UNSAFE: [0x7f81e1b446a0]
after is 0
Jul 23 16:01:16 [22780] DBG:dialog:unref_dlg: unref dlg 0x7f81e1b3c2f8
with 1 - 5 in entry 0x7f81e1b35838
Jul 23 16:01:16 [22780] DBG:core:destroy_avp_list: destroying list (nil)
Jul 23 16:01:16 [22780] DBG:core:receive_msg: cleaning up
Jul 23 16:01:16 [22780] DBG:core:parse_msg: SIP Request:
Jul 23 16:01:16 [22780] DBG:core:parse_msg:  method:  BYE
Jul 23 16:01:16 [22780] DBG:core:parse_msg:  uri:
sip:10.10.16.2;did=dbf.d239f4f3
Jul 23 16:01:16 [22780] DBG:core:parse_msg:  version: SIP/2.0
Jul 23 16:01:16 [22780] DBG:core:parse_headers: flags=2
Jul 23 16:01:16 [22780] DBG:core:parse_via_param: found param type 232,
branch = z9hG4bK2ff9.8dfac551.0; state=16
Jul 23 16:01:16 [22780] DBG:core:parse_via: end of header reached, state=5
Jul 23 16:01:16 [22780] DBG:core:parse_headers: via found, flags=2
Jul 23 16:01:16 [22780] DBG:core:parse_headers: this is the first via
Jul 23 16:01:16 [22780] DBG:core:receive_msg: After parse_msg...
Jul 23 16:01:16 [22780] DBG:core:receive_msg: preparing to run routing
scripts...
[Script Trace][/etc/opensips/opensips.cfg:176][me][core if] - (BYE from
10.10.16.2, ruri=sip:10.10.16.2;did=dbf.d239f4f3)
[Script Trace][/etc/opensips/opensips.cfg:171][me][module
mf_process_maxfwd_header] - (BYE from 10.10.16.2,
ruri=sip:10.10.16.2;did=dbf.d239f4f3)
Jul 23 16:01:16 [22780] DBG:core:parse_headers: flags=100
Jul 23 16:01:16 [22780] DBG:core:parse_via_param: found param type 232,
branch = z9hG4bK2ff9.7dfac551.0; state=16
Jul 23 16:01:16 [22780] DBG:core:parse_via: end of header reached, state=5
Jul 23 16:01:16 [22780] DBG:core:parse_headers: via found, flags=100
Jul 23 16:01:16 [22780] DBG:core:parse_headers: parse_headers: this is
the second via
Jul 23 16:01:16 [22780] DBG:core:parse_via_param: found param type 232,
branch = z9hG4bK53eneb00a89gqfc5m0o0.1; state=16
Jul 23 16:01:16 [22780] DBG:core:parse_via: end of header reached, state=5
Jul 23 16:01:16 [22780] DBG:core:parse_headers: via found, flags=100
Jul 23 16:01:16 [22780] DBG:core:parse_to_param: tag=6pou4pvn6xe2phuk.i
Jul 23 16:01:16 [22780] DBG:core:parse_to: end of header reached, state=29
Jul 23 16:01:16 [22780] DBG:core:parse_to: display={},
ruri={sip:27111000626@10.10.16.1:5060;user=phone}
Jul 23 16:01:16 [22780] DBG:core:get_hdr_field: To [70];
uri=[sip:27111000626@10.10.16.1:5060;user=phone]
Jul 23 16:01:16 [22780] DBG:core:get_hdr_field: to body
[sip:27111000626@10.10.16.1:5060;user=phone]
Jul 23 16:01:16 [22780] DBG:core:get_hdr_field: cseq CSeq: 2 BYE
Jul 23 16:01:16 [22780] DBG:maxfwd:is_maxfwd_present: value = 65
[Script Trace][/etc/opensips/opensips.cfg:185][me][core if] - (BYE from
10.10.16.2, ruri=sip:10.10.16.2;did=dbf.d239f4f3)
[Script Trace][/etc/opensips/opensips.cfg:176][me][module
check_source_address] - (BYE from 10.10.16.2,
ruri=sip:10.10.16.2;did=dbf.d239f4f3)
Jul 23 16:01:16 [22780] DBG:permissions:check_src_addr_3: Looking for :
1, 10.10.16.2, 5060, 1 in tables
Jul 23 16:01:16 [22780] DBG:permissions:hash_match: no match in the hash
table
Jul 23 16:01:16 [22780] DBG:permissions:match_subnet_table: subnet table
is empty
[Script Trace][/etc/opensips/opensips.cfg:185][me][core if] - (BYE from
10.10.16.2, ruri=sip:10.10.16.2;did=dbf.d239f4f3)
[Script Trace][/etc/opensips/opensips.cfg:179][me][module is_from_gw] -
(BYE from 10.10.16.2, ruri=sip:10.10.16.2;did=dbf.d239f4f3)
[Script Trace][/etc/opensips/opensips.cfg:183][me][core xlog] - (BYE
from 10.10.16.2, ruri=sip:10.10.16.2;did=dbf.d239f4f3)
Message is not from Trunk or GW 10.10.16.2[Script
Trace][/etc/opensips/opensips.cfg:248][me][core if] - (BYE from
10.10.16.2, ruri=sip:10.10.16.2;did=dbf.d239f4f3)


Regards
Trevor Steyn


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


Re: [OpenSIPS-Users] changing $rU number

2015-07-23 Thread Trevor Steyn
Documentation can be found here

http://www.opensips.org/html/docs/modules/1.10.x/dialplan.html

For egsample to remove all - characters in $rU do the following

Add the following into the dialplan table

mysql select * from dialplan\G;
*** 1. row ***
 id: 6
   dpid: 1
 pr: 98
   match_op: 0
  match_exp: -
match_flags: 0
  subst_exp:
   repl_exp:
timerec:
   disabled: 0
  attrs:
*** 2. row ***


Then call dp_translate(1,$rU/$rU); in your script.

Regards
Trevor Steyn


On 23/07/2015 10:51, dpa wrote:

 And how dialplan helps me to do it, if ,for example, one time I have
 such characters 8%2089-0987-09, and in another time I have 987-89%20908-1?

  

 *From:*users-boun...@lists.opensips.org
 [mailto:users-boun...@lists.opensips.org] *On Behalf Of *Trevor Steyn
 *Sent:* Thursday, July 23, 2015 11:27 AM
 *To:* users@lists.opensips.org
 *Subject:* Re: [OpenSIPS-Users] changing $rU number

  

 Hi Denis

 You can use the dialplan module to rewrite variables as below

 dp_translate(1,$rU/$rU);

 Then insert you regexp into the dialplan tables, read the dialplan
 module documentation for more info.

 Regards
 Trevor

 On 23/07/2015 09:49, dpa wrote:

 Thank you.

 But what can I use for do it?

  

 *From:*users-boun...@lists.opensips.org
 mailto:users-boun...@lists.opensips.org
 [mailto:users-boun...@lists.opensips.org] *On Behalf Of *Schneur
 Rosenberg
 *Sent:* Thursday, July 23, 2015 10:40 AM
 *To:* OpenSIPS users mailling list
 *Subject:* Re: [OpenSIPS-Users] changing $rU number

  

 $rU is read/write so you can use regexp and just rewrite the variable

  

 On Thu, Jul 23, 2015 at 10:33 AM, dpa denis7...@mail.ru
 mailto:denis7...@mail.ru wrote:

 Hello!

  

 Opensips 1.10.

  

 I am using DROUTING module from making routing.

 But some SIP UA sends to Opensips tel. number with  some
 unnecessary characters, such as “%20” and “-”.

  

 The question is how can I delete these characters from request user?

  

 Thank you for any help.

  

  

  


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

  




 ___

 Users mailing list

 Users@lists.opensips.org mailto: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] RTP Delay when changing RTP Source port

2015-07-23 Thread Trevor Steyn
HI Rik,

I removed the all flags and it worked i got audio straight away i then
re-added flags one by one to find the culprit seems the 
re-packetization was the issue when i add z20 there is that delay in
audio,

The debugs dont show much see below

The issue is i really need RTP going to UAS to be at 20ms payload due to
a vendor restriction, at least know i know where to look at i will dig
into the re-packetization flag to see if i can learn more on why it
would do this
if you have any ideas please let me know.



DBUG:get_command: received command 16653_6 UIEZ20c18,4,8,100,118
SDurfbb02-1ceee8fa17f07cf66cdcc9b4c851f49c-ctvvfv3 UAC_IP 53266
SDurfbb02-55B0B333-1D600C7-0ADE2C1B;1
INFO:handle_command: new session
SDurfbb02-1ceee8fa17f07cf66cdcc9b4c851f49c-ctvvfv3, tag
SDurfbb02-55B0B333-1D600C7-0ADE2C1B;1 requested, type strong
INFO:handle_command: new session on a port 57596 created, tag
SDurfbb02-55B0B333-1D600C7-0ADE2C1B;1
INFO:handle_command: pre-filling caller's address with 10.10.16.34:53266
INFO:handle_command: RTP packets from caller will be resized to 20
milliseconds
DBUG:doreply: sending reply 16653_6 57596 EXT_IP

DBUG:get_command: received command 16663_8 LEIZ20c18
SDurfbb02-1ceee8fa17f07cf66cdcc9b4c851f49c-ctvvfv3 UAS_IP 54274
SDurfbb02-55B0B333-1D600C7-0ADE2C1B;1 g56jcvtppqn2wxef.i;1
INFO:handle_command: lookup on ports 57596/33858, session timer restarted
INFO:handle_command: pre-filling callee's address with 196.2.126.52:54274
INFO:handle_command: RTP packets from callee will be resized to 20
milliseconds
DBUG:doreply: sending reply 16663_8 33858 INT_IP

DBUG:get_command: received command 16660_5 LEIZ20c18,100
SDurfbb02-1ceee8fa17f07cf66cdcc9b4c851f49c-ctvvfv3 UAS_IP 53680
SDurfbb02-55B0B333-1D600C7-0ADE2C1B;1 g56jcvtppqn2wxef.i;1
INFO:handle_command: lookup on ports 57596/33858, session timer restarted
INFO:handle_command: pre-filling callee's address with 196.2.126.52:53680
INFO:handle_command: RTP packets from callee will be resized to 20
milliseconds
DBUG:doreply: sending reply 16660_5 33858 INT_IP

DBUG:get_command: received command 16663_9 LEIZ20c18,8,100
SDurfbb02-1ceee8fa17f07cf66cdcc9b4c851f49c-ctvvfv3 UAS_IP 36606
SDurfbb02-55B0B333-1D600C7-0ADE2C1B;1 g56jcvtppqn2wxef.i;1
INFO:handle_command: lookup on ports 57596/33858, session timer restarted
INFO:handle_command: pre-filling callee's address with 196.2.126.52:36606
INFO:handle_command: RTP packets from callee will be resized to 20
milliseconds
DBUG:doreply: sending reply 16663_9 33858 INT_IP

DBUG:get_command: received command 16658_5 D
SDurfbb02-1ceee8fa17f07cf66cdcc9b4c851f49c-ctvvfv3
SDurfbb02-55B0B333-1D600C7-0ADE2C1B g56jcvtppqn2wxef.i
INFO:handle_delete: forcefully deleting session 1 on ports 57596/33858
INFO:remove_session: RTP stats: 991 in from callee, 388 in from caller,
1781 relayed, 0 dropped
INFO:remove_session: RTCP stats: 2 in from callee, 5 in from caller, 7
relayed, 0 dropped
INFO:remove_session: session on ports 57596/33858 is cleaned up
DBUG:doreply: sending reply 16658_5 0


Regards
Trevor Steyn

On 23/07/2015 10:28, Rik Broers wrote:
 Try it with only the ie flags, wz20 only adds more complexity in 
 troubleshooting.
 What do the rtpproxy logs tell you? 


 -Oorspronkelijk bericht-
 Van: users-boun...@lists.opensips.org 
 [mailto:users-boun...@lists.opensips.org] Namens Trevor Steyn
 Verzonden: woensdag 22 juli 2015 21:04
 Aan: users@lists.opensips.org
 Onderwerp: Re: [OpenSIPS-Users] RTP Delay when changing RTP Source port

 Hi Rik

 I have tried using rtpproxy_offer/answer functions with the same results,

 if (has_body(application/sdp)) {
 if (rtpproxy_offer('iewz20')) {
 t_on_reply(1);
 } else {
 t_on_reply(2);
 }
 }

 t_on_failure(GW_FAILOVER);
 route(RELAY);
 }

 onreply_route[1]
 {
 if (has_body(application/sdp))
 rtpproxy_answer('eiwz20');
 }

 onreply_route[2]
 {
 if (has_body(application/sdp))
 rtpproxy_offer('iewz20');
 }

 below you can see that Signalling and RTP flows.

 You will see rtpproxy only starts relaying packets ~10seconds later after the 
 200OK even though Callee is sending RTP

 http://salamander.iburst.co.za:8000/personal/signalling.txt

 Seems the issue here is when RTP stream is already established (183 with
 SDP) and the 200OK comes along with different source port it takes some time 
 before RTP proxy relays the packets to caller.

 Regards
 Trevor

 On 22/07/2015 13:30, Rik Broers wrote:
 I think rtpproxy_engage doesnt work correct with the fact that you bridge 
 internal to external. Also says in docs:
 ... Note that when used in bridge mode, this function might advertise wrong 
 interfaces in SDP (due to the fact that OpenSIPS is not aware of the 
 RTPProxy configuration), so you might face an undefined behavior.

 You could try and use the rtpproxy_offer and answer functions. put in the 
 reply route an if (has_body

Re: [OpenSIPS-Users] changing $rU number

2015-07-23 Thread Trevor Steyn
Hi Denis

You can use the dialplan module to rewrite variables as below

dp_translate(1,$rU/$rU);

Then insert you regexp into the dialplan tables, read the dialplan
module documentation for more info.

Regards
Trevor

On 23/07/2015 09:49, dpa wrote:

 Thank you.

 But what can I use for do it?

  

 *From:*users-boun...@lists.opensips.org
 [mailto:users-boun...@lists.opensips.org] *On Behalf Of *Schneur Rosenberg
 *Sent:* Thursday, July 23, 2015 10:40 AM
 *To:* OpenSIPS users mailling list
 *Subject:* Re: [OpenSIPS-Users] changing $rU number

  

 $rU is read/write so you can use regexp and just rewrite the variable

  

 On Thu, Jul 23, 2015 at 10:33 AM, dpa denis7...@mail.ru
 mailto:denis7...@mail.ru wrote:

 Hello!

  

 Opensips 1.10.

  

 I am using DROUTING module from making routing.

 But some SIP UA sends to Opensips tel. number with  some unnecessary
 characters, such as “%20” and “-”.

  

 The question is how can I delete these characters from request user?

  

 Thank you for any help.

  

  

  


 ___
 Users mailing list
 Users@lists.opensips.org mailto: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] RTP Delay when changing RTP Source port

2015-07-22 Thread Trevor Steyn
Hi Rik

I have tried using rtpproxy_offer/answer functions with the same results,

if (has_body(application/sdp)) {
if (rtpproxy_offer('iewz20')) {
t_on_reply(1);
} else {
t_on_reply(2);
}
}

t_on_failure(GW_FAILOVER);
route(RELAY);
}

onreply_route[1]
{
if (has_body(application/sdp))
rtpproxy_answer('eiwz20');
}

onreply_route[2]
{
if (has_body(application/sdp))
rtpproxy_offer('iewz20');
}

below you can see that Signalling and RTP flows.

You will see rtpproxy only starts relaying packets ~10seconds later
after the 200OK even though Callee is sending RTP

http://salamander.iburst.co.za:8000/personal/signalling.txt

Seems the issue here is when RTP stream is already established (183 with
SDP) and the 200OK comes along with different source port it takes some
time before RTP proxy relays the packets to caller.

Regards
Trevor

On 22/07/2015 13:30, Rik Broers wrote:
 I think rtpproxy_engage doesnt work correct with the fact that you bridge 
 internal to external. Also says in docs:
 ... Note that when used in bridge mode, this function might advertise wrong 
 interfaces in SDP (due to the fact that OpenSIPS is not aware of the RTPProxy 
 configuration), so you might face an undefined behavior.

 You could try and use the rtpproxy_offer and answer functions. put in the 
 reply route an if (has_body(application/sdp)) to also catch the 183 with 
 sdp .The docs have examples on how to use them and how to trigger on reply 
 routes.

 Regards,
 Rik

 -Oorspronkelijk bericht-
 Van: users-boun...@lists.opensips.org 
 [mailto:users-boun...@lists.opensips.org] Namens Trevor Steyn
 Verzonden: woensdag 22 juli 2015 9:52
 Aan: users@lists.opensips.org
 Onderwerp: [OpenSIPS-Users] RTP Delay when changing RTP Source port

 Hi, All

 Still quite new to opensips I have the following configuration running on

 version: opensips 2.1.0 (x86_64/linux)
 flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, F_MALLOC, 
 FAST_LOCK-ADAPTIVE_WAIT ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 
 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535 poll method support: 
 poll, epoll_lt, epoll_et, sigio_rt, select.
 main.c compiled on 06:22:03 May  8 2015 with gcc 4.4.7


 (Topology Hiding)
 UAC --- Opensips(Internal)Opensips(External)  UAS
(RTP PROXY BRIDGE)



 what i am experiencing is the following call is setup between UAC and UAS 
 through opensips UAS sets up RTP with a 183 Session Progress message with SDP 
 Shortly after we get a 180 ringing (i understand this is not correct but 
 cannot be changed), When a 200OK is eventually sent the Source Port is 
 different to what was in the SDP on the 183 message.

 Media starts flowing from UAS to opensips External from the new source port 
 but for the first 7 seconds or so opensips/rtpproxy does not pass on this 
 media to UAC from Internal.

 I run rtp proxy as follows

 rtpproxy -l Internal IP/External IP -s udp:127.0.0.1:12221 -m 25000 -M 
 65000 -F -d DBUG:LOCAL1

 route{
 #script_trace( 3, $rm from $si, ruri=$ru, me);

 if (!mf_process_maxfwd_header(10)) {
 sl_send_reply(483,Too Many Hops);
 exit;
 }

 if ( check_source_address(1,$avp(trunk_attrs)) ) {
 # request comes from trunks
 setflag(IS_TRUNK);
 } else if ( is_from_gw() ) {
 # request comes from GWs
 } else {
 send_reply(403,Forbidden);
 exit;
 }

 if (has_totag()) {
 # sequential request withing a dialog should
 # take the path determined by record-routing
 if(topology_hiding_match()) {
 # validate the sequential request against dialog
 if ( $DLG_status!=NULL  !validate_dialog() ) {
 xlog(In-Dialog $rm from $si (callid=$ci) is not valid 
 according to dialog\n);
 ## exit;
 }

 if (is_method(BYE)) {
 setflag(ACC_DO); # do accounting ...
 setflag(ACC_FAILED); # ... even if the transaction fails
 } else if (is_method(INVITE)) {
 # even if in most of the cases is useless, do RR for
 # re-INVITEs alos, as some buggy clients do change route set
 # during the dialog.
 record_route();
 }
 route(RELAY);
 } else {
 if ( is_method(ACK) ) {
 if ( t_check_trans() ) {
 # non loose-route, but stateful ACK; must be an ACK after
 # a 487 or e.g. 404 from upstream server
 t_relay();
 exit;
 } else {
 # ACK without matching transaction -
 # ignore and discard

[OpenSIPS-Users] RTP Delay when changing RTP Source port

2015-07-22 Thread Trevor Steyn
);
t_relay();
exit;
}
   
send_reply(500,All GW are down);
}
}


local_route {
if (is_method(BYE)  $DLG_dir==UPSTREAM) {
   
acc_log_request(200 Dialog Timeout);
   
}
}


Below you can see the call flow

http://salamander.iburst.co.za:8000/personal/signalling.txt

I have tried a most of the options on rtpproxy_engage with no luck

Regards
Trevor Steyn


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