<div>Hi, I am in a predicament and would appreciate any help. I have the following setup:</div>
<div> </div>
<div>asterisk&lt;--- UDP---&gt; OPENSIPS &lt;--- TCP ---&gt; PSTNGW</div>
<div> </div>
<div>asterisk is sending SIP packets via UDP which then OPENSIPS forwards via TCP to the PSTNGW</div>
<div> </div>
<div>All calls are initiated by asterisk and all works well EXCEPT <u>for the scenaio when PSTNGW sends a BYE</u>. In that case I get the following error on OPENSIPS</div>
<div> </div>
<div>Send failed (477/TM). </div>
<div> </div>
<div>If asterisk sends a BYE, no issues.</div>
<div> </div>
<div>Opensips is listening on both TCP and UDP. Here is call trace for one complete call in which a BYE is received from the PSTNGW and OPENSIPS says &quot;Send failed&quot;.</div>
<div> </div>
<div>The only thing that I can notice is that the &quot;Via&quot; Field in the BYE initiated by the PSTNGW has a private IP address (10.100.1.189). Could this cause a problem?</div>
<div> </div>
<div> </div>
<div>Thanks</div>
<div> </div>
<div>----</div>
<div>U asterisk_IP:5060 -&gt; opensips_IP:5060<br>  INVITE sip:XXXX448938@opensips_IP SIP/2.0..Via: SIP/2.0/UDP asterisk_IP:5060;<br>  branch=z9hG4bK1f043581;rport..Max-Forwards: 70..From: &quot;YYYYY91007&quot; &lt;<br>
  sip:YYYYY91007@asterisk_IP&gt;;tag=as093bdd40..To: &lt;sip:XXXX448938@opensipsIP<br>&gt;..Contact: &lt;sip:YYYYY91007@asterisk_IP&gt;..Call-ID: 7d78872708ef61a72<br>  <a href="mailto:218b99a23ccf335@asterisk_IP..CSeq">218b99a23ccf335@asterisk_IP..CSeq</a>: 102 INVITE..User-Agent: B2B..Remote-Pa<br>
  rty-ID: &quot;YYYYY91007&quot; &lt;sip:YYYYY91007@asterisk_IP&gt;;privacy=off;screen=no..<br>  Date: Wed, 11 Mar 2009 13:13:59 GMT..Allow: INVITE, ACK, CANCEL, OPTIONS, B<br>  YE, REFER, SUBSCRIBE, NOTIFY..Supported: replaces, timer..Content-Type: app<br>
  lication/sdp..Content-Length: 244....v=0..o=root 1936846470 1936846470 IN I<br>  P4 asterisk_IP..s=B2B..c=IN IP4 asterisk_IP..t=0 0..m=audio 59442 RTP/A<br>  VP 18 101..a=rtpmap:18 G729/8000..a=fmtp:18 annexb=no..a=rtpm</div>

<div> </div>
<div>U opensips_IP:5060 -&gt; asterisk_IP:5060<br>  SIP/2.0 100 Giving a try..Via: SIP/2.0/UDP asterisk_IP:5060;branch=z9hG4b<br>  K1f043581;rport=5060..From: &quot;YYYYY91007&quot; &lt;sip:YYYYY91007@asterisk_IP&gt;;tag<br>
  =as093bdd40..To: &lt;sip:XXXX448938@opensips_IP&gt;..Call-ID: 7d78872708ef61a7<br>  <a href="mailto:2218b99a23ccf335@asterisk_IP..CSeq">2218b99a23ccf335@asterisk_IP..CSeq</a>: 102 INVITE..Server: OpenSIPS (1.4.2-n<br>  otls (i386/linux))..Content-Length: 0..Warning: 392 opensips_IP:5060 &quot;Noi<br>
  sy feedback tells:  pid=1823 req_src_ip=asterisk_IP req_src_port=5060 in_<br>  uri=sip:XXXX448938@opensips_IP out_uri=sip:XXXX448938@PSTNGW_IP:506<br>  0;transport=tcp via_cnt==1&quot;....</div>
