[OpenSIPS-Users] Opensips + rtpproxy + SBC

Trevor Steyn trevor at webon.co.za
Wed Sep 30 16:51:17 CEST 2015


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 at 210.200.100.100
> <mailto:sip%3A5000 at 210.200.100.100>>;tag=1c393411873
> To: <sip:5001 at 210.200.100.100
> <mailto:sip%3A5001 at 210.200.100.100>;user=phone>;tag=gK08c71cc5
> Call-ID: 39341083229920151062 at 172.17.1.1
> <mailto:39341083229920151062 at 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 at 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 at 210.200.100.100
> <mailto:sip%3A5000 at 210.200.100.100>>;tag=1c393411873
> To: <sip:5001 at 210.200.100.100
> <mailto:sip%3A5001 at 210.200.100.100>;user=phone>;tag=gK08c71cc5
> Call-ID: 39341083229920151062 at 172.17.1.1
> <mailto:39341083229920151062 at 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 at 210.200.100.100 <mailto:sip%3A5001 at 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("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");
> }
> }
> }
>
>
>
> And on the onreply
>
> 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_answer("fr"); } else { rtpproxy_answer("f"); } }
>
>
> Where TRUSTONNECTIONIP = "no" so basically we are doing
>
> rptproxy_offer("focn") and rtpproxy_answer("f").
>
> Kind regards:
>
> Jose Palma
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20150930/7b33e4d4/attachment.htm>


More information about the Users mailing list