<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="Generator" content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:Cantarell;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:#42392C;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML con formato previo Car";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:#42392C;}
span.HTMLconformatoprevioCar
        {mso-style-name:"HTML con formato previo Car";
        mso-style-priority:99;
        mso-style-link:"HTML con formato previo";
        font-family:Consolas;
        color:#42392C;}
span.EstiloCorreo20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body bgcolor="white" lang="ES-CL" link="blue" vlink="purple" style="word-wrap:break-word"><div class="WordSection1"><p class="MsoNormal"><span style="color:windowtext">Hi Volga.</span></p><p class="MsoNormal"><span lang="EN-US" style="color:windowtext">Thanks for your answer.  Let me get this right.</span></p><p class="MsoNormal"><span lang="EN-US" style="color:windowtext">In my case… if I receive a REGISTER to the mid_registrar like this:</span></p><p class="MsoNormal"><span lang="EN-US" style="color:windowtext"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:windowtext">REGISTER</span></p><pre><span lang="EN-US" style="font-size:9.0pt">Contact: <a href="%3csip:d2.596@216.93.XXX.120:5060;transport=TLS%3e"><sip:d2.596@216.93.XXX.120:5060;transport=TLS></a>;+sip.instance="<urn:uuid:f7a5b4e0-92dd-5227-b355-0467623c49c0>";reg-id=1;expires=300</span></pre><pre><span lang="EN-US" style="font-size:9.0pt">Expires: 300.</span></pre><p class="MsoNormal"><span lang="EN-US" style="color:windowtext"> </span></p><p class="MsoNormal"><span lang="EN-US" style="color:windowtext">I apply the work around you mention…</span></p><p class="MsoNormal"><span lang="EN-US" style="color:windowtext"> </span></p><p class="MsoNormal"><span lang="EN-US" style="color:windowtext">Then I will get the outgoing_register to the PBX with the value modified?</span></p><p class="MsoNormal"><span lang="EN-US" style="color:windowtext"> </span></p><p class="MsoNormal"><span lang="EN-US" style="color:windowtext">Thanks!</span></p><p class="MsoNormal"><span lang="EN-US" style="color:windowtext">Ricardo</span></p><p class="MsoNormal"><span lang="EN-US" style="color:windowtext"> </span></p><div><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span lang="ES" style="color:windowtext">De:</span></b><span lang="ES" style="color:windowtext"> volga629 <<a href="mailto:volga629@networklab.ca">volga629@networklab.ca</a>> <br><b>Enviado el:</b> martes, 23 de marzo de 2021 23:37<br><b>Para:</b> OpenSIPS users mailling list <<a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>>; Ricardo Martinez <<a href="mailto:rmartinez@redvoiss.net">rmartinez@redvoiss.net</a>><br><b>Asunto:</b> Re: [OpenSIPS-Users] Mid_Registrar outgoing_expire issue (Bug?)</span></p></div></div><p class="MsoNormal"> </p><p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Cantarell",serif">Hello Ricardo,<br>I noticed this issue too. My work around is <br><br>Where 7200 is  </span>outgoing_expires in module params.<br><br></p><pre> </pre><pre> </pre><p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:13.5pt;font-family:"Cantarell",serif">                 if($(hdr("Expires"){<a href="http://s.int">s.int</a>})!=7200) {<br>                        remove_hf("Expires");<br>                        append_hf("Expires: 7200\r\n");<br>                }<br><br>volga629</span></p><div><p class="MsoNormal">On 3/23/21 12:46 PM, Ricardo Martinez wrote:</p></div><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><pre>Hi.</pre><pre>I’m still unable to understand why the REGISTER is not using the</pre><pre>outgoing_expire.</pre><pre>First.   It's weird because according to the debug seems to change the</pre><pre>outgoing_expire to 3600 but when I check the outgoing REGISTER from the</pre><pre>MID_REGISTRAR still has the Expire Header = 300.</pre><pre>One thing I noticed is for the first REGISTER (the one the</pre><pre>outgoing_expires works) it changes the Expires header ok, this REGISTER</pre><pre>does not have contact expire header, but for the second REGISTER.. which</pre><pre>has Expire header and expire contact header.. seems to apply only the</pre><pre>"expire in the contact header"</pre><pre>(DBG:mid_registrar:replace_expires_ct_param).</pre><pre>These are the debugs...</pre><pre>Is this a bug? Or maybe I'm missing something?</pre><pre> </pre><pre>1. Outgoing Expire  OK</pre><pre>INCOMING REGISTER</pre><pre>Contact:</pre><pre><a href="sip:d2.596@192.168.0.34;rinstance=fa92ef51cba5543d;transport=tls">sip:d2.596@192.168.0.34;rinstance=fa92ef51cba5543d;transport=tls</a>>;+sip.ins</pre><pre>tance="<urn:uuid:f7a5b4e0-92dd-5227-b355-0467623c49c0></pre><pre>Expires: 300.</pre><pre> </pre><pre>DBG:mid_registrar:mid_reg_save: saving to location...</pre><pre>DBG:mid_registrar:prepare_forward: from: '"Ricardo</pre><pre>Martinez"<a href="sip:d2.596@dom1.company.com:5061"><sip:d2.596@dom1.company.com:5061></a>;tag=ba489a60'</pre><pre>DBG:mid_registrar:prepare_forward: Call-ID:</pre><pre>'187541_mobile-rel120YzljYzJjNjcwOGJlYmYxOTU0MDM1NDBlMDJiZDQyNjg'</pre><pre>DBG:mid_registrar:prepare_forward: Contact:</pre><pre>'<a href="sip:d2.596@192.168.0.34;rinstance=fa92ef51cba5543d;transport=tls"><sip:d2.596@192.168.0.34;rinstance=fa92ef51cba5543d;transport=tls></a>;+sip.i</pre><pre>nstance="<urn:uuid:f7a5b4e0-92dd-5227-b355-0467623c49c0>"'</pre><pre>DBG:mid_registrar:prepare_forward: registering ptr 0x7f6efc9c6b78 on</pre><pre>TMCB_REQUEST_FWDED ...</pre><pre>DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_FWDED,</pre><pre>mri=0x7f6efc9c6b78 ...</pre><pre>DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_DELETED,</pre><pre>mri=0x7f6efc9c6b78 ...</pre><pre>[187541_mobile-rel120YzljYzJjNjcwOGJlYmYxOTU0MDM1NDBlMDJiZDQyNjg]</pre><pre>[from_vex] [REGISTER sin totag][mid_registrar_save]: Retorna valor 1</pre><pre>[187541_mobile-rel120YzljYzJjNjcwOGJlYmYxOTU0MDM1NDBlMDJiZDQyNjg]</pre><pre>[from_vex] [REGISTER sin totag][mid_registrar_save]:</pre><pre><a href="sip:d2.596@dom1.company.com:5061">sip:d2.596@dom1.company.com:5061</a> salvado en tabla location</pre><pre>DBG:mid_registrar:mid_reg_req_fwded: msg expires: '300'</pre><pre>DBG:mid_registrar:calc_contact_expires: expires: 300</pre><pre>DBG:mid_registrar:calc_ob_contact_expires: outgoing expires: 1616511318</pre><pre>DBG:mid_registrar:overwrite_contact_expirations: ....... contact:</pre><pre>'<a href="sip:d2.596@192.168.0.34;rinstance=fa92ef51cba5543d;transport=tls">sip:d2.596@192.168.0.34;rinstance=fa92ef51cba5543d;transport=tls</a>>;+<a href="http://sip.in">sip.in</a></pre><pre>stance="<urn:uuid:f7a5b4e0-92dd-5227-b355-0467623c49c0>"#015' Calculated</pre><pre>TIMEOUT = 1616511318 (3600)</pre><pre>DBG:mid_registrar:replace_expires_hf: ....... Exp hdr: '300'</pre><pre>DBG:mid_registrar:mid_reg_req_fwded: trimming all Contact URIs into one...</pre><pre>DBG:mid_registrar:calc_contact_expires: expires: 300</pre><pre>DBG:mid_registrar:trim_to_single_contact: deleting Contact</pre><pre>'<a href="sip:d2.596@192.168.0.34;rinstance=fa92ef51cba5543d;transport=tls"><sip:d2.596@192.168.0.34;rinstance=fa92ef51cba5543d;transport=tls></a>;+sip.i</pre><pre>nstance="<urn:uuid:f7a5b4e0-92dd-5227-b355-0467623c49c0>"'</pre><pre>DBG:mid_registrar:trim_to_single_contact: inserting new Contact</pre><pre>'<a href="sip:d2.596@192.141.64.134:5060"><sip:d2.596@192.141.64.134:5060></a>'</pre><pre>DBG:mid_registrar:calc_contact_expires: expires: 300</pre><pre>DBG:mid_registrar:mid_reg_req_fwded: REQ FORWARDED TO</pre><pre>'<a href="sip:dom1.company.com:5061">sip:dom1.company.com:5061</a>' (obp: <a href="sip:192.141.XXX.94:5060">sip:192.141.XXX.94:5060</a>), expires=3600</pre><pre> </pre><pre>OUTGOING REGISTER</pre><pre>Contact: <a href="sip:d2.596@192.141.XX.134:5060"><sip:d2.596@192.141.XX.134:5060></a>.</pre><pre>Expires: 3600.</pre><pre> </pre><pre>2. Outgoing_expire fail</pre><pre>But for the Second REGISTER (from the PUSH SERVER)</pre><pre>INCOMING REGISTER</pre><pre>Contact:</pre><pre><a href="sip:d2.596@216.93.XXX.120:5060;transport=TLS"><sip:d2.596@216.93.XXX.120:5060;transport=TLS></a>;+sip.instance="<urn:uuid:f7</pre><pre>a5b4e0-92dd-5227-b355-0467623c49c0>";reg-id=1;expires=300</pre><pre>Expires: 300.</pre><pre> </pre><pre>DBG:mid_registrar:mid_reg_save: saving to location...</pre><pre>DBG:mid_registrar:prepare_forward: from:</pre><pre>'<a href="sip:d2.596@dom1.company.com:5061"><sip:d2.596@dom1.company.com:5061></a>;tag=0f1c2a07'</pre><pre>DBG:mid_registrar:prepare_forward: Call-ID:</pre><pre>'<a href="mailto:Y12mG-n8ka5JRO_j-BHqNQ..@216.93.XXX.121">Y12mG-n8ka5JRO_j-BHqNQ..@216.93.XXX.121</a>'</pre><pre>DBG:mid_registrar:prepare_forward: Contact:</pre><pre>'<a href="sip:d2.596@216.93.XXX.120:5060;transport=TLS"><sip:d2.596@216.93.XXX.120:5060;transport=TLS></a>;+sip.instance="<urn:uuid:f</pre><pre>7a5b4e0-92dd-5227-b355-0467623c49c0>";reg-id=1;expires=300'</pre><pre>DBG:mid_registrar:prepare_forward: registering ptr 0x7f6efc9b60d0 on</pre><pre>TMCB_REQUEST_FWDED ...</pre><pre>DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_FWDED,</pre><pre>mri=0x7f6efc9b60d0 ...</pre><pre>DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_DELETED,</pre><pre>mri=0x7f6efc9b60d0 ...</pre><pre>[<a href="mailto:Y12mG-n8ka5JRO_j-BHqNQ..@216.93.XXX.121">Y12mG-n8ka5JRO_j-BHqNQ..@216.93.XXX.121</a>] [from_vex] [REGISTER sin</pre><pre>totag][mid_registrar_save]: Retorna valor 1</pre><pre>[<a href="mailto:Y12mG-n8ka5JRO_j-BHqNQ..@216.93.XXX.121">Y12mG-n8ka5JRO_j-BHqNQ..@216.93.XXX.121</a>] [from_vex] [REGISTER sin</pre><pre>totag][mid_registrar_save]: <a href="sip:d2.596@dom1.company.com:5061">sip:d2.596@dom1.company.com:5061</a> salvado en</pre><pre>tabla location</pre><pre>DBG:mid_registrar:mid_reg_req_fwded: msg expires: '300'</pre><pre>DBG:mid_registrar:calc_contact_expires: expires: 300</pre><pre>DBG:mid_registrar:calc_ob_contact_expires: outgoing expires: 1616511408</pre><pre>DBG:mid_registrar:overwrite_contact_expirations: ....... contact:</pre><pre>'<a href="sip:d2.596@216.93.XXX.120:5060;transport=TLS">sip:d2.596@216.93.XXX.120:5060;transport=TLS</a>>;+sip.instance="<urn:uuid:f7</pre><pre>a5b4e0-92dd-5227-b355-0467623c49c0>";reg-id=1;expires=300#015' Calculated</pre><pre>TIMEOUT = 1616511408 (3600)</pre><pre>DBG:mid_registrar:replace_expires_ct_param: replacing expires, ct</pre><pre>'<a href="sip:d2.596@216.93.XXX.120:5060;transport=TLS">sip:d2.596@216.93.XXX.120:5060;transport=TLS</a>' '300' with 3600,</pre><pre>0x7f6f3cf1e5b0 -> 0x7f6f3cf1e861 (0x7f6f3cf1e6d9)</pre><pre>DBG:mid_registrar:mid_reg_req_fwded: trimming all Contact URIs into one...</pre><pre>DBG:mid_registrar:calc_contact_expires: expires: 300</pre><pre>DBG:mid_registrar:trim_to_single_contact: deleting Contact</pre><pre>'<a href="sip:d2.596@216.93.XXX.120:5060;transport=TLS"><sip:d2.596@216.93.XXX.120:5060;transport=TLS></a>;+sip.instance="<urn:uuid:f</pre><pre>7a5b4e0-92dd-5227-b355-0467623c49c0>";reg-id=1;expires=300'</pre><pre>DBG:mid_registrar:trim_to_single_contact: inserting new Contact</pre><pre>'<a href="sip:d2.596@192.141.XX.134:5060"><sip:d2.596@192.141.XX.134:5060></a>'</pre><pre>DBG:mid_registrar:calc_contact_expires: expires: 300</pre><pre>DBG:mid_registrar:mid_reg_req_fwded: REQ FORWARDED TO</pre><pre>'<a href="sip:dom1.company.com:5061">sip:dom1.company.com:5061</a>' (obp: <a href="sip:192.141.XXX.94:5060">sip:192.141.XXX.94:5060</a>), expires=3600</pre><pre> </pre><pre>OUTGOING REGISTER</pre><pre>Contact: <a href="sip:d2.596@192.141.64.134:5060"><sip:d2.596@192.141.64.134:5060></a></pre><pre>Expires: 300</pre><pre> </pre><pre>Could this be a bug?</pre><pre> </pre><pre>Hope someone could point me in the right direction.</pre><pre>Best Regards,</pre><pre>Ricardo Martinez</pre><pre> </pre><pre>De: Ricardo Martinez <a href="mailto:rmartinez@redvoiss.net"><rmartinez@redvoiss.net></a></pre><pre>Enviado el: viernes, 19 de marzo de 2021 16:03</pre><pre>Para: 'OpenSIPS users mailling list' <a href="mailto:users@lists.opensips.org"><users@lists.opensips.org></a></pre><pre>Asunto: Mid_Registrar outgoing_expire issue</pre><pre> </pre><pre>Hi.</pre><pre>I’m facing two problems with my mid_registrar module scenario.</pre><pre>The scenario is as follows:</pre><pre> </pre><pre>UAC ------- MID_REGISTRAR ----- PBX</pre><pre> </pre><pre>When a REGISTER came from the UAC to MID_REGISTRAR it has a header</pre><pre>Expires:300</pre><pre>I have set the</pre><pre>modparam("mid_registrar", "outgoing_expires", 3600)</pre><pre> </pre><pre>UAC ------------- MID_REGISTRAR ------------------- PBX</pre><pre>        REG</pre><pre>   Contact: (no expire)</pre><pre>  Expires: 300</pre><pre>                                     REG</pre><pre>                                    Contact: ( no expire)</pre><pre>                                    Expires: 3600</pre><pre> </pre><pre>Seems ok!..</pre><pre>But in another scenario I have:</pre><pre> </pre><pre> </pre><pre> </pre><pre>UAC ------------- MID_REGISTRAR ------------------- PBX</pre><pre>        REG</pre><pre>   Contact: (expire=600)</pre><pre>  Expires: 600</pre><pre>                                     REG</pre><pre>                                    Contact: (no expire)</pre><pre>                                    Expires: 600</pre><pre> </pre><pre> </pre><pre>I’m not getting why the mid_registrar does not modified the outgoing</pre><pre>Expires to the PBX to 3600.  Anyone has a clue about this?</pre><pre>Part of the configuration is:</pre><pre>### MID_REGISTRAR module</pre><pre>loadmodule "mid_registrar.so"</pre><pre>modparam("mid_registrar", "mode", 2) /* 0 = mirror / 1 = ct / 2 = AoR */</pre><pre>modparam("mid_registrar", "outgoing_expires", 3600)</pre><pre>modparam("mid_registrar", "contact_id_insertion", "ct-param")</pre><pre>modparam("mid_registrar", "max_contacts", 6)</pre><pre>modparam("mid_registrar", "received_avp", "$avp(rcv)")</pre><pre>modparam("mid_registrar", "extra_contact_params_avp",</pre><pre>"$avp(extra_ct_params)")</pre><pre> </pre><pre>if (( is_method("REGISTER")) && (!has_totag())) {</pre><pre>mid_registrar_save("location","M<rinstance>");</pre><pre>                switch($retcode) {</pre><pre>                        case 1:</pre><pre>                                $du = $var(r_pbx_sethost);</pre><pre>                                xlog("[$ci] [from_vex] [REGISTER sin</pre><pre>totag][mid_registrar_save]: Retorna valor 1\n");</pre><pre>                                xlog("[$ci] [from_vex] [REGISTER sin</pre><pre>totag][mid_registrar_save]: $fu salvado en tabla location\n");</pre><pre>                                t_relay(,$var(r_pbx_send));</pre><pre>                                xlog("[$ci] [from_vex] [REGISTER sin</pre><pre>totag][mid_registrar_save]: Redirecting $rm to destination</pre><pre>[$var(r_pbx)]\n");</pre><pre>                                exit;</pre><pre>                        case 2:</pre><pre>                                xlog("[$ci] [from_vex] [REGISTER sin</pre><pre>totag][mid_registrar_save]: Retorna valor 2\n");</pre><pre>                                xlog("[$ci] [from_vex] [REGISTER sin</pre><pre>totag][mid_registrar_save]: Absorbiendo $rm from $si to domain $rd\n");</pre><pre>                                break;</pre><pre>                        default:</pre><pre>                                xlog("[$ci] [from_vex] [REGISTER sin</pre><pre>totag][mid_registrar_save]: Retorna valor -2\n");</pre><pre>                                xlog("[$ci] [from_vex] [REGISTER sin</pre><pre>totag][mid_registrar_save]: SECURITY: No se puede salvar localmente el</pre><pre>registro desde [$si] a dominio [$rd]\n");</pre><pre>                                send_reply(503,"MID Register Failed");</pre><pre>                                exit;</pre><pre>                }</pre><pre>        }</pre><pre> </pre><pre> </pre><pre> </pre><pre>Beside of that subsequest REGISTER from that endpoint are route to the PBX</pre><pre>instead of absorve the REGISTERS.  Could this be related??</pre><pre> </pre><pre> </pre><pre>Thanks!</pre><pre>Ricardo</pre><pre> </pre><pre>_______________________________________________</pre><pre>Users mailing list</pre><pre><a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a></pre><pre><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></pre></blockquote><p class="MsoNormal"> </p></div></body></html>