<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks, I am seeing the same behaviour in sngrep.  The second INVITE with auth has incorrect SDP.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Initial INVITE sent to Supplier has correct SDP but no auth as expected.<br>
<br>
Second INVITE sent to Supplier has reverted to the original SDP as sent from my phone, but has got the valid auth.  I expect to see the SDP "fixed" and same as the first INVITE.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
<span style="font-family: "Courier New", monospace;">INVITE sip:+3531246****@outbound.voxbone.com:5060 SIP/2.0                                                            </span>
<div><span style="font-family: "Courier New", monospace;">Record-Route: <sip:34.142.2****;lr;ftag=xgbjwzf22q;nat=yes>                                                                                                                                            </span></div>
<div><span style="font-family: "Courier New", monospace;">Via: SIP/2.0/UDP 34.142.2*****:5060;branch=z9hG4bK809b.231d7fff2bdce55a1a947307855d425c.0                                                                                                              </span></div>
<div><span style="font-family: "Courier New", monospace;">v: SIP/2.0/UDP 192.168.68.113:5060;received=78.32.132.180;branch=z9hG4bK-6ttot8sa8aax;rport=38468                                                                                                      </span></div>
<div><span style="font-family: "Courier New", monospace;">f: "voxboneGW" <sip:+353******@34.1******>;tag=xgbjwzf22q                                                                                                                                          </span></div>
<div><span style="font-family: "Courier New", monospace;">t: <sip:00353124*****@34.14*******;user=phone>                                                                                                                                                        </span></div>
<div><span style="font-family: "Courier New", monospace;">i: 313632353134373536333537383634-z8yg9p65vbrf                                                                                                                                                        
  </span></div>
<div><span style="font-family: "Courier New", monospace;">CSeq: 1 INVITE                                                                                                                                                                                        
  </span></div>
<div><span style="font-family: "Courier New", monospace;">Max-Forwards: 69                                                                                                                                                                                      
  </span></div>
<div><span style="font-family: "Courier New", monospace;">User-Agent: snom725/8.9.3.60                                                                                                                                                                          
  </span></div>
<div><span style="font-family: "Courier New", monospace;">m: <sip:+35312678673@192.168.68.113:5060;line=79fr6o6f;alias=78.32.132.180~38468~1>;reg-id=1                                                                                                          
  </span></div>
<div><span style="font-family: "Courier New", monospace;">Accept: application/sdp                                                                                                                                                                                </span></div>
<div><span style="font-family: "Courier New", monospace;">Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, MESSAGE, INFO, UPDATE                                                                                                      
  </span></div>
<div><span style="font-family: "Courier New", monospace;">Allow-Events: talk, hold, refer, call-info                                                                                                                                                            
  </span></div>
<div><span style="font-family: "Courier New", monospace;">Supported: timer, 100rel, replaces, from-change                                                                                                                                                        </span></div>
<div><span style="font-family: "Courier New", monospace;">Session-Expires: 3600                                                                                                                                                                                  </span></div>
<div><span style="font-family: "Courier New", monospace;">Min-SE: 90                                                                                                                                                                                            
  </span></div>
<div><span style="font-family: "Courier New", monospace;">Authorization: Digest username="************",realm="34.1*****",nonce="*****************",uri="sip:00353124*****@34.14******;user=phone",response="********"</span></div>
<div><span style="font-family: "Courier New", monospace;">algorithm=MD5                                                                                                                                                                                          </span></div>
<div><span style="font-family: "Courier New", monospace;">c: application/sdp                                                                                                                                                                                    
  </span></div>
<div><span style="font-family: "Courier New", monospace;">l: 1611                                                                                                                                                                                                </span></div>
<div><span style="font-family: "Courier New", monospace;">                                                                                                                                                                                                       </span></div>
<div><span style="font-family: "Courier New", monospace;">v=0                                                                                                                                                                                                    </span></div>
<div><span style="font-family: "Courier New", monospace;">o=root 26854354 26854354 IN IP4 34.1****                                                                                                                                                          </span></div>
<div><span style="font-family: "Courier New", monospace;">s=call                                                                                                                                                                                                
  </span></div>
