No subject


Thu Mar 26 14:29:42 CET 2015


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>;tag=1c393411873
To: <sip:5001 at 210.200.100.100;user=phone>;tag=gK08c71cc5
Call-ID: 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>
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>;tag=1c393411873
To: <sip:5001 at 210.200.100.100;user=phone>;tag=gK08c71cc5
Call-ID: 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>
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

--001a114188125fe8460520f67511
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi,<div><br></div><div>Recently the maintainer of the SIPs=
 proxy in our company quit, and well I&#39;m the new in charge of this proj=
ect, the bad new is I had 0 experience with SIP.=C2=A0 After some week I go=
t my first case related to our &quot;SIP proxy&quot;.</div><div><br></div><=
div>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 di=
d is working in 99% of cases but this specific case.=C2=A0</div><div><br></=
div><div>The customer has one setup like this</div><div><br></div><div><br>=
</div><div>PhoneA</div><div>PhoneB</div><div>PhoneC --- Call Manager --- Fi=
rewall --- SBC --- Farm of RTP Media servers</div><div>....</div><div>Phone=
N</div><div><br></div><div>The opensips instance is running within the fire=
wall. The next IPs are fake but follow the &quot;rules&quot; of internal/ex=
ternal it is just to avoid problems</div><div><br></div><div>Call Manager: =
172.17.1.1</div><div>Firewall: Internal Network 192.168.0.10</div><div>Fire=
wall: Extenal Network 62.1.1.10</div><div>SBC: 210.200.100.100</div><div>Fa=
rm of Media Servers: <a href=3D"http://210.200.100.128/25">210.200.100.128/=
25</a></div><div><br></div><div>So the invite works as Expected but on the =
180 Ringing either 200 OK the moment the messages traverse the SIP proxy, d=
oesn&#39;t contain the &quot;farm&quot; IP but the SBC IP.</div><div><br></=
div><div>This are the 180 Ringing:</div><div><br></div><div>From SBC to the=
 Firewall</div><div><br></div><div><div>SIP/2.0 180 Ringing</div><div>Via: =
SIP/2.0/UDP=C2=A062.1.1.10:5060;branch=3Dz9hG4bKd091.937a047.0</div><div>Vi=
a: SIP/2.0/UDP=C2=A0172.17.1.1:5060;rport=3D5060;received=3D172.17.1.1;bran=
ch=3Dz9hG4bKac393424402</div><div>From: &lt;<a href=3D"mailto:sip%3A5000 at 21=
0.200.100.100">sip:5000 at 210.200.100.100</a>&gt;;tag=3D1c393411873</div><div=
>To: &lt;<a href=3D"mailto:sip%3A5001 at 210.200.100.100">sip:5001 at 210.200.100=
.100</a>;user=3Dphone&gt;;tag=3DgK08c71cc5</div><div>Call-ID: <a href=3D"ma=
ilto:39341083229920151062 at 172.17.1.1">39341083229920151062 at 172.17.1.1</a></=
div><div>CSeq: 1 INVITE</div><div>Record-Route: &lt;sip:62.1.1.10:5060;r2=
=3Don;lr;did=3D6d8.933abaa6&gt;</div><div>Record-Route: &lt;sip:192.168.0.1=
0:5060;r2=3Don;lr;did=3D6d8.933abaa6&gt;</div><div>Contact: &lt;<a href=3D"=
http://sip:5001@210.200.100.100:5060">sip:5001 at 210.200.100.100:5060</a>&gt;=
</div><div>Allow: INVITE,ACK,CANCEL,BYE,REGISTER,REFER,INFO,SUBSCRIBE,NOTIF=
Y,PRACK,UPDATE,OPTIONS,MESSAGE,PUBLISH</div><div>Require: 100rel</div><div>=
RSeq: 433990</div><div>Content-Length: =C2=A0 266</div><div>Content-Disposi=
tion: session; handling=3Drequired</div><div>Content-Type: application/sdp<=
/div><div><br></div><div>v=3D0</div><div>o=3DSonus_UAC 176482 50736 IN IP4 =
210.200.100.100</div><div>s=3DSIP Media Capabilities</div><div>c=3DIN IP4 2=
10.200.100.243</div><div>t=3D0 0</div><div>m=3Daudio 61348 RTP/AVP 8 101</d=
iv><div>a=3Drtpmap:8 PCMA/8000</div><div>a=3Drtpmap:101 telephone-event/800=
0</div><div>a=3Dfmtp:101 0-15</div><div>a=3Dsendrecv</div><div>a=3Dptime:20=
</div><div>a=3DsilenceSupp:off - - - -</div></div><div><br></div><div>After=
 the firewall + Opensips have processed this message to the call center</di=