<div>T opensips_IP:60719 -&gt; PSTNGW_IP:5060 [AP]<br>  INVITE sip:XXXX448938@PSTNGW_IP:5060;transport=tcp SIP/2.0..Record-Rou<br>  te: &lt;sip:opensips_IP;transport=tcp;r2=on;lr=on&gt;..Record-Route: &lt;sip:opensips_IP<br>
  ;r2=on;lr=on&gt;..Via: SIP/2.0/TCP opensips_IP;branch=z9hG4bK95f6.df<br>  741935.0..Via: SIP/2.0/UDP asterisk_IP:5060;received=asterisk_IP;branch<br>  =z9hG4bK1f043581;rport=5060..Max-Forwards: 69..From: &quot;YYYYY91007&quot; &lt;sip:3184<br>
  <a href="mailto:491007@asterisk_IP%3E;tag=as093bdd40..To">491007@asterisk_IP&gt;;tag=as093bdd40..To</a>: &lt;sip:XXXX448938@opensips_IP&gt;..<br>  Contact: &lt;sip:YYYYY91007@asterisk_IP&gt;..Call-ID: 7d78872708ef61a72218b99a2<br>
  <a href="mailto:3ccf335@asterisk_IP..CSeq">3ccf335@asterisk_IP..CSeq</a>: 102 INVITE..User-Agent: B2B..Remote-Party-ID:<br>  &quot;YYYYY91007&quot; &lt;sip:YYYYY91007@asterisk_IP&gt;;privacy=off;screen=no..Date: We<br>  d, 11 Mar 2009 13:13:59 GMT..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFE<br>
  R, SUBSCRIBE, NOTIFY..Supported: replaces, timer..Content-Type: application<br>  /sdp..Content-Length: 244....v=0..o=root 1936846470 1936846470 IN IP4 asterisk_IP<br>  1.50...s=B2B..c=IN IP4 asterisk_IP..t=0 0..m=audio 59442 RTP/AVP 18 10<br>
  1..a=rtpmap:18 G729/8000..a=fmtp:18 annexb=no..a=rtpmap:101 telephone-event<br>  /8000..a=fmtp:101 0-16..a=ptime:20..a=sendrecv..</div>
<div> </div>
<div>T PSTNGW_IP:5060 -&gt; opensips_IP:60719 [AP]<br>  SIP/2.0 180 Ringing..From: &quot;YYYYY91007&quot;&lt;sip:YYYYY91007@asterisk_IP&gt;;tag=a<br>  s093bdd40..To: &lt;sip:XXXX448938@opensips_IP&gt;;tag=8841060-0-13c4-50022-39f<br>
  2d-441b0d06-39f2d..Call-ID: <a href="mailto:7d78872708ef61a72218b99a23ccf335@asterisk_IP">7d78872708ef61a72218b99a23ccf335@asterisk_IP</a>.<br>  .CSeq: 102 INVITE..Via: SIP/2.0/TCP opensips_IP;branch=z9hG4bK95f6.df7419<br>
  35.0..Via: SIP/2.0/UDP asterisk_IP:5060;received=asterisk_IP;rport=5060<br>  ;branch=z9hG4bK1f043581..Supported: replaces..Record-Route: &lt;sip:opensipsIP<br>  ;transport=tcp;lr=on;r2=on&gt;..Record-Route: &lt;sip:opensips_IP;lr=on;r2=o<br>
  n&gt;..Contact: &lt;sip:XXXX448938@PSTNGW_IP:5060;transport=tcp&gt;..Allow: INV<br>  ITE, CANCEL, ACK, BYE, OPTIONS, REFER, NOTIFY..Content-Type: application/sd<br>  p..Content-Length: 263....v=0..o=Intel_IPCCLib 143379592 143379593 IN IP4 ptngw_IP<br>