<div><span style="font-family: "Courier New", monospace;">c=IN IP4 34.142.29.106                                                                                                                                                                                
  </span></div>
<div><span style="font-family: "Courier New", monospace;">t=0 0                                                                                                                                                                                                  </span></div>
<div><span style="font-family: "Courier New", monospace;">m=audio 30000 RTP/AVP 9 0 8 3 99 112 18 101                                                                                                                                                            </span></div>
<div><span style="font-family: "Courier New", monospace;">a=rtpmap:9 G722/8000                                                                                                                                                                                  
  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=rtpmap:0 PCMU/8000                                                                                                                                                                                  
  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=rtpmap:8 PCMA/8000                                                                                                                                                                                  
  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=rtpmap:3 GSM/8000                                                                                                                                                                                    </span></div>
<div><span style="font-family: "Courier New", monospace;">a=rtpmap:99 G726-32/8000                                                                                                                                                                              
  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=rtpmap:112 AAL2-G726-32/8000                                                                                                                                                                        
  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=rtpmap:18 G729/8000                                                                                                                                                                                  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=fmtp:18 annexb=no                                                                                                                                                                                    </span></div>
<div><span style="font-family: "Courier New", monospace;">a=rtpmap:101 telephone-event/8000                                                                                                                                                                      </span></div>
<div><span style="font-family: "Courier New", monospace;">a=fmtp:101 0-15                                                                                                                                                                                        </span></div>
<div><span style="font-family: "Courier New", monospace;">a=sendrecv                                                                                                                                                                                            
  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=rtcp:30001                                                                                                                                                                                          
  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=crypto:1 AES_CM_128_HMAC_SHA1_32 inline:it3HWB/M7eeDc3LvQmB+THFQeiR0nEURqScfnNoy                                                                                                                    
  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=crypto:2 AEAD_AES_256_GCM inline:pMqHMoWzb3xt9mlYSI2FZNlrK/X1lx1/U+TBk7XeHBauSe2IyWScSXZVTu8                                                                                                        
  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=crypto:3 AEAD_AES_128_GCM inline:4i9e+Ytn4jowBQRHtjxsxVl2uj22pgOhh/sI3w                                                                                                                              </span></div>
<div><span style="font-family: "Courier New", monospace;">a=crypto:4 AES_256_CM_HMAC_SHA1_80 inline:VxvnS5sJYYrjXtPgi3v12kEV6gV9lJ4re/JSEO8FT18tVJMoIzmSje95HefAcw                                                                                              
  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=crypto:5 AES_256_CM_HMAC_SHA1_32 inline:NOpu3IsMJuDnPS6DketG/RO+w1mKJD/rdzRENVEF+Fnndez5Vu/yRK/Wr/Va2A                                                                                              
  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=crypto:6 AES_192_CM_HMAC_SHA1_80 inline:Rwnar613nUJLVJsYLPEFLP75dXb1bM607IbOw2lwop2wMDdRG4Y                                                                                                          </span></div>
<div><span style="font-family: "Courier New", monospace;">a=crypto:7 AES_192_CM_HMAC_SHA1_32 inline:hPEp3Nzl0tGuCI84Wk+cj6fTClM+3Nd5cryDSMEpKtiRImyKeiU                                                                                                          </span></div>
<div><span style="font-family: "Courier New", monospace;">a=crypto:8 AES_CM_128_HMAC_SHA1_80 inline:PEPvkt5duD33hu1zFtiH+iU8z0L6fnJ8ascFg5H6                                                                                                                    
  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=crypto:9 F8_128_HMAC_SHA1_80 inline:BMXOw0RQWKwaq9BC1p5+Q92z7TOQiv8jF1/6ND9V                                                                                                                        
  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=crypto:10 F8_128_HMAC_SHA1_32 inline:Ee7vaANwfj97CPdqtFbBfjDhAd5t7Coi0z4UjOPU                                                                                                                        </span></div>
