<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
hello,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
generally speaking, from and to Header are not used for routing sip request.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
in kamailio the relayed request is based on ip:port of request uri ($ru pseudo var ) or destination ($du var ).</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
so the ip:port of the next element to reach must be in $ru or $du.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
in your case it is in the ruri.</div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>De :</b> sr-users <sr-users-bounces@lists.kamailio.org> de la part de Youssef Boujraf <yboujraf@by-research.be><br>
<b>Envoyé :</b> vendredi 18 mars 2022 17:40<br>
<b>À :</b> sr-users@lists.kamailio.org <sr-users@lists.kamailio.org><br>
<b>Objet :</b> Re: [SR-Users] MESSAGE METHOD - Send message to a softphone - $uac_req</font>
<div> </div>
</div>
<div>Finally,<br>
<br>
Send Message : Softphone 1 -> Kamailio -> Softphone 2<br>
<br>
I fixed myself the issue to forward the MESSAGE through kamailio and get reply correct status.<br>
<br>
Now just need some understanding why on a message generated from Kamailio, I need to reach the physical ip address of the callee instead of this contact fe : 9919995@domain ?<br>
<br>
Best Regards<br>
<br>
<br>
On Friday, March 18, 2022 03:18 CET, "Youssef Boujraf" <yboujraf@by-research.be> wrote:<br>
 
<blockquote type="cite"> </blockquote>
Dear,<br>
<br>
I am expecting to send a MESSAGE METHOD to a softphone supporting MESSAGE.<br>
 
<div style="color:#d4d4d4; background-color:#1e1e1e; font-family:Consolas,'Courier New',monospace; font-weight:normal; font-size:14px; line-height:19px; white-space:pre">
<div><span style="color:#4ec9b0">route</span><span style="color:#dcdcaa">[SEND_MESSAGE_METHOD]</span><span style="color:#d4d4d4">{</span></div>
<div>
<div style="color:#d4d4d4; background-color:#1e1e1e; font-family:Consolas,'Courier New',monospace; font-weight:normal; font-size:14px; line-height:19px; white-space:pre">
<div><span style="color:#d4d4d4">        </span><span style="color:#9cdcfe">$uac_req(method)</span><span style="color:#d4d4d4">=</span><span style="color:#ce9178">"MESSAGE"</span><span style="color:#d4d4d4">;</span></div>
<div><span style="color:#d4d4d4">        </span><span style="color:#9cdcfe">$uac_req(ruri)</span><span style="color:#d4d4d4">=</span><span style="color:#ce9178">"sip:192.168.1.29:5066"</span><span style="color:#d4d4d4">;</span></div>
<div><span style="color:#d4d4d4">        </span><span style="color:#9cdcfe">$uac_req(furi)</span><span style="color:#d4d4d4">=</span><span style="color:#ce9178">"sip:192.168.1.41:5066"</span><span style="color:#d4d4d4">;</span></div>
<div><span style="color:#d4d4d4">        </span><span style="color:#6a9955">// $uac_req(turi)="sip:9919995@192.168.1.24:5066";</span></div>
<div><span style="color:#d4d4d4">        </span><span style="color:#9cdcfe">$uac_req(callid)</span><span style="color:#d4d4d4">=</span><span style="color:#9cdcfe">$(mb</span><span style="color:#dcdcaa">{s.md5}</span><span style="color:#9cdcfe">)</span><span style="color:#d4d4d4">;</span></div>
<div><span style="color:#d4d4d4">        </span><span style="color:#9cdcfe">$uac_req(hdrs)</span><span style="color:#d4d4d4">=</span><span style="color:#ce9178">"Subject: Emergency Alert</span><span style="color:#d7ba7d">\r\n</span><span style="color:#ce9178">"</span><span style="color:#d4d4d4">;</span></div>
<div><span style="color:#d4d4d4">        </span><span style="color:#9cdcfe">$uac_req(hdrs)</span><span style="color:#d4d4d4">=</span><span style="color:#9cdcfe">$uac_req(hdrs)</span><span style="color:#d4d4d4"> +
</span><span style="color:#ce9178">"Content-Type: text/plain</span><span style="color:#d7ba7d">\r\n</span><span style="color:#ce9178">"</span><span style="color:#d4d4d4">;</span></div>
<div><span style="color:#d4d4d4">        </span><span style="color:#9cdcfe">$uac_req(body)</span><span style="color:#d4d4d4">=</span><span style="color:#ce9178">"Emergency Message"</span><span style="color:#d4d4d4">;</span></div>
<div><span style="color:#d4d4d4">        </span><span style="color:#9cdcfe">$uac_req(evroute)</span><span style="color:#d4d4d4">=</span><span style="color:#b5cea8">1</span><span style="color:#d4d4d4">;</span></div>
<div><span style="color:#d4d4d4">        uac_req_send();</span></div>
</div>
</div>
 
<div><span style="color:#d4d4d4">}</span></div>
 