..s=Intel_SIP_CCLIB..c=IN IP4 PSTNGW_IP..t=0 0..m=audio 493<br>  42 RTP/AVP 18 101..a=rtpmap:18 G729/8000..a=fmtp:18 annexb=no..a=ptime:30..<br>  a=sendrecv..a=rtpmap:101 telephone-event/8000..a=fmtp:101 0-15..</div>
<div>U opensips_IP:5060 -&gt; asterisk_IP:5060<br>  SIP/2.0 180 Ringing..From: &quot;YYYYY91007&quot;&lt;sip:YYYYY91007@asterisk_IP&gt;;tag=a<br>  s093bdd40..To: &lt;sip:XXXX448938@opensips_IP&gt;;tag=8841060-0-13c4-50022-39f<br>
  2d-441b0d06-39f2d..Call-ID: <a href="mailto:7d78872708ef61a72218b99a23ccf335@asterisk_IP">7d78872708ef61a72218b99a23ccf335@asterisk_IP</a>.<br>  .CSeq: 102 INVITE..Via: SIP/2.0/UDP asterisk_IP:5060;received=asterisk_IP1.50.1<br>
  90;rport=5060;branch=z9hG4bK1f043581..Supported: replaces..Record-Route: &lt;s<br>  ip:opensips_IP;transport=tcp;lr=on;r2=on&gt;..Record-Route: &lt;sip:asterisk_IP1.50.1<br>  79;lr=on;r2=on&gt;..Contact: &lt;sip:XXXX448938@PSTNGW_IP:5060;transport=tcp<br>
  &gt;..Allow: INVITE, CANCEL, ACK, BYE, OPTIONS, REFER, NOTIFY..Content-Type: a<br>  pplication/sdp..Content-Length: 263....v=0..o=Intel_IPCCLib 143379592 14337<br>  9593 IN IP4 PSTNGW_IP..s=Intel_SIP_CCLIB..c=IN IP4 PSTNGW_IP..t=0 0<br>
  ..m=audio 49342 RTP/AVP 18 101..a=rtpmap:18 G729/8000..a=fmtp:18 annexb=no.<br>  .a=ptime:30..a=sendrecv..a=rtpmap:101 telephone-event/8000..a=fmtp:101 0-15<br>  ..</div>
<div>T PSTNGW_IP:5060 -&gt; opensips_IP:60719 [AP]<br>  SIP/2.0 200 OK..From: &quot;YYYYY91007&quot;&lt;sip:YYYYY91007@asterisk_IP&gt;;tag=as093b<br>  dd40..To: &lt;sip:XXXX448938@opensips_IP&gt;;tag=8841060-0-13c4-50022-39f2d-44<br>
  1b0d06-39f2d..Call-ID: <a href="mailto:7d78872708ef61a72218b99a23ccf335@asterisk_IP..CSeq">7d78872708ef61a72218b99a23ccf335@asterisk_IP..CSeq</a><br>  : 102 INVITE..Via: SIP/2.0/TCP opensips_IP;branch=z9hG4bK95f6.df741935.0.<br>
  .Via: SIP/2.0/UDP asterisk_IP:5060;received=asterisk_IP;rport=5060;bran<br>  ch=z9hG4bK1f043581..Supported: replaces..Record-Route: &lt;sip:opensips_IP;t<br>  ransport=tcp;lr=on;r2=on&gt;..Record-Route: &lt;sip:opensips_IP;lr=on;r2=on&gt;..C<br>
  ontact: &lt;sip:XXXX448938@PSTNGW_IP:5060;transport=tcp&gt;..Allow: INVITE,<br>  CANCEL, ACK, BYE, OPTIONS, REFER, NOTIFY..Content-Type: application/sdp..Co<br>  ntent-Length: 263....v=0..o=Intel_IPCCLib 143379592 143379593 IN IP4 pstngw_IP..<br>
  s=Intel_SIP_CCLIB..c=IN IP4 PSTNGW_IP..t=0 0..m=audio 49342 RT<br>  P/AVP 18 101..a=rtpmap:18 G729/8000..a=fmtp:18 annexb=no..a=ptime:30..a=sen<br>  drecv..a=rtpmap:101 telephone-event/8000..a=fmtp:101 0-15..</div>