<div><span style="font-family: "Courier New", monospace;">a=crypto:11 NULL_HMAC_SHA1_80 inline:afMj9BI7C6MC7E4NB56n8A/BxQumLBJg1j2FECYA                                                                                                                          </span></div>
<div><span style="font-family: "Courier New", monospace;">a=crypto:12 NULL_HMAC_SHA1_32 inline:fNyMLrqdc+ffmGRnmp0BTkv7wvN48CTRWWJmctCH                                                                                                                          </span></div>
<div><span style="font-family: "Courier New", monospace;">a=setup:actpass                                                                                                                                                                                        </span></div>
<div><span style="font-family: "Courier New", monospace;">a=fingerprint:sha-256 C3:76:76:64:C3:7E:3C:B5:47:1A:D6:44:B6:CD:BF:0E:C7:77:43:08:D6:EA:D6:39:33:3C:BA:21:FF:89:82:E7          </span></div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><span style="font-family: "Courier New", monospace;">==========================================================================</span></div>
<div><span style="font-family: "Courier New", monospace;">​INVITE sip:00353124*****@34.1*****;user=phone SIP/2.0                                                                                                                                              </span></div>
<div><span style="font-family: "Courier New", monospace;">v: SIP/2.0/UDP 192.168.68.113:5060;branch=z9hG4bK-6ttot8sa8aax;rport                                                                                                                                  
  </span></div>
<div><span style="font-family: "Courier New", monospace;">f: "voxboneGW" <sip:+35312******@34.1****>;tag=xgbjwzf22q                                                                                                                                          </span></div>
<div><span style="font-family: "Courier New", monospace;">t: <sip:00353124*****@34.1*****;user=phone>                                                                                                                                                        </span></div>
<div><span style="font-family: "Courier New", monospace;">i: 313632353134373536333537383634-z8yg9p65vbrf                                                                                                                                                        
  </span></div>
<div><span style="font-family: "Courier New", monospace;">CSeq: 1 INVITE                                                                                                                                                                                        
  </span></div>
<div><span style="font-family: "Courier New", monospace;">Max-Forwards: 70                                                                                                                                                                                      
  </span></div>
<div><span style="font-family: "Courier New", monospace;">User-Agent: snom725/8.9.3.60                                                                                                                                                                          
  </span></div>
<div><span style="font-family: "Courier New", monospace;">m: <sip:+35312678673@192.168.68.113:5060;line=79fr6o6f>;reg-id=1                                                                                                                                      
  </span></div>
<div><span style="font-family: "Courier New", monospace;">Accept: application/sdp                                                                                                                                                                                </span></div>
<div><span style="font-family: "Courier New", monospace;">Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, MESSAGE, INFO, UPDATE                                                                                                      
  </span></div>
<div><span style="font-family: "Courier New", monospace;">Allow-Events: talk, hold, refer, call-info                                                                                                                                                            
  </span></div>
<div><span style="font-family: "Courier New", monospace;">Supported: timer, 100rel, replaces, from-change                                                                                                                                                        </span></div>
<div><span style="font-family: "Courier New", monospace;">Session-Expires: 3600                                                                                                                                                                                  </span></div>
<div><span style="font-family: "Courier New", monospace;">Min-SE: 90                                                                                                                                                                                            
  </span></div>
<div><span style="font-family: "Courier New", monospace;">Authorization: Digest username="*****",realm="*****",nonce="Y*******",uri="sip:003531******@34.14****;user=phone",response="**********"</span></div>
<div><span style="font-family: "Courier New", monospace;">algorithm=MD5                                                                                                                                                                                          </span></div>
<div><span style="font-family: "Courier New", monospace;">c: application/sdp                                                                                                                                                                                    
  </span></div>
<div><span style="font-family: "Courier New", monospace;">l: 487                                                                                                                                                                                                
  </span></div>
<div><span style="font-family: "Courier New", monospace;">                                                                                                                                                                                                       </span></div>
<div><span style="font-family: "Courier New", monospace;">v=0                                                                                                                                                                                                    </span></div>
<div><span style="font-family: "Courier New", monospace;">o=root 26854354 26854354 IN IP4 192.168.68.113                                                                                                                                                        
  </span></div>