v><div><br></div><div><div>SIP/2.0 180 Ringing</div><div>Via: SIP/2.0/UDP=
=C2=A0172.17.1.1:5060;branch=3Dz9hG4bKac393424402</div><div>From: &lt;<a hr=
ef=3D"mailto:sip%3A5000 at 210.200.100.100">sip:5000 at 210.200.100.100</a>&gt;;t=
ag=3D1c393411873</div><div>To: &lt;<a href=3D"mailto:sip%3A5001 at 210.200.100=
.100">sip:5001 at 210.200.100.100</a>;user=3Dphone&gt;;tag=3DgK08c71cc5</div><=
div>Call-ID: <a href=3D"mailto:39341083229920151062 at 172.17.1.1">39341083229=
920151062 at 172.17.1.1</a></div><div>CSeq: 1 INVITE</div><div>Record-Route: &=
lt;sip::62.1.1.10:5060;r2=3Don;lr;did=3D6d8.933abaa6&gt;</div><div>Record-R=
oute: &lt;sip:192.168.0.10:5060;r2=3Don;lr;did=3D6d8.933abaa6&gt;</div><div=
>Contact: &lt;<a href=3D"mailto:sip%3A5001 at 210.200.100.100">sip:5001 at 210.20=
0.100.100</a>&gt;</div><div>Allow: INVITE,ACK,CANCEL,BYE,REGISTER,REFER,INF=
O,SUBSCRIBE,NOTIFY,PRACK,UPDATE,OPTIONS,MESSAGE,PUBLISH</div><div>Require: =
100rel</div><div>RSeq: 433990</div><div>Content-Length: 295</div><div>Conte=
nt-Disposition: session; handling=3Drequired</div><div>Content-Type: applic=
ation/sdp</div><div><br></div><div>v=3D0</div><div>o=3DSonus_UAC 176482 507=
36 IN IP4 210.200.100.100</div><div>s=3DSIP Media Capabilities</div><div>t=
=3D0 0</div><div>m=3Daudio 4845 RTP/AVP 8 101</div><div>a=3Drtpmap:8 PCMA/8=
000</div><div>a=3Drtpmap:101 telephone-event/8000</div><div>a=3Dfmtp:101 0-=
15</div><div>a=3Dsendrecv</div><div>a=3Dptime:20</div><div>a=3DsilenceSupp:=
off - - - -</div><div>a=3Dnortpproxy:yes</div><div>c=3DIN IP4 210.200.100.1=
00</div><div>a=3Drtcp:4848</div></div><div><br></div><div>----</div><div><b=
r></div><div>The RTP &quot;acceptor&quot; is created under the IP 210.200.1=
00.100 instead of the IP 210.200.243 as the SIPproxy is changing the SDP co=
nnection information.</div><div><br></div><div><br></div><div>This is the l=
ogic we are using in our script for the INVITE and for the onreply_route</d=
iv><div><br></div><div><div><span style=3D"white-space:pre">	</span>if (is_=
method(&quot;INVITE&quot;)){</div><div><span class=3D"" style=3D"white-spac=
e:pre">		</span>if (has_body(&quot;application/sdp&quot;)) {</div><div><spa=
n class=3D"" style=3D"white-space:pre">			</span>$var(trustconnectionip) =
=3D &quot;%TRUSTCONNECTIONIP%&quot;;</div><div><span class=3D"" style=3D"wh=
ite-space:pre">			</span>$var(ciptrusted) =3D &quot;no&quot;;</div><div><sp=
an class=3D"" style=3D"white-space:pre">			</span>if ($var(trustconnectioni=
p)=3D=3D&quot;yes&quot;) {</div><div><span class=3D"" style=3D"white-space:=
pre">				</span>$var(ciptrusted) =3D &quot;yes&quot;;</div><div><span class=
=3D"" style=3D"white-space:pre">			</span>} else if ($var(trustconnectionip=
)=3D=3D&quot;auto&quot;) {</div><div><span class=3D"" style=3D"white-space:=
pre">				</span>$var(sdpc) =3D $(rb{sdp.line,c}{s.substr,9,0});</div><div><=
span class=3D"" style=3D"white-space:pre">				</span>if($td =3D=3D $fd &amp=
;&amp; $td !=3D $var(sdpc)) {</div><div><span class=3D"" style=3D"white-spa=
ce:pre">					</span>$var(ciptrusted) =3D &quot;yes&quot;;</div><div><span c=
lass=3D"" style=3D"white-space:pre">				</span>}</div><div><span class=3D""=
 style=3D"white-space:pre">			</span>}</div><div><span class=3D"" style=3D"=
white-space:pre">			</span>if ($var(ciptrusted)=3D=3D&quot;yes&quot;) {</di=
v><div><span class=3D"" style=3D"white-space:pre">				</span>rtpproxy_offer=
(&quot;focnr&quot;);</div><div><span class=3D"" style=3D"white-space:pre">	=
		</span>} else {</div><div><span class=3D"" style=3D"white-space:pre">				=
</span>rtpproxy_offer(&quot;focn&quot;);</div><div><span class=3D"" style=
=3D"white-space:pre">			</span>}</div><div><span class=3D"" style=3D"white-=
space:pre">		</span>}</div></div><div><span style=3D"white-space:pre">	}</s=
pan><br></div><div><span style=3D"white-space:pre"><br></span></div><div><s=
pan style=3D"white-space:pre"><br></span></div><div><span style=3D"white-sp=
ace:pre"><br></span></div><div><span style=3D"white-space:pre">And on the o=
nreply</span></div><div><span style=3D"white-space:pre"><br></span></div><d=
iv><span style=3D"white-space:pre">	</span><span style=3D"white-space:pre">=
if (has_body(&quot;application/sdp&quot;)) {
		$var(trustconnectionip) =3D &quot;%TRUSTCONNECTIONIP%&quot;;
		$var(ciptrusted) =3D &quot;no&quot;;
		if ($var(trustconnectionip)=3D=3D&quot;yes&quot;) {
			$var(ciptrusted) =3D &quot;yes&quot;;
		} else if ($var(trustconnectionip)=3D=3D&quot;auto&quot;) {
			$var(sdpc) =3D $(rb{sdp.line,c}{s.substr,9,0});
			if($td =3D=3D $fd &amp;&amp; $td !=3D $var(sdpc)) {
				$var(ciptrusted) =3D &quot;yes&quot;;
			}
		}
		if ($var(ciptrusted)=3D=3D&quot;yes&quot;) {
			rtpproxy_answer(&quot;fr&quot;);
		} else {
			rtpproxy_answer(&quot;f&quot;);
		}
	}</span><br></div><div><br></div><div><br></div><div>Where TRUSTONNECTIONI=
P =3D &quot;no&quot; so basically we are doing</div><div><br></div><div>rpt=
proxy_offer(&quot;focn&quot;) and rtpproxy_answer(&quot;f&quot;).</div><div=
><br></div><div>Kind regards:</div><div><br></div><div>Jose Palma</div><div=
><br></div><div><br></div></div>

--001a114188125fe8460520f67511--



More information about the Users mailing list