<div> </div>
<div> </div>
<div>U opensips_IP:5060 -&gt; asterisk_IP:5060<br>  SIP/2.0 200 OK..From: &quot;YYYYY91007&quot;&lt;sip:YYYYY91007@asterisk_IP&gt;;tag=as093b<br>  dd40..To: &lt;sip:XXXX448938@opensips_IP&gt;;tag=8841060-0-13c4-50022-39f2d-44<br>
  1b0d06-39f2d..Call-ID: <a href="mailto:7d78872708ef61a72218b99a23ccf335@asterisk_IP..CSeq">7d78872708ef61a72218b99a23ccf335@asterisk_IP..CSeq</a><br>  : 102 INVITE..Via: SIP/2.0/UDP asterisk_IP:5060;received=asterisk_IP;rp<br>
  ort=5060;branch=z9hG4bK1f043581..Supported: replaces..Record-Route: &lt;sip:opensipsIP<br>  ;transport=tcp;lr=on;r2=on&gt;..Record-Route: &lt;sip:opensips_IP;lr<br>  =on;r2=on&gt;..Contact: &lt;sip:XXXX448938@PSTNGW_IP:5060;transport=tcp&gt;..Al<br>
  low: INVITE, CANCEL, ACK, BYE, OPTIONS, REFER, NOTIFY..Content-Type: applic<br>  ation/sdp..Content-Length: 263....v=0..o=Intel_IPCCLib 143379592 143379593<br>  IN IP4 PSTNGW_IP..s=Intel_SIP_CCLIB..c=IN IP4 PSTNGW_IP..t=0 0..m=a<br>
  udio 49342 RTP/AVP 18 101..a=rtpmap:18 G729/8000..a=fmtp:18 annexb=no..a=pt<br>  ime:30..a=sendrecv..a=rtpmap:101 telephone-event/8000..a=fmtp:101 0-15..</div>
<div> </div>
<div>U asterisk_IP:5060 -&gt; opensips_IP:5060<br>  ACK sip:XXXX448938@PSTNGW_IP:5060;transport=tcp SIP/2.0..Via: SIP/2.0/<br>  UDP asterisk_IP:5060;branch=z9hG4bK2ba1a834;rport..Route: &lt;sip:opensipsIP<br>;lr=on;r2=on&gt;,&lt;sip:opensips_IP;transport=tcp;lr=on;r2=on&gt;..Max-Forward<br>
  s: 70..From: &quot;YYYYY91007&quot; &lt;sip:YYYYY91007@asterisk_IP&gt;;tag=as093bdd40..To<br>  : &lt;sip:XXXX448938@opensips_IP&gt;;tag=8841060-0-13c4-50022-39f2d-441b0d06-3<br>  9f2d..Contact: &lt;sip:YYYYY91007@asterisk_IP&gt;..Call-ID: 7d78872708ef61a7221<br>
  <a href="mailto:8b99a23ccf335@asterisk_IP..CSeq">8b99a23ccf335@asterisk_IP..CSeq</a>: 102 ACK..User-Agent: B2B..Remote-Party-I<br>  D: &quot;YYYYY91007&quot; &lt;sip:YYYYY91007@asterisk_IP&gt;;privacy=off;screen=no..Conte<br>
  nt-Length: 0....</div>
