<div dir="ltr">you can try my MSRP proxy code<div><br></div><div>[<font color="#0000ff" face="monospace">root@proxy-us-west-2-intrado-1 ~]# cat /etc/kamailio/msrp-proxy.cfg <br>tcp_accept_no_cl=yes<br>tcp_connection_lifetime=1810<br><br>loadmodule "msrp.so"<br><br>modparam("htable", "htable", "msrp=>size=16;")<br># "msrpcallid" table we use to be pass MSRP session related to call<br>modparam("htable", "htable", "msrpcallid=>size=16;")<br><br>route[MSRP_INJECT_PROXY]<br>{<br> if (!sdp_with_media("message")) {<br> return;<br> }<br><br> $avp(sessid) = $sht(msrpcallid=>$ci::sessid);<br> if( $avp(sessid) == $null) {<br> $var(cnt) = $var(cnt) + 1;<br> pv_printf("$avp(sessid)", "s.$(pp).$(var(cnt)).$(RANDOM)");<br> $sht(msrpcallid=>$ci::sessid) = $avp(sessid);<br> }<br><br> xlog("L_INFO", "$ci|log|injecting Kamailio in MSRP path with session_id: $avp(sessid)\n");<br> search_append_body("a=path:msrps://", $RAi + ":2856/" + $avp(sessid) + ";tcp msrps://");<br> search_append_body("a=path:msrp://", $RAi + ":2855/" + $avp(sessid) + ";tcp msrp://");<br><br> if (!isflagset(FLAG_SESSION_PROGRESS)) {<br> $sht(msrp=>$avp(sessid)::call_id) = $ci;<br> }<br>}<br><br>event_route[msrp:frame-in] {<br> msrp_reply_flags("1");<br><br> $avp(sessid) = $msrp(sessid);<br><br> if (msrp_is_reply()) {<br> route(UPDATE_MSRP_CONNECTION_DATA);<br> } else if ($msrp(method)=="SEND" || $msrp(method)=="REPORT") {<br> if ($msrp(nexthops)>1) {<br> if ($msrp(method)!="REPORT") {<br> msrp_reply("200", "OK");<br> }<br> msrp_relay();<br> exit;<br> }<br><br> xlog("L_INFO", "$ci|log|Status of MSRP caller session_id: $avp(sessid)\n");<br> if($sht(msrp=>$avp(sessid)::call_id) == $null) {<br> if ($msrp(method)!="REPORT") {<br> msrp_reply("481", "Session-does-not-exist");<br> }<br> exit;<br> } else if($msrp(method)!="REPORT") {<br> msrp_reply("200", "OK");<br> }<br><br> route(UPDATE_MSRP_CONNECTION_DATA);<br> } else {<br> msrp_reply("501", "Request-method-not-understood");<br> }<br>}<br><br>route[UPDATE_MSRP_CONNECTION_DATA] {<br> # Updating current connection data for responses<br> $sht(msrp=>$msrp(prevhop)::srcaddr) = $msrp(srcaddr);<br> $sht(msrp=>$msrp(prevhop)::srcsock) = $msrp(srcsock);<br><br> # Try get destination connection data<br> $avp(srcaddr) = $sht(msrp=>$msrp(nexthop)::srcaddr);<br> $avp(srcsock) = $sht(msrp=>$msrp(nexthop)::srcsock);<br> xlog("L_INFO", "$ci|log|destination connection data, srcaddr $avp(srcaddr), srcsock $avp(srcsock)\n");<br><br> if ($avp(srcaddr) == $null || $avp(srcsock) == $null) {<br> xlog("L_INFO", "$ci|log|no destination msrp connection data, try relay message for session_id: $avp(sessid)\n");<br> msrp_relay();<br> exit;<br> }<br> msrp_relay_flags("1");<br> msrp_set_dst("$avp(srcaddr)", "$avp(srcsock)");<br> xlog("L_INFO", "$ci|log|relaying msrp message for session_id '$var(sessid)' via socket $avp(srcsock) to $avp(srcaddr)\n");<br> msrp_relay();<br>}</font><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 31, 2020 at 4:10 PM Sefa Cebe <<a href="mailto:sefacebe1@gmail.com">sefacebe1@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"><div>Of course, I added the following lines to original kamailio.cfg file. My aim was to change nexthop or change destination address which comes inside msrp frame. If I could do this, I can send MSRP messages to wherever I wanted. However, It doesn't let me to manipulate the variables inside msrp frame. By doing $msrp(nexthop) = something or using msrp_set_dst function.<br></div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>#$msrp(nexthop) = ("msrp://<a href="http://192.168.1.100:30000/r02XBu00;tcp" target="_blank">192.168.1.100:30000/r02XBu00;tcp</a>");</div><div> #xdbg("============ nexthop after modify\n");</div><div> #xdbg("============ nexthop: [$msrp(nexthop)]\n");</div><div> #msrp_set_dst("msrp://<a href="http://192.168.1.100:30001" target="_blank">192.168.1.100:30001</a>","tcp:<a href="http://192.168.1.110:64066" target="_blank">192.168.1.110:64066</a>");</div><div> xdbg("============test===========\n");</div><div> #$sht(msrp(nexthop))="msrp://<a href="http://192.168.1.100:30001" target="_blank">192.168.1.100:30001</a>";</div><div> $sht(msrp=>$var(sessid)::nexthop) = ("msrp://<a href="http://192.168.1.100:30000/r02XBu00;tcp" target="_blank">192.168.1.100:30000/r02XBu00;tcp</a>");</div><div> xdbg("============ nexthop: [$msrp(nexthop)]\n");</div><div> xdbg("============checkcontrol\n");</div><div> msrp_relay();</div><div> msrp_reply("200", "OK");</div><div><br></div><div> exit;</div></blockquote><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Sergey Safarov <<a href="mailto:s.safarov@gmail.com" target="_blank">s.safarov@gmail.com</a>>, 31 Mar 2020 Sal, 04:26 tarihinde şunu yazdı:<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">Could you share your minimal config and related logs.<br>This will be interest for me to look.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 31, 2020 at 2:11 PM Sefa Cebe <<a href="mailto:sefacebe1@gmail.com" target="_blank">sefacebe1@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"><div>Hello, </div><div><br></div><div>I'm using Kamailio MSRP module as a MSRP relay, It works successfully when I send one-to-one MSRP messages. I am having trouble while sending msrp messages to multiple receivers. My question is that can I use this module to forward msrp messages not just one receiver, but multiple receivers? Can this module be used like MSRP switch? <br></div><div><br></div><div>Thanks in advance.</div><div><br></div></div>
_______________________________________________<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>
_______________________________________________<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></div>
_______________________________________________<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>