Dear,
I am expecting to send a MESSAGE METHOD to a softphone supporting MESSAGE.
route[SEND_MESSAGE_METHOD]{ $uac_req(method)="MESSAGE";
$uac_req(ruri)="sip:192.168.1.29:5066";
$uac_req(furi)="sip:192.168.1.41:5066"; //
$uac_req(turi)="sip:9919995@192.168.1.24:5066";
$uac_req(callid)=$(mb{s.md5}); $uac_req(hdrs)="Subject: Emergency
Alert\r\n"; $uac_req(hdrs)=$uac_req(hdrs) + "Content-Type:
text/plain\r\n"; $uac_req(body)="Emergency Message";
$uac_req(evroute)=1; uac_req_send(); } event_route[uac:reply] {
xlog("MY_SEVERITY"," -- MESSAGE PROCESSING - received reply code is:
$uac_req(evcode)\n");}
My use case is to send message from KAMAILIO -> SOFTPHONE
kamailio : sip:192.168.1.41:5066 (physical ip address of the kamailio)
softphone : sip:192.168.1.29:5066 (physical ip address of the softphone)
$uac_req(ruri)="sip:192.168.1.29:5066";
$uac_req(furi)="sip:192.168.1.41:5066"; //
$uac_req(turi)="sip:9919995@192.168.1.24:5066";
The sip capture :
2022/03/18 02:20:58.947603 192.168.1.29:5066 -> 192.168.1.41:5066
MESSAGE sip:192.168.1.41:5066@192.168.1.41:5066 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.29:5066;branch=z9hG4bKPj40bcc72324d647f8b96fc783e181f611
Max-Forwards: 70
From: "codec7-private"
<sip:9919997@192.168.1.41>;tag=416038ac55514b439a5cd5894770c3d8
To: <sip:192.168.1.41:5066@192.168.1.41>
Call-ID: 9381648157be49ff845b5e413dc9a95c
CSeq: 9148 MESSAGE
User-Agent: MicroSIP/3.20.7
Content-Type: text/plain
Content-Length: 3
;-)
2022/03/18 02:20:58.948822 192.168.1.41:5066 -> 192.168.1.29:5066
SIP/2.0 200 Stored
Via: SIP/2.0/UDP
192.168.1.29:5066;branch=z9hG4bKPj40bcc72324d647f8b96fc783e181f611;rport=5066
From: "codec7-private"
<sip:9919997@192.168.1.41>;tag=416038ac55514b439a5cd5894770c3d8
To:
<sip:192.168.1.41:5066@192.168.1.41>;tag=cbfe6543b9079987bce3b5b9a0d1195a.b63b503b
Call-ID: 9381648157be49ff845b5e413dc9a95c
CSeq: 9148 MESSAGE
Server: kamailio (5.5.4 (x86_64/linux))
Content-Length: 0
Now, if I want to use his username@domain
kamailio : sip:192.168.1.41:5066 (physical ip address of the kamailio)
softphone : sip:9919997@192.168.1.41:5066
The message is sent to kamailio itself not to the softphone
2022/03/18 02:30:39.285927 192.168.1.41:5060 -> 192.168.1.41:5066
MESSAGE sip:9919997@192.168.1.41:5066 SIP/2.0
Via: SIP/2.0/UDP
xxx.xxx.xxx.210:5060;branch=z9hG4bK0cb8.a39b5180000000000000000000000000.0
To: <sip:9919997@192.168.1.41:5066>
From: <sip:192.168.1.41:5066>;tag=b4685c5f5f5fc30f8dcbb49a48fe9e25-4047894c
CSeq: 10 MESSAGE
Call-ID: 4cb973823835008ec4b20d1c67d9fb84
Max-Forwards: 70
Content-Length: 17
User-Agent: kamailio (5.5.4 (x86_64/linux))
Subject: Emergency Alert
Content-Type: text/plain
Emergency Message
2022/03/18 02:30:39.287590 192.168.1.41:5066 -> 192.168.1.41:5060
SIP/2.0 200 Stored
Via: SIP/2.0/UDP
xxx.xxx.xxx.210:5060;branch=z9hG4bK0cb8.a39b5180000000000000000000000000.0;rport=5060;received=192.168.1.41
To: <sip:9919997@192.168.1.41:5066>;tag=cbfe6543b9079987bce3b5b9a0d1195a.76a88393
From: <sip:192.168.1.41:5066>;tag=b4685c5f5f5fc30f8dcbb49a48fe9e25-4047894c
CSeq: 10 MESSAGE
Call-ID: 4cb973823835008ec4b20d1c67d9fb84
Server: kamailio (5.5.4 (x86_64/linux))
Content-Length: 0
- finaly, how to relay the message from one softphone to another softphone through
kamailio proxy?
Best Regards
--
Youssef
Show replies by date
Finally,
Send Message : Softphone 1 -> Kamailio -> Softphone 2
I fixed myself the issue to forward the MESSAGE through kamailio and get reply correct
status.
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 ?
Best Regards
On Friday, March 18, 2022 03:18 CET, "Youssef Boujraf"
<yboujraf(a)by-research.be> wrote:
Dear,
I am expecting to send a MESSAGE METHOD to a softphone supporting MESSAGE.
route[SEND_MESSAGE_METHOD]{ $uac_req(method)="MESSAGE";
$uac_req(ruri)="sip:192.168.1.29:5066";
$uac_req(furi)="sip:192.168.1.41:5066"; //
$uac_req(turi)="sip:9919995@192.168.1.24:5066";
$uac_req(callid)=$(mb{s.md5}); $uac_req(hdrs)="Subject: Emergency
Alert\r\n"; $uac_req(hdrs)=$uac_req(hdrs) + "Content-Type:
text/plain\r\n"; $uac_req(body)="Emergency Message";
$uac_req(evroute)=1; uac_req_send(); } event_route[uac:reply] {
xlog("MY_SEVERITY"," -- MESSAGE PROCESSING - received reply code is:
$uac_req(evcode)\n");}
My use case is to send message from KAMAILIO -> SOFTPHONE
kamailio : sip:192.168.1.41:5066 (physical ip address of the kamailio)
softphone : sip:192.168.1.29:5066 (physical ip address of the softphone)
$uac_req(ruri)="sip:192.168.1.29:5066";
$uac_req(furi)="sip:192.168.1.41:5066"; //
$uac_req(turi)="sip:9919995@192.168.1.24:5066";
The sip capture :
2022/03/18 02:20:58.947603 192.168.1.29:5066 -> 192.168.1.41:5066
MESSAGE sip:192.168.1.41:5066@192.168.1.41:5066 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.29:5066;branch=z9hG4bKPj40bcc72324d647f8b96fc783e181f611
Max-Forwards: 70
From: "codec7-private"
<sip:9919997@192.168.1.41>;tag=416038ac55514b439a5cd5894770c3d8
To: <sip:192.168.1.41:5066@192.168.1.41>
Call-ID: 9381648157be49ff845b5e413dc9a95c
CSeq: 9148 MESSAGE
User-Agent: MicroSIP/3.20.7
Content-Type: text/plain
Content-Length: 3
;-)
2022/03/18 02:20:58.948822 192.168.1.41:5066 -> 192.168.1.29:5066
SIP/2.0 200 Stored
Via: SIP/2.0/UDP
192.168.1.29:5066;branch=z9hG4bKPj40bcc72324d647f8b96fc783e181f611;rport=5066
From: "codec7-private"
<sip:9919997@192.168.1.41>;tag=416038ac55514b439a5cd5894770c3d8
To:
<sip:192.168.1.41:5066@192.168.1.41>;tag=cbfe6543b9079987bce3b5b9a0d1195a.b63b503b
Call-ID: 9381648157be49ff845b5e413dc9a95c
CSeq: 9148 MESSAGE
Server: kamailio (5.5.4 (x86_64/linux))
Content-Length: 0
Now, if I want to use his username@domain
kamailio : sip:192.168.1.41:5066 (physical ip address of the kamailio)
softphone : sip:9919997@192.168.1.41:5066
The message is sent to kamailio itself not to the softphone
2022/03/18 02:30:39.285927 192.168.1.41:5060 -> 192.168.1.41:5066
MESSAGE sip:9919997@192.168.1.41:5066 SIP/2.0
Via: SIP/2.0/UDP
xxx.xxx.xxx.210:5060;branch=z9hG4bK0cb8.a39b5180000000000000000000000000.0
To: <sip:9919997@192.168.1.41:5066>
From: <sip:192.168.1.41:5066>;tag=b4685c5f5f5fc30f8dcbb49a48fe9e25-4047894c
CSeq: 10 MESSAGE
Call-ID: 4cb973823835008ec4b20d1c67d9fb84
Max-Forwards: 70
Content-Length: 17
User-Agent: kamailio (5.5.4 (x86_64/linux))
Subject: Emergency Alert
Content-Type: text/plain
Emergency Message
2022/03/18 02:30:39.287590 192.168.1.41:5066 -> 192.168.1.41:5060
SIP/2.0 200 Stored
Via: SIP/2.0/UDP
xxx.xxx.xxx.210:5060;branch=z9hG4bK0cb8.a39b5180000000000000000000000000.0;rport=5060;received=192.168.1.41
To: <sip:9919997@192.168.1.41:5066>;tag=cbfe6543b9079987bce3b5b9a0d1195a.76a88393
From: <sip:192.168.1.41:5066>;tag=b4685c5f5f5fc30f8dcbb49a48fe9e25-4047894c
CSeq: 10 MESSAGE
Call-ID: 4cb973823835008ec4b20d1c67d9fb84
Server: kamailio (5.5.4 (x86_64/linux))
Content-Length: 0
- finaly, how to relay the message from one softphone to another softphone through
kamailio proxy?
Best Regards
--
Youssef
hello,
generally speaking, from and to Header are not used for routing sip request.
in kamailio the relayed request is based on ip:port of request uri ($ru pseudo var ) or
destination ($du var ).
so the ip:port of the next element to reach must be in $ru or $du.
in your case it is in the ruri.
________________________________
De : sr-users <sr-users-bounces(a)lists.kamailio.org> de la part de Youssef Boujraf
<yboujraf(a)by-research.be>
Envoyé : vendredi 18 mars 2022 17:40
À : sr-users(a)lists.kamailio.org <sr-users(a)lists.kamailio.org>
Objet : Re: [SR-Users] MESSAGE METHOD - Send message to a softphone - $uac_req
Finally,
Send Message : Softphone 1 -> Kamailio -> Softphone 2
I fixed myself the issue to forward the MESSAGE through kamailio and get reply correct
status.
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 ?
Best Regards
On Friday, March 18, 2022 03:18 CET, "Youssef Boujraf"
<yboujraf(a)by-research.be> wrote:
Dear,
I am expecting to send a MESSAGE METHOD to a softphone supporting MESSAGE.
route[SEND_MESSAGE_METHOD]{
$uac_req(method)="MESSAGE";
$uac_req(ruri)="sip:192.168.1.29:5066";
$uac_req(furi)="sip:192.168.1.41:5066";
// $uac_req(turi)="sip:9919995@192.168.1.24:5066";
$uac_req(callid)=$(mb{s.md5});
$uac_req(hdrs)="Subject: Emergency Alert\r\n";
$uac_req(hdrs)=$uac_req(hdrs) + "Content-Type: text/plain\r\n";
$uac_req(body)="Emergency Message";
$uac_req(evroute)=1;
uac_req_send();
}
event_route[uac:reply] {
xlog("MY_SEVERITY"," -- MESSAGE PROCESSING - received reply code is:
$uac_req(evcode)\n");
}
My use case is to send message from KAMAILIO -> SOFTPHONE
kamailio : sip:192.168.1.41:5066 (physical ip address of the kamailio)
softphone : sip:192.168.1.29:5066 (physical ip address of the softphone)
$uac_req(ruri)="sip:192.168.1.29:5066";
$uac_req(furi)="sip:192.168.1.41:5066";
// $uac_req(turi)="sip:9919995@192.168.1.24:5066";
The sip capture :
2022/03/18 02:20:58.947603 192.168.1.29:5066 -> 192.168.1.41:5066
MESSAGE sip:192.168.1.41:5066@192.168.1.41:5066 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.29:5066;branch=z9hG4bKPj40bcc72324d647f8b96fc783e181f611
Max-Forwards: 70
From: "codec7-private"
<sip:9919997@192.168.1.41>;tag=416038ac55514b439a5cd5894770c3d8
To: <sip:192.168.1.41:5066@192.168.1.41>
Call-ID: 9381648157be49ff845b5e413dc9a95c
CSeq: 9148 MESSAGE
User-Agent: MicroSIP/3.20.7
Content-Type: text/plain
Content-Length: 3
;-)
2022/03/18 02:20:58.948822 192.168.1.41:5066 -> 192.168.1.29:5066
SIP/2.0 200 Stored
Via: SIP/2.0/UDP
192.168.1.29:5066;branch=z9hG4bKPj40bcc72324d647f8b96fc783e181f611;rport=5066
From: "codec7-private"
<sip:9919997@192.168.1.41>;tag=416038ac55514b439a5cd5894770c3d8
To:
<sip:192.168.1.41:5066@192.168.1.41>;tag=cbfe6543b9079987bce3b5b9a0d1195a.b63b503b
Call-ID: 9381648157be49ff845b5e413dc9a95c
CSeq: 9148 MESSAGE
Server: kamailio (5.5.4 (x86_64/linux))
Content-Length: 0
Now, if I want to use his username@domain
kamailio : sip:192.168.1.41:5066 (physical ip address of the kamailio)
softphone : sip:9919997@192.168.1.41:5066
The message is sent to kamailio itself not to the softphone
2022/03/18 02:30:39.285927 192.168.1.41:5060 -> 192.168.1.41:5066
MESSAGE sip:9919997@192.168.1.41:5066 SIP/2.0
Via: SIP/2.0/UDP
xxx.xxx.xxx.210:5060;branch=z9hG4bK0cb8.a39b5180000000000000000000000000.0
To: <sip:9919997@192.168.1.41:5066>
From: <sip:192.168.1.41:5066>;tag=b4685c5f5f5fc30f8dcbb49a48fe9e25-4047894c
CSeq: 10 MESSAGE
Call-ID: 4cb973823835008ec4b20d1c67d9fb84
Max-Forwards: 70
Content-Length: 17
User-Agent: kamailio (5.5.4 (x86_64/linux))
Subject: Emergency Alert
Content-Type: text/plain
Emergency Message
2022/03/18 02:30:39.287590 192.168.1.41:5066 -> 192.168.1.41:5060
SIP/2.0 200 Stored
Via: SIP/2.0/UDP
xxx.xxx.xxx.210:5060;branch=z9hG4bK0cb8.a39b5180000000000000000000000000.0;rport=5060;received=192.168.1.41
To: <sip:9919997@192.168.1.41:5066>;tag=cbfe6543b9079987bce3b5b9a0d1195a.76a88393
From: <sip:192.168.1.41:5066>;tag=b4685c5f5f5fc30f8dcbb49a48fe9e25-4047894c
CSeq: 10 MESSAGE
Call-ID: 4cb973823835008ec4b20d1c67d9fb84
Server: kamailio (5.5.4 (x86_64/linux))
Content-Length: 0
- finaly, how to relay the message from one softphone to another softphone through
kamailio proxy?
Best Regards
--
Youssef
Dear, then could I use to retrieve the user from location then set the ruri
? $var(uri1)="sip:9919995@192.168.1.41";lookup("location","$var(uri1)"); $uac_req(ruri)=$ru; Best
Regards
Youssef