<div> </div>
<div>T opensips_IP:60719 -&gt; PSTNGW_IP:5060 [AP]<br>  ACK sip:XXXX448938@PSTNGW_IP:5060;transport=tcp SIP/2.0..Via: SIP/2.0/<br>  TCP opensips_IP;branch=z9hG4bK95f6.df741935.2..Via: SIP/2.0/UDP asterisk_IP1.50<br>  .:5060;received=asterisk_IP;branch=z9hG4bK2ba1a834;rport=5060..Max-For<br>
  wards: 69..From: &quot;YYYYY91007&quot; &lt;sip:YYYYY91007@asterisk_IP&gt;;tag=as093bdd40<br>  ..To: &lt;sip:XXXX448938@opensips_IP&gt;;tag=8841060-0-13c4-50022-39f2d-441b0d<br>  06-39f2d..Contact: &lt;sip:YYYYY91007@asterisk_IP&gt;..Call-ID: 7d78872708ef61a<br>
  <a href="mailto:72218b99a23ccf335@asterisk_IP..CSeq">72218b99a23ccf335@asterisk_IP..CSeq</a>: 102 ACK..User-Agent: B2B..Remote-Par<br>  ty-ID: &quot;YYYYY91007&quot; &lt;sip:YYYYY91007@asterisk_IP&gt;;privacy=off;screen=no..C<br>
  ontent-Length: 0....</div>
<div> </div>
<div>T PSTNGW_IP:4126 -&gt; opensips_IP:5060 [AP]<br>  BYE sip:YYYYY91007@asterisk_IP;transport=TCP SIP/2.0..From: &lt;sip:XXXX448<br>  <a href="mailto:938@opensips_IP%3E;tag=8841060-0-13c4-50022-39f2d-441b0d06-39f2d..To">938@opensips_IP&gt;;tag=8841060-0-13c4-50022-39f2d-441b0d06-39f2d..To</a>: &quot;3184<br>
  491007&quot;&lt;sip:YYYYY91007@asterisk_IP&gt;;tag=as093bdd40..Call-ID: 7d78872708ef<br>  <a href="mailto:61a72218b99a23ccf335@asterisk_IP..CSeq">61a72218b99a23ccf335@asterisk_IP..CSeq</a>: 1 BYE..Via: SIP/2.0/TCP 10.100.1.<br>
  189:5060;branch=z9hG4bK-39f41-e261615-288a37a0..Max-Forwards: 70..Supported<br>  : replaces..Route: &lt;sip:opensips_IP;transport=tcp;lr=on;r2=on&gt;..Route: &lt;s<br>  ip:opensips_IP;lr=on;r2=on&gt;..Allow: INVITE, CANCEL, ACK, BYE, OPTIONS, RE<br>
  FER, NOTIFY..Allow-Events: refer..Content-Length: 0....</div>
<div> </div>
<div>T opensips_IP:5060 -&gt; PSTNGW_IP:4126 [AP]<br>  SIP/2.0 477 Send failed (477/TM)..From: &lt;sip:XXXX448938@opensips_IP&gt;;tag<br>  =8841060-0-13c4-50022-39f2d-441b0d06-39f2d..To: &quot;YYYYY91007&quot;&lt;sip:YYYYY91007<br>
  @asterisk_IP&gt;;tag=as093bdd40..Call-ID: <a href="mailto:7d78872708ef61a72218b99a23ccf335@asteriskIP">7d78872708ef61a72218b99a23ccf335@asteriskIP</a><br>  ...CSeq: 1 BYE..Via: SIP/2.0/TCP 10.100.1.189:5060;branch=z9hG4b<br>
  K-39f41-e261615-288a37a0;received=PSTNGW_IP..Server: OpenSIPS (1.4.2-no<br>  tls (i386/linux))..Content-Length: 0..Warning: 392 opensips_IP:5060 &quot;Nois<br>  y feedback tells:  pid=1829 req_src_ip=PSTNGW_IP req_src_port=4126 in_u<br>
  ri=sip:YYYYY91007@asterisk_IP;transport=TCP out_uri=sip:YYYYY91007@asterisk_IP1<br>   .;transport=TCP via_cnt==1&quot;.... </div>
<div> </div>
<div> </div>
<div> </div>