Hello,
Recently i have installed Homer capture server with kamailio. It works! but
in logs i am seeing many error like following, I am using Opensips 2.1
siptrace server to send all trace to Homer.
ERROR: sipcapture [hep.c:139]: hepv2_received(): ERROR:
sipcapture:hep_msg_received: unknow protocol [1]
ERROR: sipcapture [hep.c:139]: hepv2_received(): ERROR:
sipcapture:hep_msg_received: unknow protocol [1]
ERROR: sipcapture [hep.c:139]: hepv2_received(): ERROR:
sipcapture:hep_msg_received: unknow protocol [1]
Hello,
I'm trying to compile Kamailio 4.2.3 on Debian 7.8 with db_unixodbc but the sql.h file can't be found.
I've used the following command to compile and install unixODBC.
tar -zxvf unixODBC-2.3.2.tar.gz &&
cd unixODBC-2.3.2 &&
./configure --sysconfdir=/etc --prefix=/usr/local/unixODBC --disable-gui &&
make &&
make install
#####################: locate odbc_config
/usr/local/unixODBC/bin/odbc_config
/usr/src/unixODBC-2.3.2/exe/odbc_config
#####################: locate sql.h
/usr/local/unixODBC/include/sql.h
/usr/src/kamailio-4.2.3/modules/db_mysql/km_db_mysql.h
/usr/src/kamailio-4.2.3/modules/db_postgres/pg_sql.h
/usr/src/unixODBC-2.3.2/Drivers/Postgre7.1/isql.h
/usr/src/unixODBC-2.3.2/Drivers/nn/isql.h
/usr/src/unixODBC-2.3.2/Drivers/nn/nnsql.h
/usr/src/unixODBC-2.3.2/exe/isql.h
/usr/src/unixODBC-2.3.2/include/sql.h
Kamailio Compile Error
CC (gcc) [M db_unixodbc.so] connection.o
In file included from connection.c:34:0:
connection.h:42:17: fatal error: sql.h: No such file or directory
compilation terminated.
make[1]: *** [connection.o] Error 1
make: *** [modules] Error 1
Modules.lst
include_modules= carrierroute db_unixodbc dialog_ng lcr tls uuid
Removed these includes from the exclude_modules
Any ideas?
Hi,
We are deploying a VoIP system based on Kamailio. The system is composed of
load balancers, proxies, registrars, etc
What is the recommended transport protocol to use for internal communication
(i.e. load balancer <-> proxy/registrar)? We started with UDP but we also
see that Kamailio supports TCP and SCTP.
For information, at first stage, the UAs will communicate using UDP but we
may need to use TCP in case messages are too large (we had such issues when
using ICE).
Thanks,
Mickael
Hello Everyone,
In my case I am using Path and I asterisk generate NOTIFY with route based on path, then I see on kamailio side tries reach on client on public IP side and open new connection not follow ESTABLISHED/RELATED link then it times out.
Log:
Mar 23 11:00:17 canlvprx01 /usr/sbin/kamailio[20193]: INFO: <script>: [NOTIFY], Inbound connection from <10.18.130.51> traffic from Asterisk
Mar 23 11:00:17 canlvprx01 /usr/sbin/kamailio[20193]: INFO: <script>: [NOTIFY], Present Route: Client_public_IP.
Mar 23 11:00:28 canlvprx01 /usr/sbin/kamailio[20204]: ERROR: <core> [tcp_main.c:4338]: tcpconn_main_timeout(): connect Client_public_IP:5060 failed (timeout)
Here trace on kamailio side
http://fpaste.org/201813/15287114/
Here trace from soft phone client side.
http://fpaste.org/201814/14271530/
Slava.
From: "Alex Balashov" <abalashov(a)evaristesys.com>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Monday, March 23, 2015 6:42:59 PM
Subject: Re: [SR-Users] kamailio asterisk NOTIFY
Anthony,
The Contact presented by the subscriber in the initial subscription is:
m: "Test User"
<sip:172.16.4.7;line=sr-D8G7CE2.5PUeK-xuarl7NYDdNYDxNYlFUYoeUeQ8Cw.6DE2vDdyJDAa4TliwC84OC82LK-2ehwl7NYDdNYDxNYlFUAm6UYzm0gme>;+sip.ice
And the subsequent NOTIFY is correctly targeted to this RURI:
NOTIFY
sip:172.16.4.7;line=sr-D8G7CE2.5PUeK-xuarl7NYDdNYDxNYlFUYoeUeQ8Cw.6DE2vDdyJDAa4TliwC84OC82LK-2ehwl7NYDdNYDxNYlFUAm6UYzm0gme
SIP/2.0
The subscriber returns this Contact in the 200 OK response for the NOTIFY:
m: "Test User"
<sip:172.16.4.7;line=sr-D8G7CE2.5PUeK-xuarl7NYDdNYDxNYlFUYoeUeQ8Cw.6DE2vDdyJDAa4TliwC84O>;+sip.ice
And subsequent NOTIFYs appear to use this RURI instead of the original
Contact of the subscriber:
NOTIFY
sip:172.16.4.7;line=sr-D8G7CE2.5PUeK-xuarl7NYDdNYDxNYlFUYoeUeQ8Cw.6DE2vDdyJDAa4TliwC84O
SIP/2.0
NOTIFY
sip:172.16.4.7;line=sr-D8G7CE2.5PUeK-xuarl7NYDdNYDxNYlFUYoeUeQ8Cw.6DE2vDdyJDAa4TliwC84O
SIP/2.0
etc.
A SUBSCRIBE is a dialog-creating event, so in-dialog messages (e.g.
NOTIFYs) should be targeted at a Request URI corresponding to the
Contact URI of the SUBSCRIBE-er. It seems to me that this is the problem
here, rather than truncation.
--
Alex Balashov | Principal | Evariste Systems LLC
303 Perimeter Center North, Suite 300
Atlanta, GA 30346
United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
We have setup kamalio at server and it is working at some DNS with
call/chat.
At some IP chat is working but when we call then it is not working. At some
DNS(Net IP) it is working .
What can be problem at server?
Following is login for SIP test user:
tester1(a)23.253.110.48
123456
Host IP : 23.253.110.48
I have attached mu kamalio config file.
Let me know what we need to change at config file or server
Thanks
Been struggling with this for awhile now.
So far I am finding it rather difficult to come up with way to
authenticate SIP trunks taking into account all possible scenarios. My
setup is Kamailio combined with Asterisk realtime. Everything is in a
MySQL database. All authentication is done by Kamailio. Kamailio
handles SIP extension (user) authentication quite well but seems poorly
equipped for SIP trunk (peer) authentication. The biggest problem I
have run into so far is that SIP trunks typically use DNS names and
Kamailio is not at all designed to used DNS names. Also SIP trunks do
not use named "realms" whereas that is a key part of Kamailio
authentication.
For IP authentication about the only solution I have found is to DNS
lookup and save all returned IP addresses in the ip_addr mysql table.
Then I do:
#!ifdef WITH_IPAUTH
if((!is_method("REGISTER")) && allow_source_address() && $au == "") {
# source IP allowed
return;
}
I can run a cron job every hour to DNS lookup and update the ip_addr
table as needed so I think this is a satisfactory solution for IP
authentication.
SIP trunk user/pass authentication is the one I am now struggling with.
This standard Kamailio authentication section does not work for SIP trunks.
if (is_method("REGISTER|INVITE") || from_uri==myself)
{
# authenticate requests
#if (!auth_check("$fd", "subscriber", "1")) {
if (!auth_check("$fd", "subscriber", "0")) {
auth_challenge("$fd", "0");
exit;
}
# user authenticated - remove auth header
if(!is_method("REGISTER|PUBLISH"))
consume_credentials();
This is a multidomain setup and therefore:
modparam("auth_db", "use_domain", 1)
So the authentication section will try authenticate the realm of the
trunk which will always be an IP address. However the SIP trunk realm
will usually be saved in the "subscriber" database as the FQDN. There
is no mechanism for auth_check() to directly or indirectly check against
FQDN. The other problem is that even if I used the ip_addr table
somehow it will only try use the user/pass of the first instance of a
matching IP address. For SIP trunks it is possible I could have
multiple subaccounts and therefore multiple instances of the same IP
with different user/pass. So auth_check() is not designed for being
used this way as far as I can tell.
Seems to me like there should almost be a special kamailio module just
for SIP trunks. I had a look a carrierroute module it's not designed
for this either.
The README of websocket suggests to modify kamailio.cfg as below
*# Handle requests within SIP dialogsroute[WITHINDLG] { if
(has_totag()) { # sequential request withing a dialog
should # take the path determined by
record-routing if (loose_route()) {
if ($du == "") { if (!handle_ruri_alias())
{ xlog("L_ERR", "Bad alias
<$ru>\n"); sl_send_reply("400", "Bad
Request");
exit; }
} route(RELAY); } else
{ if ( is_method("ACK") ) {...*
But the original script was
*# Handle requests within SIP dialogsroute[WITHINDLG] { if
(!has_totag()) return; # sequential request withing a dialog
should # take the path determined by record-routing if
(loose_route()) { route(DLGURI); if
(is_method("BYE")) { setflag(FLT_ACC); # do
accounting ... setflag(FLT_ACCFAILED); # ... even if
the transaction fails } else if (
is_method("ACK") ) { # ACK is forwarded
statelessy route(NATMANAGE);
} else if ( is_method("NOTIFY") ) { #
Add Record-Route for in-dialog NOTIFY as per RFC
6665. record_route();
} route(RELAY); exit; } if
(is_method("SUBSCRIBE") && uri == myself) { # in-dialog
subscribe requests route(PRESENCE);
exit; } if ( is_method("ACK") ) { if (
t_check_trans() ) { # no loose-route, but stateful
ACK; # must be an ACK after a
487 # or e.g. 404 from upstream
server route(RELAY);
exit; } else { # ACK without matching
transaction ... ignore and discard
exit; } } sl_send_reply("404","Not
here"); exit;}*
Now I have to include the websocket README suggested script in original
script. I am not finding logical way where shall I include websocket part.
Can somebody please help me.
Thanks
Austin
Hello,
Im running kamailio 4.2.3 and I'm having troubles with reporting user
presence data from Kamailio server to a registered UA behind nat. The
NOTIFY message is being sent from Kamailio to the UA after receiving
PUBLISH, but because the UA is behind nat the NOTIFY message is being
sent to the UAs private (=unroutable) ip and therefor never reaching the
real UA. My server is using nat helping modules so that REGISTER
messages and INVITE messages are handled ok even if they are originated
behind nat.
Any suggestions how to solve this and make the NOTIFY messages to be
sent via routabe ip addresses?
my kamailio.cfg PRESENCE routing:
#!ifdef WITH_PRESENCE
if (!t_newtran())
{
sl_reply_error();
exit;
};
if(is_method("PUBLISH"))
{
handle_publish();
t_release();
}
else
if( is_method("SUBSCRIBE"))
{
handle_subscribe();
t_release();
}
exit;
#!endif
if (is_method("PUBLISH") || $rU==$null)
{
sl_send_reply("404", "Not here");
exit;
}
return;
}
-- Olli
Hello Daniel,
I still can't understand clearly why when asterisk send NOTIFY to client through kamailio it coming back with with 408. I
I tried different case event change Contact:, but no luck can't I see what the issue all routes in first SUBSCRIBE looks ok .
Any though or help will be really appreciate.
This what I see on asterisk debug
Reliably Transmitting (NAT) to 10.18.130.46:5060:
NOTIFY sip:102@192.168.88.243:5068;alias=client_pub_ip~5068~2 SIP/2.0
Via: SIP/2.0/UDP 10.18.130.51:5060;branch=z9hG4bK5dd3f266
Max-Forwards: 70
Route: <sip:10.18.130.46:5060;lr=on;ftag=3b27a2a409;nat=yes> --->Kamailio route
From: "canlpbx02" <sip:canlpbx02@10.18.130.51>;tag=as56402f92
To: <sip:102@192.168.88.243:5068;alias=client_pub_ip~5068~2>;tag=3b27a2a409
Contact: <sip:canlpbx02@10.18.130.51:5060>
Call-ID: b1edde040d695988
CSeq: 102 NOTIFY
User-Agent: FPBX-12.0.43(12.8.1)
Event: message-summary
Content-Type: application/simple-message-summary
Subscription-State: active
Content-Length: 88
Messages-Waiting: yes
Message-Account: sip:*97@10.18.130.51
Voice-Message: 5/0 (0/0)
---
<--- SIP read from UDP:10.18.130.46:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.18.130.51:5060;rport=5060;branch=z9hG4bK5dd3f266
From: "canlpbx02" <sip:canlpbx02@10.18.130.51>;tag=as56402f92
To: <sip:102@192.168.88.243:5068;alias=client_pub_ip~5068~2>;tag=3b27a2a409
Call-ID: b1edde040d695988
CSeq: 102 NOTIFY
Allow: ACK, BYE, CANCEL, INVITE, MESSAGE, NOTIFY, OPTIONS, REFER, SUBSCRIBE, UPDATE
Server: Media5-fone/4.1.6.3283 Android/5.1
Supported: eventlist, replaces, timer
Content-Length: 0
<------------->
--- (10 headers 0 lines) ---
<--- SIP read from UDP:10.18.130.46:5060 --->
SIP/2.0 408 Request Timeout
Via: SIP/2.0/UDP 10.18.130.51:5060;branch=z9hG4bK6386387f;rport=5060
From: "canlpbx02" <sip:canlpbx02@10.18.130.51>;tag=as00936a6d
To: <sip:102@192.168.88.243:5066;alias=client_pub_ip~5066~2>;tag=a3aea18741
Call-ID: 5a66b87a618d1042
CSeq: 103 NOTIFY
Server: kamailio (4.2.3 (x86_64/linux))
Content-Length: 0
<------------->
Slava.
From: "Daniel-Constantin Mierla" <miconda(a)gmail.com>
To: "Slava Bendersky" <volga629(a)networklab.ca>, "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Friday, March 13, 2015 1:28:33 PM
Subject: Re: [SR-Users] kamailio asterisk NOTIFY
Hello,
that function might be in textopsx module.
Cheers,
Daniel
On 13/03/15 14:25, Slava Bendersky wrote:
Hello Daniel,
Where possible find updated version of options for textops.
[sr_module.c:701]: find_mod_export_record(): find_export_record: <remove_hf_value> not found
Specially Record-Route manipulation.
Slava.
From: "Slava Bendersky" <volga629(a)networklab.ca>
To: miconda(a)gmail.com
Cc: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Friday, March 13, 2015 8:54:26 AM
Subject: Re: [SR-Users] kamailio asterisk NOTIFY
Hello Daniel,
Here paste for first SUBSCRIBE.
http://fpaste.org/197545/25118514/
Slava.
From: "Daniel-Constantin Mierla" <miconda(a)gmail.com>
To: "Slava Bendersky" <volga629(a)networklab.ca>
Cc: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Thursday, March 12, 2015 5:09:17 AM
Subject: Re: [SR-Users] kamailio asterisk NOTIFY
Hello,
can you get the sip traffic from the network (from the first subscribe of this presence dialog)? It will help to see the Route set.
Cheers,
Daniel
On 12/03/15 00:36, Slava Bendersky wrote:
BQ_BEGIN
Hello Daniel,
Here debug of the notify which failing. Look like transaction miss match
http://fpaste.org/196896/61168591/
Slava.
From: "Daniel-Constantin Mierla" <miconda(a)gmail.com>
To: "Slava Bendersky" <volga629(a)networklab.ca> , "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Wednesday, March 11, 2015 5:44:05 PM
Subject: Re: [SR-Users] kamailio asterisk NOTIFY
Hello,
it doesn't matter if there is a mix of transports. If the UA is mirroring the Record-Route headers in the response to the NOTIFY, it should work fine.
Cheers,
Daniel
On 11/03/15 21:40, Slava Bendersky wrote:
BQ_BEGIN
Hello Daniel,
Is this matter that UDP and TCP transport in mix ?
Slava.
From: "Slava Bendersky" <volga629(a)networklab.ca>
To: miconda(a)gmail.com
Cc: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Wednesday, March 11, 2015 4:21:39 PM
Subject: Re: [SR-Users] kamailio asterisk NOTIFY
Hello Daniel,
I have record route in WITHINDLG for NOTIFY, but it not helped behaviour is the same it loosing route for NOTIFY.
Slava.
From: "Daniel-Constantin Mierla" <miconda(a)gmail.com>
To: "Slava Bendersky" <volga629(a)networklab.ca> , "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Wednesday, March 11, 2015 2:14:02 PM
Subject: Re: [SR-Users] kamailio asterisk NOTIFY
Hello,
you have to do record_route() for all NOTIFY requests -- there are new specs requiring that (RFC 6665) and perhaps asterisk is following them.
If you look in the default kamailio.cfg for v4.2, inside route[WITHINDLG], then you will see how it is done.
Cheers,
Daniel
On 11/03/15 14:22, Slava Bendersky wrote:
BQ_BEGIN
Hello Daniel,
Here fresh paste
http://fpaste.org/196616/42608006/
I see proper routing headers on SUBSCRIBE, but then NOTIFY loose it.
Slava.
From: "Daniel-Constantin Mierla" <miconda(a)gmail.com>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Tuesday, March 10, 2015 5:31:51 PM
Subject: Re: [SR-Users] kamailio asterisk NOTIFY
Hello,
fpaste link doesn't show anything.
Can you check if the NOTIFY coming to Kamailio has two Route headers?
Cheers,
Daniel
On 10/03/15 18:44, Slava Bendersky wrote:
BQ_BEGIN
Hello Everyone,
Having issue with NOTIFY, is not forwarded to client properly.
asterisk ---> private kamailio public ----> soft client
http://fpaste.org/196257/99948714/
I see kamailio trying connect always with private IP to the client when NOTIFY is come is in. Is this something to do with
rr_advertise_address ?
Mar 10 13:44:23 canlvprx01 kamailio: 16(24971) ERROR: <core> [tcp_main.c:4338]: tcpconn_main_timeout(): connect 192.168.88.246:5064 failed (timeout)
Mar 10 13:44:23 canlvprx01 kamailio: 16(24971) DEBUG: <core> [tcp_main.c:4362]: tcpconn_main_timeout(): tcp_main: timeout for 0x7fbbb64e2800
Mar 10 13:44:23 canlvprx01 kamailio: 16(24971) DEBUG: <core> [io_wait.h:610]: io_watch_del(): DBG: io_watch_del (0x9dbf00, 33, -1, 0x10) fd_no=24 called
Mar 10 13:44:23 canlvprx01 kamailio: 16(24971) DEBUG: <core> [tcp_main.c:4320]: tcpconn_main_timeout(): tcp_main: entering timer for 0x7fbbb64eb6c0 (ticks=839577436, timeout=839634956 (3595 s), wr_timeout=839577436 (0 s)), write queue: 798 bytes
Mar 10 13:44:23 canlvprx01 kamailio: 16(24971) ERROR: <core> [tcp_main.c:4338]: tcpconn_main_timeout(): connect 192.168.88.246:5066 failed (timeout)
Mar 10 13:44:23 canlvprx01 kamailio: 16(24971) DEBUG: <core> [tcp_main.c:4362]: tcpconn_main_timeout(): tcp_main: timeout for 0x7fbbb64eb6c0
Mar 10 13:44:23 canlvprx01 kamailio: 16(24971) DEBUG: <core> [io_wait.h:610]: io_watch_del(): DBG: io_watch_del (0x9dbf00, 34, -1, 0x10) fd_no=23 called
Mar 10 13:44:42 canlvprx01 kamailio: 5(24960) DEBUG: tm [t_reply.c:1294]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408
Mar 10 13:44:42 canlvprx01 kamailio: 5(24960) DEBUG: tm [t_reply.c:1812]: relay_reply(): DEBUG: relay_reply: branch=0, save=0, relay=0 icode=0
Mar 10 13:44:42 canlvprx01 kamailio: 5(24960) DEBUG: <core> [mem/shm_mem.c:111]: _shm_resize(): WARNING:vqm_resize: resize(0) called
Mar 10 13:44:42 canlvprx01 kamailio: 5(24960) DEBUG: tm [t_reply.c:1294]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408
Mar 10 13:44:42 canlvprx01 kamailio: 5(24960) DEBUG: tm [t_reply.c:1812]: relay_reply(): DEBUG: relay_reply: branch=0, save=0, relay=0 icode=0
I have in configuration in WITHINDLG
if (is_method("NOTIFY")) {
record_route();
}
and in NATDETECT
if(is_method("INVITE|SUBSCRIBE|UPDATE|NOTIFY")) {
set_contact_alias();
}
Slava.
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users(a)lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio World Conference, May 27-29, 2015
Berlin, Germany - http://www.kamailioworld.com
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
BQ_END
--
Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio World Conference, May 27-29, 2015
Berlin, Germany - http://www.kamailioworld.com
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
BQ_END
--
Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio World Conference, May 27-29, 2015
Berlin, Germany - http://www.kamailioworld.com
BQ_END
--
Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio World Conference, May 27-29, 2015
Berlin, Germany - http://www.kamailioworld.com
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
BQ_END
--
Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio World Conference, May 27-29, 2015
Berlin, Germany - http://www.kamailioworld.com
Hello Daniel,
I end up insert routes like this. And right now on client side I see only public ip route and private side only private ip routes.
route[ROUTE_HDR_ORG] {
# Getting record routes
if(is_present_hf("Route")) {
xlog("L_INFO", "[$rm], Inbound connection from <$si>\n");
if(is_method("NOTIFY")) {
if(is_ip_rfc1918($si)) {
xlog("L_INFO", "[$rm], Present Route: $(route_uri{uri.host})\n");
remove_hf("Route");
insert_hf("Record-Route: <"sip" + $sel(cfg_get.kamailio.bindpublicip) + ":" $sel(cfg_get.kamailio.bindpublicport);transport=tcp;lr=on;ftag=$ft;nat=yes>\r\n");
$fs = "tcp" + ":" + $sel(cfg_get.kamailio.bindpublicip) + ":" + $sel(cfg_get.kamailio.bindpublicport);
} else {
xlog("L_INFO", "[$rm], Present Route: $(route_uri{uri.host})\n");
remove_hf("Route");
insert_hf("Record-Route: <"sip" + ":" $sel(cfg_get.kamailio.bindip) + ":" + $sel(cfg_get.kamailio.bindport);lr=on;ftag=$ft;nat=yes>\r\n");
$fs = "udp" + ":" + $sel(cfg_get.kamailio.bindip) + ":" + $sel(cfg_get.kamailio.bindport);
}
}
}
}
And for initial SUBSCRIBE INVITE
if (is_method("INVITE|SUBSCRIBE")) {
remove_hf("Route");
insert_hf("Record-Route: <"sip" + ":" + $sel(cfg_get.kamailio.bindip) + ":" + $sel(cfg_get.kamailio.bindport);lr=on;ftag=$ft;nat=yes>\r\n");
#record_route();
}
Slava.
From: "Daniel-Constantin Mierla" <miconda(a)gmail.com>
To: "Slava Bendersky" <volga629(a)networklab.ca>, "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Wednesday, March 18, 2015 4:15:28 AM
Subject: Re: [SR-Users] remove_hf_value
Hello,
but the INVITE request goes out with 2 Record Route headers, if you get them in the 200ok.
Not sure how it is going to work overall, you will have to manually set local sockets for requests within dialog, because you are doing also trasport layer gatewaying (tcp-udp).
Anyhow, as a solution, maybe you should just not be using record_route() function and just add the header with insert_hf() for the invite, remove the Record-Route header for 200ok with remove_hf() and insert a new one again with insert_hf()
If you know the local address (IP/port/transport) you want to put in the Record-Route, you can build the header as:
insert_hf("Record-Route: <sip:_LOCAL_IP_:_LOCAL_PORT_;transport=_LOCAL_TRANSPORT_;lr=on;ftag=$ft;nat=yes> \r\n");
Requests within the dialog can be handled with loose_route(), but again, you have to do more in config for selecting the local socket to send to next hop.
Cheers,
Daniel
On 16/03/15 13:35, Slava Bendersky wrote:
Hello Daniel,
I want do clean up on routes from first SUBSCRIBE, that when traffic goes to public side of kamailio will be only public route and when traffic is internal the Record-Route will stay internal only. In SDP I see like this.
I tired double routes set 0 in rr, but didn't clean enough.
<--- Transmitting (NAT) to 10.18.130.46:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.18.130.46;branch=z9hG4bKf852.e0223f39c2bbad8366fdf1b7cb22b336.0;i=8;received=10.18.130.46;rport=5060
Via: SIP/2.0/TCP 192.168.88.252:5062;received=client_pub_ipbranch=z9hG4bK0bbe1f7d27257bba9;rport=5062
Record-Route: <sip:10.18.130.46;r2=on;lr=on;ftag=a185d974ec;nat=yes> On public side remote this Record-Route
Record-Route: <sip:kamailio_pub_ip:5084;transport=tcp;r2=on;lr=on;ftag=a185d974ec;nat=yes> On private side remote this Record-Route
From: "Slava Bendersky" <sips:10101@networklab.ca> ;tag=a185d974ec
To: <sips:10101@networklab.ca> ;tag=as00757d3e
Call-ID: b08adb1ad1804a83
CSeq: 236711034 SUBSCRIBE
Server: FPBX-2.11.0(11.15.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 3600
Contact: <sip:10101@10.18.130.50:5060> ;expires=3600
Content-Length: 0
Slava.
From: "Daniel-Constantin Mierla" <miconda(a)gmail.com>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Monday, March 16, 2015 7:01:54 AM
Subject: Re: [SR-Users] remove_hf_value
Hello,
can you give an example of incoming header and how you want to be after modification?
It is not clear for me what end result you want/expect.
Cheers,
Daniel
On 14/03/15 06:41, Slava Bendersky wrote:
BQ_BEGIN
Hello Everyone,
Here updated version. Trying remove Record-Route after the coma.
My log shows
Mar 14 01:25:21 canlvprx01 /usr/sbin/kamailio[751]: INFO: <script>: [SUBSCRIBE], Inbound connection from <Client Public IP>
Mar 14 01:25:21 canlvprx01 /usr/sbin/kamailio[751]: ERROR: <script>: <null>
Mar 14 01:25:21 canlvprx01 /usr/sbin/kamailio[751]: INFO: <script>: [SUBSCRIBE], Route for removal: '<null>'
route snippet.
route[ROUTE_HDR_ORG] {
# Getting record routes
if(is_present_hf("Route")) {
xlog("L_INFO", "[$rm], Inbound connection from <$si>\n");
if(is_method("SUBSCRIBE")) {
if(is_ip_rfc1918($si)) {
xlog( "$sel((a)hf_value.Record_Route[-1])" );
xlog("L_INFO", "[$rm], Route for removal: '$sel((a)hf_value.Record_Route[-1])'\n");
remove_hf_value("Record-Route[-1]");
} else {
xlog( "$sel((a)hf_value.Record_Route[1])" );
xlog("L_INFO", "[$rm], Route for removal: '$sel((a)hf_value.Record_Route[1])'\n");
remove_hf_value("Record-Route[1]");
}
}
}
return;
}
Slava,
From: "Slava Bendersky" <volga629(a)networklab.ca>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Friday, March 13, 2015 1:00:44 PM
Subject: [SR-Users] remove_hf_value
Hello Everyone,
I am trying adjust Record-Route, but can't match headers value
And I am call route(ROUTE_HDR_ORG); right after route(WITHINDLG);
route[ROUTE_HDR_ORG] {
# Getting record routes
if(is_present_hf("Record-Route")) {
if(is_method("SUBSCRIBE")) {
xlog( "$sel((a)hf_value.Record_Route[1])" );
xlog("L_INFO", "[$rm], Route for removal: '$sel((a)hf_value.Record_Route[1])'\n");
remove_hf_value("Record-Route[1]");
}
}
return;
}
Any help Thank you,
Slava.
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users(a)lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio World Conference, May 27-29, 2015
Berlin, Germany - http://www.kamailioworld.com
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
BQ_END
--
Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio World Conference, May 27-29, 2015
Berlin, Germany - http://www.kamailioworld.com