Hello,
can someone give me a sample of calling to xhttp from curl or wget?
I have this in my kamailio.cfg:
listen=tcp:192.168.2.105:80
loadmodule "xhttp.so"
event_route[xhttp:request] {
xhttp_reply("200", "OK", "text/html",
"<html><body>OK - [$si:$sp]</body></html>");
}
But when I try wget or curl, kamailio closes the connection without sending
a response:
[root@centos55-02105 tmp]# curl http://192.168.2.105/test
curl: (52) Empty reply from server
[root@centos55-02105 tmp]# wget http://192.168.2.105/test
--2011-01-14 00:11:49-- http://192.168.2.105/test
Connecting to 192.168.2.105:80... connected.
HTTP request sent, awaiting response... No data received.
I see this in the log file:
Jan 14 00:04:47 centos55-02105 /usr/local/sbin/kamailio[10479]: ERROR:
<core> [tcp_read.c:904]: ERROR: tcp_read_req: bad request, state=7, error=4
buf: GET /test HTTP/1.0^M User-Agent: Wget/1.11.4 Red Hat modified^M Accept:
*/*^M Host: 192.168.2.105^M Connection: Keep-Alive^M ^M parsed: GET /test
HTTP/1.0^M User-Agent: Wget/1.11.4 Red Hat modified^M Accept: */*^M Host:
192.168.2.105^M Connection: Keep-Alive^M ^M
br,
takeshi
Hi,
I am using the Dispatcher module to load-balance the calls to several freeswitch servers.
On which responses within the failure_route should be a fallback to another server (dst_next_dst())? I am sure, that on a 408 response there should be a fallback but whats about other 4XX responses and 5XX or 6XX?
Thanks in advance.
Best regards,
Bernhard Suttner
Hello.
I’m trying to count the calls to a specific gateway. So I’m using the
dialog module. This route is done before the final relay.
route[CHANNELS] {
if( is_method("INVITE") ) {
if(!isflagset(31) ) {
# user has max channel limit set as preference
if(is_avp_set("$avp(s:channels)") &&
avp_check("$avp(s:channels)", "gt/s:0")) {
# get current calls for uuid
xlog("L_INFO","[$ci] : avp_channels existe y
es mayor que 0 ?");
if
(get_profile_size("gws","$rd","$var(calls)")) {
xlog("L_INFO","Actualmente el
gateway $rd tiene $var(calls) llamadas simultaneas\n");
}
# check within limit
if($avp(s:channels) > $var(calls)) {
xlog("L_INFO", "CHANNELS :
terminador '$rd' tiene '$var(calls)' de '$avp(s:channels)' active
calls before this one\n");
$var(setprofile) = 1;
} else {
xlog("L_INFO", "Call crtl: user
channel limit exceeded [$var(calls)/$avp(s:channels)]\n");
send_reply("487", "Request
Terminated: Channel limit exceeded");
exit;
}
} else {
xlog("L_INFO","[$ci] : the value if channels
is $avp(s:channels)");
if( !is_avp_set("$avp(s:channels)") ) {
xlog("L_INFO","[$ci] : avp_channel
not set");
};
if(!avp_check("$avp(s:channels)", "gt/s:0")
) {
xlog("L_INFO","[$ci] : avp_channel
menor que 0?");
};
$var(setprofile) = 0;
}
}
if($var(setprofile) > 0) {
* if ( set_dlg_profile("gws","$rd") ) {*
* xlog("L_INFO","set_dlg_profile exitoso");*
}
}
When i made the call and try to see the profile with this command :
[root@sipvoiss kamailio]# kamctl fifo profile_get_size gws 10.0.0.220
profile:: name=gws value=10.0.0.220 count=0
I’m not seeing the call added to the profile, despite the fact I using the *
set_dlg_profile("gws","$rd")*
What could be happening?
This is part of the debug :
Jan 11 18:07:03 .: INFO: <script>: [
71492292-34f2-a3ed-814e-0002a400d53d(a)10.0.0.214] INVITE dominio:10.0.0.208
LOCAL DOMAIN
Jan 11 18:07:03 .: DEBUG: misc_radius [functions.c:212]: success
Jan 11 18:07:03 .: DEBUG: misc_radius [functions.c:133]: AVP 'tranum'/0='
sip:02444444444@10.0.0.208 <sip%3A02444444444(a)10.0.0.208>'/0 has been added
Jan 11 18:07:03 .: DEBUG: misc_radius [functions.c:133]: AVP
'channels'/0='2'/0 has been added
Jan 11 18:07:03 .: DEBUG: avpops [avpops_impl.c:1047]: 1 avps were processed
Jan 11 18:07:03 .: INFO: <script>: [
71492292-34f2-a3ed-814e-0002a400d53d(a)10.0.0.214] INVITE con
dominio:10.0.0.208 checks de usuario via avp_radius OK
Jan 11 18:07:03 .: INFO: <script>: [
71492292-34f2-a3ed-814e-0002a400d53d(a)10.0.0.214] CHECKS SECTION ::
INVITE:sip:02444444444@10.0.0.208
<INVITE%3Asip%3A02444444444(a)10.0.0.208>checks ok...
Jan 11 18:07:03 .: DEBUG: lcr [lcr_mod.c:1748]: added matched_gws[0]=[1, 4,
1, 8207736]
Jan 11 18:07:03 .: DEBUG: lcr [lcr_mod.c:1645]: added gw_uri_avp
<1|1|4|550|3700771904||5060||1|0> with weight <8207736>
Jan 11 18:07:03 .: DEBUG: lcr [lcr_mod.c:1911]: r_uri <
sip:5504444444@10.0.0.220:5060>, dst_uri <>
Jan 11 18:07:03 .: DEBUG: lcr [lcr_mod.c:2015]: added ruri_user_avp
<02444444444>
Jan 11 18:07:03 .: DEBUG: lcr [lcr_mod.c:2050]: added flags_avp <0>
Jan 11 18:07:03 .: DEBUG: lcr [lcr_mod.c:2057]: added defunct_gw_avp
<3700771904>
Jan 11 18:07:03 .: INFO: <script>: [
71492292-34f2-a3ed-814e-0002a400d53d(a)10.0.0.214] Ruta LCR : cambiando
sip:02444444444@10.0.0.208 <sip%3A02444444444(a)10.0.0.208> por
sip:5504444444@10.0.0.220:5060
Jan 11 18:07:03 .: INFO: <script>: [
71492292-34f2-a3ed-814e-0002a400d53d(a)10.0.0.214] : entro en ruta 39 de call
control
Jan 11 18:07:03 .: INFO: <script>: [
71492292-34f2-a3ed-814e-0002a400d53d(a)10.0.0.214] : no esta seteado el flag
31
Jan 11 18:07:03 .: DEBUG: avpops [avpops_impl.c:1180]: check <2> against <0>
as str /16
Jan 11 18:07:03 .: INFO: <script>: [
71492292-34f2-a3ed-814e-0002a400d53d(a)10.0.0.214] : avp_channels existe y es
mayor que 0 ?
Jan 11 18:07:03 .: INFO: <script>: Actualmente el gateway 10.0.0.220 tiene 0
llamadas simultaneas
Jan 11 18:07:03 .: INFO: <script>: CHANNELS : terminador '10.0.0.220' tiene
'0' de '2' active calls before this one
Jan 11 18:07:03 .: INFO: <script>: set_dlg_profile exitoso
Thanks in advance,
*Regards,*
*Ricardo.-*
Hi
I performed the following maintenance actions to my server that is currently
installed with kamailio v3.1
cd /usr/local/src/kamailio-3.1.0/kamailio
git pull origin
make all
make install
After this action the dialog module is not working, after investigation, i
found out that the following entry is causing this issue:
modparam("dialog", "db_mode", 1)
In my syslog i find the following errors:
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7397]: CRITICAL: dialog
[dlg_db_handler.c:117]: BUG - db connection found already open
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7398]: : <core>
[pass_fd.c:293]: ERROR: receive_fd: EOF on 33
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7398]: : <core>
[pass_fd.c:293]: ERROR: receive_fd: EOF on 34
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7397]: ERROR: dialog
[dialog.c:620]: failed to connect to database (rank=24)
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7397]: ERROR: <core>
[sr_module.c:832]: init_mod_child(): Error while initializing module dialog
(/usr/local/lib/kamailio/modules_k/dialog.so)
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7397]: ERROR: <core>
[pt.c:481]: ERROR: fork_tcp_process(): init_child failed for process 30, pid
7397, "tcp receiver child=7"
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7397]: ERROR: <core>
[tcp_main.c:4811]: ERROR: tcp_main: fork failed: Success
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7398]: : <core>
[pass_fd.c:293]: ERROR: receive_fd: EOF on 37
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7398]: : <core>
[pass_fd.c:293]: ERROR: receive_fd: EOF on 43
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7398]: : <core>
[pass_fd.c:293]: ERROR: receive_fd: EOF on 30
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7398]: : <core>
[pass_fd.c:293]: ERROR: receive_fd: EOF on 41
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7398]: : <core>
[pass_fd.c:293]: ERROR: receive_fd: EOF on 5
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7396]: WARNING: <core>
[db_id.c:281]: identical DB URLs, but different DB connection pid
[7396/7349]
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7391]: INFO: <core>
[main.c:807]: INFO: signal 15 received
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7398]: : <core>
[pass_fd.c:293]: ERROR: receive_fd: EOF on 47
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7396]: CRITICAL: dialog
[dlg_db_handler.c:117]: BUG - db connection found already open
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7396]: ERROR: dialog
[dialog.c:620]: failed to connect to database (rank=23)
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7396]: ERROR: <core>
[sr_module.c:832]: init_mod_child(): Error while initializing module dialog
(/usr/local/lib/kamailio/modules_k/dialog.so)
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7396]: ERROR: <core>
[pt.c:481]: ERROR: fork_tcp_process(): init_child failed for process 29, pid
7396, "tcp receiver child=6"
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7398]: : <core>
[pass_fd.c:293]: ERROR: receive_fd: EOF on 39
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7396]: ERROR: <core>
[tcp_main.c:4811]: ERROR: tcp_main: fork failed: Success
Jan 11 16:45:54 SipProxy /usr/local/sbin/kamailio[7398]: : <core>
[pass_fd.c:293]: ERROR: receive_fd: EOF on 45
Only the dialog module is facing this problem
Has anyone faced this before?
Thanks
Phillip
Hello.
I’m trying to use the kamctl command to get information about dialogs. I’m
using the next line :
kamctl fifo profile_get_size:kamailio_fifo
and I’m getting the next output in the log file :
Jan 11 12:34:38 /usr/local/sbin/kamailio[15051]: ERROR: mi_fifo
[fifo_fnc.c:223]: open error (/tmp/kamailio_fifo:openser_receiver_15073): No
such file or directory
Jan 11 12:34:38 /usr/local/sbin/kamailio[15051]: ERROR: mi_fifo
[fifo_fnc.c:484]: cannot open reply pipe
/tmp/kamailio_fifo:openser_receiver_15073
What I’m doing wrong?
This is part of the configuration file :
# ----- mi_fifo params ------
modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
modparam("mi_fifo", "fifo_group", 0)
modparam("mi_fifo", "fifo_group", "root")
modparam("mi_fifo", "fifo_user", 0)
modparam("mi_fifo", "fifo_user", "root")
and this is the file kamailio_fifo in the /tmp directory :
[root@kamailio]# ls -la /tmp
total 52
drwxrwxrwt. 4 root root 4096 Jan 11 12:38 .
dr-xr-xr-x. 25 root root 4096 Jan 7 09:25 ..
drwxrwxrwt 2 root root 4096 Jan 7 09:25 .ICE-unix
*prw-rw---- 1 root root 0 Jan 11 12:34 kamailio_fifo*
drwx------ 2 root root 4096 Jan 11 09:54 ssh-gpTCQ12700
Hope someone could help me.
Regards,
Ricardo.-
Please keep the discussion on list - cc: the list.
I see no indication in the documentation that avp_write() is a function
that exists, even going back to 1.4.x.
On 01/10/2011 04:54 PM, Amit Nepal wrote:
> Kamailio 3.1
>
> Thank You
> Amit Nepal
> Systems Administrator
> Phoenix Internet
> Phone: 602-385-0731
> 602-234-0917#112
> http://www.phoenixinternet.net
>
>
> On 1/10/2011 2:50 PM, Alex Balashov wrote:
>> On 01/10/2011 04:48 PM, Amit Nepal wrote:
>>> I am getting missing loadmodule issue with avp_write. I have the
>>> following statement on line 11 and i am getting this error. Could you
>>> please help me on this. But i can load from db using avp_db_load and i
>>> can delete avp values but only avp_write is not working.
>>>
>>>
>>> avp_write("$ruri", "s:fwd_blind");
>>>
>>> loading modules under
>>> /usr/local/lib/kamailio/modules_k/:/usr/local/lib/kamailio/modules/
>>> 0(2361) : <core> [cfg.y:3412]: parse error in config file
>>> /usr/local/etc/kamailio/cfgs/pstn.cfg, line 11, column 39: unknown
>>> command, missing loadmodule?
>>>
>>> ERROR: bad config file (1 errors)
>>
>> Which version of Kamailio?
>>
--
Alex Balashov - Principal
Evariste Systems LLC
260 Peachtree Street NW
Suite 2200
Atlanta, GA 30303
Tel: +1-678-954-0670
Fax: +1-404-961-1892
Web: http://www.evaristesys.com/
I am getting missing loadmodule issue with avp_write. I have the
following statement on line 11 and i am getting this error. Could you
please help me on this. But i can load from db using avp_db_load and i
can delete avp values but only avp_write is not working.
avp_write("$ruri", "s:fwd_blind");
loading modules under
/usr/local/lib/kamailio/modules_k/:/usr/local/lib/kamailio/modules/
0(2361) : <core> [cfg.y:3412]: parse error in config file
/usr/local/etc/kamailio/cfgs/pstn.cfg, line 11, column 39: unknown
command, missing loadmodule?
ERROR: bad config file (1 errors)
Thank you
Amit
Hi folks,
Since upgrading vom Kamailio 1.5 to 3.1 I have a problem using
get_redirects from the uac_redirect module. It seems that there is a
problem with parsing the Contact header from the received 302.
This is my script excerpt:
if (t_check_status("3[0-9][0-9]")) {
get_redirects("*");
if (!t_relay()) {
xlog("L_ERR","t_relay failed\n");
}
}
Some 302 messages lead (as expected) to INVITEs send to targets in the
Contact header, for others t_relay fails.
A working example would be
Contact:<sip:+49406686100@192.168.0.1:5060;user=phone>;q=0.5,<sip:
+49406686100@192.168.0.2:5060;user=phone>;q=0.25
It fails on
Contact: sip:+49406686100@192.168.0.1:5060
The following log messages appear when calling get_redirects (and
failing t_relay):
kamailio[7372]: DEBUG: uac_redirect [rd_funcs.c:74]: resume branch=0
kamailio[7372]: DEBUG: uac_redirect [rd_funcs.c:81]: checking branch=0
(added=0)
kamailio[7372]: DEBUG: uac_redirect [rd_funcs.c:85]: branch=0 is a
redirect (added=0)
kamailio[7372]: WARNING: <core> [mem/q_malloc.c:366]:
qm_malloc(0x82ba320, 32) called from <core>: parser/msg_parser.c:
parse_headers(339)
kamailio[7372]: WARNING: <core> [mem/q_malloc.c:406]:
qm_malloc(0x82ba320, 32) returns address 0x8311d94 frag. 0x8311d7c
(size=32) on 1 -th hit
kamailio[7372]: DEBUG: uac_redirect [rd_funcs.c:233]: contact hdr not
found in sh_rpl
The Contact header that fails obviously has no parameters for the URI
and contact itself. As far as I understand the RFC 3261 BNF this is
valid.
The 302 response is by the way created by kamailio when using the LCR
module (like this)
if (!load_gws("1")) {... exit;}
if (!next_gw()) {... exit; }
sl_send_reply("302", "Not here");
Did I miss anything when upgrading or is this a problem with the parser?
Cheers,
Stefan