<div><span style="font-family: "Courier New", monospace;">s=call                                                                                                                                                                                                
  </span></div>
<div><span style="font-family: "Courier New", monospace;">c=IN IP4 192.168.68.113                                                                                                                                                                                </span></div>
<div><span style="font-family: "Courier New", monospace;">t=0 0                                                                                                                                                                                                  </span></div>
<div><span style="font-family: "Courier New", monospace;">m=audio 10742 RTP/AVP 9 0 8 3 99 112 18 101                                                                                                                                                            </span></div>
<div><span style="font-family: "Courier New", monospace;">a=crypto:1 AES_CM_128_HMAC_SHA1_32 inline:it3HWB/M7eeDc3LvQmB+THFQeiR0nEURqScfnNoy                                                                                                                    
  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=rtpmap:9 G722/8000                                                                                                                                                                                  
  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=rtpmap:0 PCMU/8000                                                                                                                                                                                  
  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=rtpmap:8 PCMA/8000                                                                                                                                                                                  
  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=rtpmap:3 GSM/8000                                                                                                                                                                                    </span></div>
<div><span style="font-family: "Courier New", monospace;">a=rtpmap:99 G726-32/8000                                                                                                                                                                              
  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=rtpmap:112 AAL2-G726-32/8000                                                                                                                                                                        
  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=rtpmap:18 G729/8000                                                                                                                                                                                  </span></div>
<div><span style="font-family: "Courier New", monospace;">a=fmtp:18 annexb=no                                                                                                                                                                                    </span></div>
<div><span style="font-family: "Courier New", monospace;">a=rtpmap:101 telephone-event/8000                                                                                                                                                                      </span></div>
<div><span style="font-family: "Courier New", monospace;">a=fmtp:101 0-15                                                                                                                                                                                        </span></div>
<div><span style="font-family: "Courier New", monospace;">a=ptime:20                                                                                                                                                                                            
  </span></div>
<span style="font-family: "Courier New", monospace;">a=sendrecv </span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: "Courier New", monospace;"> </span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: "Courier New", monospace;">​</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> sr-users <sr-users-bounces@lists.kamailio.org> on behalf of Yuriy Gorlichenko <ovoshlook@gmail.com><br>
<b>Sent:</b> 02 July 2021 10:03<br>
<b>To:</b> Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org><br>
<b>Subject:</b> Re: [SR-Users] UAC_AUTH with RTPEngine NAT</font>
<div> </div>
</div>
<div>
<div dir="auto">You won't see proper $mb after rtpengine changes in that way. $mb will be rewritten on the latest stage of packet processing. See sngrep or wireshark or either use read_sdp_pv / write_sdp_pv
<div dir="auto"><br>
</div>
<div dir="auto">Also our can use apply_message_changes before log, but I would not recommend to do so if this is a production under load.</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Fri, 2 Jul 2021, 10:28 Paul Smith, <<a href="mailto:paul.smith@claritytele.com">paul.smith@claritytele.com</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div>
<p>Hi,</p>
<p>[Note I posted this yesterday from the wrong email address.]<br>
</p>
<p><br>
</p>
<p>I am struggling to see why my SDP is not being set correctly on the INVITE to my supplier with Proxy-Authentication when I use uac_auth().</p>
<p>The initial INVITE to my supplier has correct SDP set by rtpengine_manage. Then supplier replies with a 407.  My failure route correctly handles the Auth, and also calls NATMANAGE again... but this time the SDP is unchanged and the private IP and original
 media information from the original device is relayed to my supplier. <br>