<div><span style="color:#4ec9b0">event_route</span><span style="color:#dcdcaa">[uac:reply]</span><span style="color:#d4d4d4"> {</span></div>
<div><span style="color:#d4d4d4">    xlog(</span><span style="color:#ce9178">"MY_SEVERITY"</span><span style="color:#d4d4d4">,</span><span style="color:#ce9178">" -- MESSAGE PROCESSING - received reply code is: $uac_req(evcode)</span><span style="color:#d7ba7d">\n</span><span style="color:#ce9178">"</span><span style="color:#d4d4d4">);</span></div>
<div><span style="color:#d4d4d4">}</span></div>
</div>
<br>
My use case is to send message from KAMAILIO -> SOFTPHONE<br>
<br>
kamailio : sip:192.168.1.41:5066 (physical ip address of the kamailio)<br>
softphone : sip:192.168.1.29:5066 (physical ip address of the softphone)<br>
 
<div style="color:#d4d4d4; background-color:#1e1e1e; font-family:Consolas,'Courier New',monospace; font-weight:normal; font-size:14px; line-height:19px; white-space:pre">
<div><span style="color:#d4d4d4">        </span><span style="color:#9cdcfe">$uac_req(ruri)</span><span style="color:#d4d4d4">=</span><span style="color:#ce9178">"sip:192.168.1.29:5066"</span><span style="color:#d4d4d4">;</span></div>
<div><span style="color:#d4d4d4">        </span><span style="color:#9cdcfe">$uac_req(furi)</span><span style="color:#d4d4d4">=</span><span style="color:#ce9178">"sip:192.168.1.41:5066"</span><span style="color:#d4d4d4">;</span></div>
<div><span style="color:#d4d4d4">        </span><span style="color:#6a9955">// $uac_req(turi)="sip:9919995@192.168.1.24:5066";</span></div>
</div>
<br>
<br>
The sip capture :<br>
<br>
2022/03/18 02:20:58.947603 192.168.1.29:5066 -> 192.168.1.41:5066<br>
MESSAGE sip:192.168.1.41:5066@192.168.1.41:5066 SIP/2.0<br>
Via: SIP/2.0/UDP 192.168.1.29:5066;branch=z9hG4bKPj40bcc72324d647f8b96fc783e181f611<br>
Max-Forwards: 70<br>
From: "codec7-private" <sip:9919997@192.168.1.41>;tag=416038ac55514b439a5cd5894770c3d8<br>
To: <sip:192.168.1.41:5066@192.168.1.41><br>
Call-ID: 9381648157be49ff845b5e413dc9a95c<br>
CSeq: 9148 MESSAGE<br>
User-Agent: MicroSIP/3.20.7<br>
Content-Type: text/plain<br>
Content-Length:     3<br>
<br>
;-)<br>
<br>
2022/03/18 02:20:58.948822 192.168.1.41:5066 -> 192.168.1.29:5066<br>
SIP/2.0 200 Stored<br>
Via: SIP/2.0/UDP 192.168.1.29:5066;branch=z9hG4bKPj40bcc72324d647f8b96fc783e181f611;rport=5066<br>
From: "codec7-private" <sip:9919997@192.168.1.41>;tag=416038ac55514b439a5cd5894770c3d8<br>
To: <sip:192.168.1.41:5066@192.168.1.41>;tag=cbfe6543b9079987bce3b5b9a0d1195a.b63b503b<br>
Call-ID: 9381648157be49ff845b5e413dc9a95c<br>
CSeq: 9148 MESSAGE<br>
Server: kamailio (5.5.4 (x86_64/linux))<br>
Content-Length: 0<br>
<br>
<br>
Now, if I want to use his username@domain<br>
<br>
kamailio : sip:192.168.1.41:5066 (physical ip address of the kamailio)<br>
softphone : sip:9919997@192.168.1.41:5066<br>
<br>
The message is sent to kamailio itself not to the softphone<br>
<br>
2022/03/18 02:30:39.285927 192.168.1.41:5060 -> 192.168.1.41:5066<br>
MESSAGE sip:9919997@192.168.1.41:5066 SIP/2.0<br>
Via: SIP/2.0/UDP xxx.xxx.xxx.210:5060;branch=z9hG4bK0cb8.a39b5180000000000000000000000000.0<br>
To: <sip:9919997@192.168.1.41:5066><br>
From: <sip:192.168.1.41:5066>;tag=b4685c5f5f5fc30f8dcbb49a48fe9e25-4047894c<br>
CSeq: 10 MESSAGE<br>
Call-ID: 4cb973823835008ec4b20d1c67d9fb84<br>
Max-Forwards: 70<br>
Content-Length: 17<br>
User-Agent: kamailio (5.5.4 (x86_64/linux))<br>
Subject: Emergency Alert<br>
Content-Type: text/plain<br>
<br>
Emergency Message<br>
<br>
2022/03/18 02:30:39.287590 192.168.1.41:5066 -> 192.168.1.41:5060<br>
SIP/2.0 200 Stored<br>
Via: SIP/2.0/UDP xxx.xxx.xxx.210:5060;branch=z9hG4bK0cb8.a39b5180000000000000000000000000.0;rport=5060;received=192.168.1.41<br>
To: <sip:9919997@192.168.1.41:5066>;tag=cbfe6543b9079987bce3b5b9a0d1195a.76a88393<br>
From: <sip:192.168.1.41:5066>;tag=b4685c5f5f5fc30f8dcbb49a48fe9e25-4047894c<br>
CSeq: 10 MESSAGE<br>
Call-ID: 4cb973823835008ec4b20d1c67d9fb84<br>
Server: kamailio (5.5.4 (x86_64/linux))<br>
Content-Length: 0<br>
<br>
<br>
- finaly, how to relay the message from one softphone to another softphone through kamailio proxy?<br>
<br>
Best Regards<br>
<br>
--<br>
<span style="font-size:11pt"><span style="font-family:Calibri,sans-serif"><b><span lang="EN-US" style="font-size:10.0pt"><span style="font-family:"Verdana",sans-serif"><span style="color:#1f497d">Youssef
</span></span></span></b></span></span><br>
<br>
  </div>
</body>
</html>