<div dir="ltr"><div dir="ltr"><div>Hello,</div><div><br></div><div>I'm using the following code in opensips.config</div><div><br></div><div>#############################################################################################<br> # absorb retransmissions, but do not create transaction<br> t_check_trans();<br><br> if (is_method("REGISTER")) {<br> uac_replace_to(,"sip:user1@asterisk1.local");<br> uac_replace_from(,"sip:user1@asterisk1.local");<br> mid_registrar_save("location","m");<br> switch ($retcode) {<br> case 1:<br> $ru = "sip:asterisk1.local";<br> t_on_reply("main_reg_replies");<br> t_relay();<br> break;<br> case 2:<br> #xlog("[LOG] absorbing REGISTER! ($$ci=$ci)\n");<br> break;<br> default:<br> xlog("[LOG] failed to save registration! ($$ci=$ci)\n");<br> }<br> exit;<br> }<br><br> if ( is_method("INVITE|MESSAGE|CANCEL|BYE|NOTIFY") && ($si != "IP_ASTERISK1" || $sp != 5060) ) {<br> $ru = "sip:" + $tU + "@asterisk1.local";<br> }<br>#############################################################################################<br><br><br><b>U 2022/03/28 21:52:40.848274 IP_CLIENT:19606 -> IP_OPENSIPS:5060 #1</b><br>REGISTER sip:OPENSIPS SIP/2.0.<br>Via: SIP/2.0/UDP 192.168.11.1:19606;received=IP_CLIENT;rport=19606;branch=z9hG4bK-9p6796298349846258764r.<br>From: <sip:user1-asterisk@IP_OPENSIPS:5060>;tag=8g7970426010400195798m.<br>To: <sip:user1-asterisk@IP_OPENSIPS:5060>.<br>Call-ID: 6e6985069689257392584k25377rmwpR.<br>CSeq: 7319 REGISTER.<br>Max-Forwards: 70.<br>Authorization: Digest username="user1-asterisk",realm="asterisk",nonce="3aa213ca",uri="sip:IP_OPENSIPS:5060",response="89d2d2d37a0a348960a64f9caf40b96a",algorithm=MD5.<br>Contact: <<a href="http://sip:user1-asterisk@192.168.11.1:19606">sip:user1-asterisk@192.168.11.1:19606</a>>;expires=0.<br>Supported: replaces.<br>Content-Length: 0.<br><br><br><b>U 2022/03/28 21:52:40.853495 IP_OPENSIPS:5060 -> IP_ASTERISK1:5060 #2</b><br>REGISTER sip:asterisk1.local:5060 SIP/2.0.<br>Via: SIP/2.0/UDP IP_OPENSIPS:5060;branch=z9hG4bKd2e8.d0acd904.0.<br>Via: SIP/2.0/UDP 192.168.11.1:19606;received=IP_CLIENT;rport=19606;branch=z9hG4bK-9p6796298349846258764r.<br>From: <sip:user1@asterisk1.local>;tag=8g7970426010400195798m.<br>To: <sip:user1@asterisk1.local>.<br>Call-ID: 6e6985069689257392584k25377rmwpR.<br>CSeq: 7319 REGISTER.<br>Max-Forwards: 69.<br><font color="#ff0000">Authorization: Digest username="user1-asterisk"</font>,realm="asterisk",nonce="3aa213ca",uri="sip:IP_OPENSIPS:5060",response="89d2d2d37a0a348960a64f9caf40b96a",algorithm=MD5.<br>Contact: <sip:user1-asterisk%40IP_OPENSIPS@IP_OPENSIPS:5060>;expires=0.<br>Supported: replaces.<br>Allow: ACK,PRACK,BYE,CANCEL,INVITE,UPDATE,MESSAGE,INFO,OPTIONS,SUBSCRIBE,NOTIFY,REFER.<br>Content-Length: 0.<br></div><div><br></div><div>Please help me how to modify Digest username="user1"</div><div><br></div><div>thanks</div><div>Andrei</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 28, 2022 at 10:55 AM Andrei G. <<a href="mailto:andreigrav@gmail.com">andreigrav@gmail.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">Hi,<div><br></div><div>How do I modify the field "Authorization: Digest username" in REGISTER packet?</div><div><br></div><div>tried with uac_replace_to(,"user@asterisk1") and uac_replace_from(,"user@asterisk1") but it does affect only to and from headers not digest username</div><div><br></div><div>thanks</div><div>Andrei</div><div><h3 style="overflow:hidden;white-space:nowrap;font-size:0.75rem;font-weight:inherit;margin:inherit;text-overflow:ellipsis;font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;letter-spacing:0.3px;color:rgb(95,99,104);line-height:20px"><br></h3></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 24, 2022 at 4:20 AM Artiom Druz <<a href="mailto:artiom.druz@gmail.com" target="_blank">artiom.druz@gmail.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="auto"><div>Hello, Andrei.</div><div dir="auto">You can do that by taking $tU (user from "To" header) and using some transformation function. In your example can be used s.select function. (<a href="https://www.opensips.org/Documentation/Script-Tran-3-2#toc7" target="_blank">https://www.opensips.org/Documentation/Script-Tran-3-2#toc7</a>)</div><div dir="auto"><br></div><div dir="auto">Best regards,</div><div dir="auto">Artiom Druz</div><div dir="auto"><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">ср, 23 мар. 2022 г., 21:11 Andrei G. <<a href="mailto:andreigrav@gmail.com" target="_blank">andreigrav@gmail.com</a>>:<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>I successfully tested opensips with mid_registrar for one domain</div><div><br></div><div>Is it possible to use opensips in front of 2 asterisk boxes and redirect registrations based on a prefix username, not domain prefix? </div><div><br></div><div>Something like </div><div>asterisk1-user@mid-registrar.domain - where opensips manage registration for user@asterisk1</div><div><div>asterisk2-user@mid-registrar.domain - where opensips manage registration for user@asterisk2</div><div><br></div></div><div>Regards</div><div>Andrei G.</div><div><br></div></div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" rel="noreferrer" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div></div></div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div>
</blockquote></div></div>