<br>
kamailio.cfg isbased on the default config.  Running kamailio 5.4.6 and using example from uac module for uac_auth.</p>
<p>My failure route calls NATMANAGE.  Is there anything special about uac_auth?  Do I need some extra magic to apply the message body changes after I have run rtpengine_manage().</p>
<p><br>
</p>
<p>I can see that the NATMANAGEr test for nat_uac_test("8") is true, and rtpengine_manage() s being called.  But the outgoing SDP is not changed.<br>
</p>
<p><br>
</p>
<p>Thanks for any hints!</p>
<p>Paul<br>
</p>
<p><br>
</p>
<p>====================<br>
</p>
<p>Extract of kamailio.cfg<br>
</p>
<blockquote><br>
<span style="font-family:"Courier New",monospace"></span>
<pre><span style="font-family:"Courier New",monospace">failure_route[TRUNKAUTH] {</span></pre>
<span style="font-family:"Courier New",monospace"></span>
<pre><span style="font-family:"Courier New",monospace">    if (t_is_canceled()) {</span></pre>
<span style="font-family:"Courier New",monospace"></span>
<pre><span style="font-family:"Courier New",monospace">        exit;</span></pre>
<span style="font-family:"Courier New",monospace"></span>
<pre><span style="font-family:"Courier New",monospace">    }</span></pre>
<span style="font-family:"Courier New",monospace"></span>
<pre><span style="font-family:"Courier New",monospace">    route(NATMANAGE);</span></pre>
<span style="font-family:"Courier New",monospace"></span>
<pre><span style="font-family:"Courier New",monospace">    xlog("L_INFO","In failure route, just finshed NATMANAGE and now body is $mb");</span></pre>
<span style="font-family:"Courier New",monospace"></span>
<pre><span style="font-family:"Courier New",monospace">    if(t_check_status("401|407")) {</span></pre>
<span style="font-family:"Courier New",monospace"></span>
<pre><span style="font-family:"Courier New",monospace">        # $avp(auser) = "test";</span></pre>
<span style="font-family:"Courier New",monospace"></span>
<pre><span style="font-family:"Courier New",monospace">        # $avp(apass) = "test";</span></pre>
<span style="font-family:"Courier New",monospace"></span>
<pre><span style="font-family:"Courier New",monospace">        # $avp(apass) = "36d0a02793542b4961e8348347236dbf";</span></pre>
<span style="font-family:"Courier New",monospace"></span>
<pre><span style="font-family:"Courier New",monospace">        if (uac_auth()) {</span></pre>
<span style="font-family:"Courier New",monospace"></span>
<pre><span style="font-family:"Courier New",monospace">                t_relay();</span></pre>
<span style="font-family:"Courier New",monospace"></span>
<pre><span style="font-family:"Courier New",monospace">        }</span></pre>
<span style="font-family:"Courier New",monospace"></span>
<pre><span style="font-family:"Courier New",monospace">        exit;</span></pre>
<span style="font-family:"Courier New",monospace"></span>
<pre><span style="font-family:"Courier New",monospace">    }</span></pre>
<span style="font-family:"Courier New",monospace"></span>
<pre><span style="font-family:"Courier New",monospace">}</span></pre>
</blockquote>
<br>
<div id="x_m_1544334846620880764Signature">
<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<table width="632" style="width:474.0pt">
<tbody>
<tr>
<td width="214" style="width:160.5pt; padding:.75pt .75pt .75pt .75pt"><br>
</td>
<td width="388" style="width:291.0pt; padding:.75pt .75pt .75pt .75pt"><br>
</td>
</tr>
<tr>
<td colspan="3" style="padding:.75pt .75pt .75pt .75pt"><br>
</td>
</tr>
<tr>
<td colspan="3" style="padding:.75pt .75pt .75pt .75pt"><br>
</td>
</tr>
</tbody>
</table>
<br>
</div>
</div>
</div>
</div>
</div>
__________________________________________________________<br>
Kamailio - Users Mailing List - Non Commercial Discussions<br>
  * <a href="mailto:sr-users@lists.kamailio.org" target="_blank" rel="noreferrer">
sr-users@lists.kamailio.org</a><br>
Important: keep the mailing list in the recipients, do not reply only to the sender!<br>
Edit mailing list options or unsubscribe:<br>
  * <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer noreferrer" target="_blank">
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote>
</div>
</div>
</body>
</html>