<div dir="ltr"><div dir="ltr">Try msg_apply_changes() before printing updated $td</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 11, 2019 at 2:41 PM Andrew Chen <<a href="mailto:achen@fuze.com">achen@fuze.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hey guys,<div><br></div><div>Question.</div><div><br></div><div>I have this block of code at the beginning of route block:</div><div><br></div><div>
<p class="gmail-m_-3571316649932072069gmail-p1" style="margin:0px;font:11px Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-3571316649932072069gmail-Apple-converted-space"> </span>if(is_ip($td))</span></p><p class="gmail-m_-3571316649932072069gmail-p1" style="margin:0px;font:11px Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-3571316649932072069gmail-Apple-converted-space"> </span>{</span></p><p class="gmail-m_-3571316649932072069gmail-p1" style="margin:0px;font:11px Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-3571316649932072069gmail-Apple-converted-space"> </span>xlog("L_INFO", "</span><span class="gmail-m_-3571316649932072069gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(52,188,38)">[$ci][$mi][CSeq $cs]</span><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures"> IP detected in To domain.<span class="gmail-m_-3571316649932072069gmail-Apple-converted-space"> </span>Resolving. \n")</span><span class="gmail-m_-3571316649932072069gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(82,48,225)">;</span></p><p class="gmail-m_-3571316649932072069gmail-p1" style="margin:0px;font:11px Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-3571316649932072069gmail-Apple-converted-space"> </span>exec_avp("host $td | awk '</span><span class="gmail-m_-3571316649932072069gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(52,188,38)">{print substr($$5, 1, length($$5)-1)}</span><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures">'", "$avp(s:newtd)")</span><span class="gmail-m_-3571316649932072069gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(82,48,225)">;</span></p><p class="gmail-m_-3571316649932072069gmail-p1" style="margin:0px;font:11px Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-3571316649932072069gmail-Apple-converted-space"> </span>xlog("L_INFO", "</span><span class="gmail-m_-3571316649932072069gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(52,188,38)">[$ci][$mi][CSeq $cs]</span><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures"> new newtd =</span><span class="gmail-m_-3571316649932072069gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(195,55,32)"> $avp(s:newtd)")</span><span class="gmail-m_-3571316649932072069gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(82,48,225)">;</span></p><p class="gmail-m_-3571316649932072069gmail-p1" style="margin:0px;font:11px Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-3571316649932072069gmail-Apple-converted-space"> </span>$td =</span><span class="gmail-m_-3571316649932072069gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(195,55,32)"> $avp(s:newtd)</span><span class="gmail-m_-3571316649932072069gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(82,48,225)">;</span></p><p class="gmail-m_-3571316649932072069gmail-p1" style="margin:0px;font:11px Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-3571316649932072069gmail-Apple-converted-space"> </span>xlog("L_INFO", "</span><span class="gmail-m_-3571316649932072069gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(52,188,38)">[$ci][$mi][CSeq $cs]</span><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures"> new td =</span><span class="gmail-m_-3571316649932072069gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(195,55,32)"> $td")</span><span class="gmail-m_-3571316649932072069gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(82,48,225)">;</span></p><p class="gmail-m_-3571316649932072069gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
</p><p class="gmail-m_-3571316649932072069gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-3571316649932072069gmail-Apple-converted-space"> </span>}</span></p><p class="gmail-m_-3571316649932072069gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-m_-3571316649932072069gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures">but $td never updates.</span></p><p class="gmail-m_-3571316649932072069gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-m_-3571316649932072069gmail-p1" style="margin:0px;font:11px Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures">Apr 11 18:26:00 sjomaintpsg50 /usr/local/sbin/kamailio[6475]: INFO: <script>: [8ROWdUOINx][1]</span><span class="gmail-m_-3571316649932072069gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(195,55,32)"><b>[CSeq</b></span><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures"> 20] IP detected in To domain.<span class="gmail-m_-3571316649932072069gmail-Apple-converted-space"> </span>Resolving.<span class="gmail-m_-3571316649932072069gmail-Apple-converted-space"> </span></span></p><p class="gmail-m_-3571316649932072069gmail-p1" style="margin:0px;font:11px Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures">Apr 11 18:26:00 sjomaintpsg50 /usr/local/sbin/kamailio[6475]: INFO: <script>: [8ROWdUOINx][1]</span><span class="gmail-m_-3571316649932072069gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(195,55,32)"><b>[CSeq</b></span><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures"> 20] new newtd = <a href="http://sjomaintpsg50.fuzemeeting.com" target="_blank">sjomaintpsg50.fuzemeeting.com</a></span></p><p class="gmail-m_-3571316649932072069gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures">
</span></p><p class="gmail-m_-3571316649932072069gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures">Apr 11 18:26:00 sjomaintpsg50 /usr/local/sbin/kamailio[6475]: INFO: <script>: [8ROWdUOINx][1]</span><span class="gmail-m_-3571316649932072069gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(195,55,32)"><b>[CSeq</b></span><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures"> 20] new td = 206.81.191.30</span></p><p class="gmail-m_-3571316649932072069gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-m_-3571316649932072069gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-m_-3571316649932072069gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Is there a reason why?</span></p><p class="gmail-m_-3571316649932072069gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><br></p><div>Thanks</div><div><br></div>-- <br><div dir="ltr" class="gmail-m_-3571316649932072069gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr" style="font-size:12.8px">Andy Chen</div><div dir="ltr" style="font-size:12.8px"><div>Sr. Telephony Lead Engineer</div><div><a href="mailto:achen@thinkingphones.com" target="_blank">achen@</a><a href="http://fuze.com" target="_blank">fuze.com</a><br></div><div><br><br></div></div></div></div></div></div></div>
<br>
<span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">*Confidentiality Notice: The information contained in this e-mail and any</span><br style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">attachments may be confidential. If you are not an intended recipient, you</span><br style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">are hereby notified that any dissemination, distribution or copying of this</span><br style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">e-mail is strictly prohibited. If you have received this e-mail in error,</span><br style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">please notify the sender and permanently delete the e-mail and any</span><br style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">attachments immediately. You should not retain, copy or use this e-mail or</span><br style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">any attachment for any purpose, nor disclose all or any part of the</span><br style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">contents to any other person. Thank you.*</span>_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>