<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#42392c" bgcolor="#ffffff">
<font size="+1"><font face="Cantarell">Hello Ricardo,<br>
I noticed this issue too. My work around is <br>
<br>
Where 7200 is </font></font>outgoing_expires in module params.<br>
<pre class="moz-quote-pre" wrap="">
</pre>
<font size="+1"><font face="Cantarell">
if($(hdr("Expires"){s.int})!=7200) {<br>
remove_hf("Expires");<br>
append_hf("Expires: 7200\r\n");<br>
}<br>
<br>
volga629<br>
</font></font><br>
<div class="moz-cite-prefix">On 3/23/21 12:46 PM, Ricardo Martinez
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:20fe4b452a00c331bfd3b5e34c27ab12@mail.gmail.com">
<pre class="moz-quote-pre" wrap="">Hi.
I’m still unable to understand why the REGISTER is not using the
outgoing_expire.
First. It's weird because according to the debug seems to change the
outgoing_expire to 3600 but when I check the outgoing REGISTER from the
MID_REGISTRAR still has the Expire Header = 300.
One thing I noticed is for the first REGISTER (the one the
outgoing_expires works) it changes the Expires header ok, this REGISTER
does not have contact expire header, but for the second REGISTER.. which
has Expire header and expire contact header.. seems to apply only the
"expire in the contact header"
(DBG:mid_registrar:replace_expires_ct_param).
These are the debugs...
Is this a bug? Or maybe I'm missing something?
1. Outgoing Expire OK
INCOMING REGISTER
Contact:
<a class="moz-txt-link-freetext" 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
tance="<urn:uuid:f7a5b4e0-92dd-5227-b355-0467623c49c0>
Expires: 300.
DBG:mid_registrar:mid_reg_save: saving to location...
DBG:mid_registrar:prepare_forward: from: '"Ricardo
Martinez"<a class="moz-txt-link-rfc2396E" href="sip:d2.596@dom1.company.com:5061"><sip:d2.596@dom1.company.com:5061></a>;tag=ba489a60'
DBG:mid_registrar:prepare_forward: Call-ID:
'187541_mobile-rel120YzljYzJjNjcwOGJlYmYxOTU0MDM1NDBlMDJiZDQyNjg'
DBG:mid_registrar:prepare_forward: Contact:
'<a class="moz-txt-link-rfc2396E" 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
nstance="<urn:uuid:f7a5b4e0-92dd-5227-b355-0467623c49c0>"'
DBG:mid_registrar:prepare_forward: registering ptr 0x7f6efc9c6b78 on
TMCB_REQUEST_FWDED ...
DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_FWDED,
mri=0x7f6efc9c6b78 ...
DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_DELETED,
mri=0x7f6efc9c6b78 ...
[187541_mobile-rel120YzljYzJjNjcwOGJlYmYxOTU0MDM1NDBlMDJiZDQyNjg]
[from_vex] [REGISTER sin totag][mid_registrar_save]: Retorna valor 1
[187541_mobile-rel120YzljYzJjNjcwOGJlYmYxOTU0MDM1NDBlMDJiZDQyNjg]
[from_vex] [REGISTER sin totag][mid_registrar_save]:
<a class="moz-txt-link-freetext" href="sip:d2.596@dom1.company.com:5061">sip:d2.596@dom1.company.com:5061</a> salvado en tabla location
DBG:mid_registrar:mid_reg_req_fwded: msg expires: '300'
DBG:mid_registrar:calc_contact_expires: expires: 300
DBG:mid_registrar:calc_ob_contact_expires: outgoing expires: 1616511318
DBG:mid_registrar:overwrite_contact_expirations: ....... contact:
'<a class="moz-txt-link-freetext" 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.in
stance="<urn:uuid:f7a5b4e0-92dd-5227-b355-0467623c49c0>"#015' Calculated
TIMEOUT = 1616511318 (3600)
DBG:mid_registrar:replace_expires_hf: ....... Exp hdr: '300'
DBG:mid_registrar:mid_reg_req_fwded: trimming all Contact URIs into one...
DBG:mid_registrar:calc_contact_expires: expires: 300
DBG:mid_registrar:trim_to_single_contact: deleting Contact
'<a class="moz-txt-link-rfc2396E" 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
nstance="<urn:uuid:f7a5b4e0-92dd-5227-b355-0467623c49c0>"'
DBG:mid_registrar:trim_to_single_contact: inserting new Contact
'<a class="moz-txt-link-rfc2396E" href="sip:d2.596@192.141.64.134:5060"><sip:d2.596@192.141.64.134:5060></a>'
DBG:mid_registrar:calc_contact_expires: expires: 300
DBG:mid_registrar:mid_reg_req_fwded: REQ FORWARDED TO
'<a class="moz-txt-link-freetext" href="sip:dom1.company.com:5061">sip:dom1.company.com:5061</a>' (obp: <a class="moz-txt-link-freetext" href="sip:192.141.XXX.94:5060">sip:192.141.XXX.94:5060</a>), expires=3600
OUTGOING REGISTER
Contact: <a class="moz-txt-link-rfc2396E" href="sip:d2.596@192.141.XX.134:5060"><sip:d2.596@192.141.XX.134:5060></a>.
Expires: 3600.
2. Outgoing_expire fail
But for the Second REGISTER (from the PUSH SERVER)
INCOMING REGISTER
Contact:
<a class="moz-txt-link-rfc2396E" 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
a5b4e0-92dd-5227-b355-0467623c49c0>";reg-id=1;expires=300
Expires: 300.
DBG:mid_registrar:mid_reg_save: saving to location...
DBG:mid_registrar:prepare_forward: from:
'<a class="moz-txt-link-rfc2396E" href="sip:d2.596@dom1.company.com:5061"><sip:d2.596@dom1.company.com:5061></a>;tag=0f1c2a07'
DBG:mid_registrar:prepare_forward: Call-ID:
'<a class="moz-txt-link-abbreviated" href="mailto:Y12mG-n8ka5JRO_j-BHqNQ..@216.93.XXX.121">Y12mG-n8ka5JRO_j-BHqNQ..@216.93.XXX.121</a>'
DBG:mid_registrar:prepare_forward: Contact:
'<a class="moz-txt-link-rfc2396E" 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
7a5b4e0-92dd-5227-b355-0467623c49c0>";reg-id=1;expires=300'
DBG:mid_registrar:prepare_forward: registering ptr 0x7f6efc9b60d0 on
TMCB_REQUEST_FWDED ...
DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_FWDED,
mri=0x7f6efc9b60d0 ...
DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_DELETED,
mri=0x7f6efc9b60d0 ...
[<a class="moz-txt-link-abbreviated" href="mailto:Y12mG-n8ka5JRO_j-BHqNQ..@216.93.XXX.121">Y12mG-n8ka5JRO_j-BHqNQ..@216.93.XXX.121</a>] [from_vex] [REGISTER sin
totag][mid_registrar_save]: Retorna valor 1
[<a class="moz-txt-link-abbreviated" href="mailto:Y12mG-n8ka5JRO_j-BHqNQ..@216.93.XXX.121">Y12mG-n8ka5JRO_j-BHqNQ..@216.93.XXX.121</a>] [from_vex] [REGISTER sin
totag][mid_registrar_save]: <a class="moz-txt-link-freetext" href="sip:d2.596@dom1.company.com:5061">sip:d2.596@dom1.company.com:5061</a> salvado en
tabla location
DBG:mid_registrar:mid_reg_req_fwded: msg expires: '300'
DBG:mid_registrar:calc_contact_expires: expires: 300
DBG:mid_registrar:calc_ob_contact_expires: outgoing expires: 1616511408
DBG:mid_registrar:overwrite_contact_expirations: ....... contact:
'<a class="moz-txt-link-freetext" 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
a5b4e0-92dd-5227-b355-0467623c49c0>";reg-id=1;expires=300#015' Calculated
TIMEOUT = 1616511408 (3600)
DBG:mid_registrar:replace_expires_ct_param: replacing expires, ct
'<a class="moz-txt-link-freetext" 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,
0x7f6f3cf1e5b0 -> 0x7f6f3cf1e861 (0x7f6f3cf1e6d9)
DBG:mid_registrar:mid_reg_req_fwded: trimming all Contact URIs into one...
DBG:mid_registrar:calc_contact_expires: expires: 300
DBG:mid_registrar:trim_to_single_contact: deleting Contact
'<a class="moz-txt-link-rfc2396E" 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
7a5b4e0-92dd-5227-b355-0467623c49c0>";reg-id=1;expires=300'
DBG:mid_registrar:trim_to_single_contact: inserting new Contact
'<a class="moz-txt-link-rfc2396E" href="sip:d2.596@192.141.XX.134:5060"><sip:d2.596@192.141.XX.134:5060></a>'
DBG:mid_registrar:calc_contact_expires: expires: 300
DBG:mid_registrar:mid_reg_req_fwded: REQ FORWARDED TO
'<a class="moz-txt-link-freetext" href="sip:dom1.company.com:5061">sip:dom1.company.com:5061</a>' (obp: <a class="moz-txt-link-freetext" href="sip:192.141.XXX.94:5060">sip:192.141.XXX.94:5060</a>), expires=3600
OUTGOING REGISTER
Contact: <a class="moz-txt-link-rfc2396E" href="sip:d2.596@192.141.64.134:5060"><sip:d2.596@192.141.64.134:5060></a>
Expires: 300
Could this be a bug?
Hope someone could point me in the right direction.
Best Regards,
Ricardo Martinez
De: Ricardo Martinez <a class="moz-txt-link-rfc2396E" href="mailto:rmartinez@redvoiss.net"><rmartinez@redvoiss.net></a>
Enviado el: viernes, 19 de marzo de 2021 16:03
Para: 'OpenSIPS users mailling list' <a class="moz-txt-link-rfc2396E" href="mailto:users@lists.opensips.org"><users@lists.opensips.org></a>
Asunto: Mid_Registrar outgoing_expire issue
Hi.
I’m facing two problems with my mid_registrar module scenario.
The scenario is as follows:
UAC ------- MID_REGISTRAR ----- PBX
When a REGISTER came from the UAC to MID_REGISTRAR it has a header
Expires:300
I have set the
modparam("mid_registrar", "outgoing_expires", 3600)
UAC ------------- MID_REGISTRAR ------------------- PBX
REG
Contact: (no expire)
Expires: 300
REG
Contact: ( no expire)
Expires: 3600
Seems ok!..
But in another scenario I have:
UAC ------------- MID_REGISTRAR ------------------- PBX
REG
Contact: (expire=600)
Expires: 600
REG
Contact: (no expire)
Expires: 600
I’m not getting why the mid_registrar does not modified the outgoing
Expires to the PBX to 3600. Anyone has a clue about this?
Part of the configuration is:
### MID_REGISTRAR module
loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 2) /* 0 = mirror / 1 = ct / 2 = AoR */
modparam("mid_registrar", "outgoing_expires", 3600)
modparam("mid_registrar", "contact_id_insertion", "ct-param")
modparam("mid_registrar", "max_contacts", 6)
modparam("mid_registrar", "received_avp", "$avp(rcv)")
modparam("mid_registrar", "extra_contact_params_avp",
"$avp(extra_ct_params)")
if (( is_method("REGISTER")) && (!has_totag())) {
mid_registrar_save("location","M<rinstance>");
switch($retcode) {
case 1:
$du = $var(r_pbx_sethost);
xlog("[$ci] [from_vex] [REGISTER sin
totag][mid_registrar_save]: Retorna valor 1\n");
xlog("[$ci] [from_vex] [REGISTER sin
totag][mid_registrar_save]: $fu salvado en tabla location\n");
t_relay(,$var(r_pbx_send));
xlog("[$ci] [from_vex] [REGISTER sin
totag][mid_registrar_save]: Redirecting $rm to destination
[$var(r_pbx)]\n");
exit;
case 2:
xlog("[$ci] [from_vex] [REGISTER sin
totag][mid_registrar_save]: Retorna valor 2\n");
xlog("[$ci] [from_vex] [REGISTER sin
totag][mid_registrar_save]: Absorbiendo $rm from $si to domain $rd\n");
break;
default:
xlog("[$ci] [from_vex] [REGISTER sin
totag][mid_registrar_save]: Retorna valor -2\n");
xlog("[$ci] [from_vex] [REGISTER sin
totag][mid_registrar_save]: SECURITY: No se puede salvar localmente el
registro desde [$si] a dominio [$rd]\n");
send_reply(503,"MID Register Failed");
exit;
}
}
Beside of that subsequest REGISTER from that endpoint are route to the PBX
instead of absorve the REGISTERS. Could this be related??
Thanks!
Ricardo
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>