On 3/16/12 10:25 AM, Sven Knoblich wrote:
> Thanks Daniel,
> this solves the problem. I will fix it for master and cherry pick it
> for 3.2 as well.
ok -- keeping the list cc-ed will allow people reading the thread on
users to see the final results.
Cheers,
Daniel
>
> Bye Sven
>
>
> Am 15.03.2012 23:16, schrieb Daniel-Constantin Mierla:
>> Hello,
>>
>> from the code, I see that if the value does not exists, the get-function
>> for dlg_var is just returning 0. Probably it should return PV null
>> value.
>>
>> Try again after changing return 0 in return pv_get_null(...) inside
>> function pv_get_dlg_variable(...) from dlg_var.c
>>
>> If works, you can commit the fix.
>>
>> Cheers,
>> Daniel
>>
>> On 3/15/12 4:53 PM, Sven Knoblich wrote:
>>> sip-router:master
>>>
>>> Hi all,
>>> i want to use the define-check also for dlg_var. But after testing a
>>> bit it seems to me, that define does not work with dlg_var's. I am
>>> always getting a true. Did i miss something?
>>>
>>> # $dlg_var(test) is not defined
>>>
>>> if( defined $dlg_var(test))
>>> {
>>> xlog("L_Notice","dlg_var $dlg_var(test) is defined\n");
>>> }
>>>
>>> I hope anybody can help me to clarify this.
>>>
>>> Thanks in advance,
>>> Sven
>>>
>>> _______________________________________________
>>> 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
Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
http://www.asipto.com/index.php/kamailio-advanced-training/
sip-router:master
Hi all,
i want to use the define-check also for dlg_var. But after testing a bit
it seems to me, that define does not work with dlg_var's. I am always
getting a true. Did i miss something?
# $dlg_var(test) is not defined
if( defined $dlg_var(test))
{
xlog("L_Notice","dlg_var $dlg_var(test) is defined\n");
}
I hope anybody can help me to clarify this.
Thanks in advance,
Sven
Hi All,
I've been googling for a little while now and although I found others
asking the question and answers says "yes it's possible" I haven't
managed to find out *how* to do it!
I have a relatively simple scenario where I'd like to use Kamailio (or
something else?) to take TCP or UDP connections from my Linksys PAP2T
ATA and proxy them to my sip provide which only allows TLS connections
(obviously the Linksys doesn't support TLS).
The kicker is that, although I understand the theory and principles of
SIP, I'm completely new to SIP software and how to configure it, etc.
If anyone can point me to a (good and recent) beginners guide to
Kamailio installation and configuration that would also help ;-)
Many thanks
Matt
PS. Installation status is I have Kamailio installed on Ubuntu with
TLS configured (define WITH_TLS & module installed), started and
listening! I've but not yet enabled mysql (not sure if it's needed for
what I want to do!)
Hi!
I want to collect statistics on a load-balancer, e.g. how many NOTIFYs,
SUBSCRIBEs, ... and the respective response codes, e.g. NOTIFYs-200,
NOTIFYs-408,...., response time from the backend-servers, ...
Further I want to do this separately for each backend-server in the
cluster, i.e. for every IP address in the dispatcher list.
Built in statistics or not detailed enough, so thought of implementing
the counting and measuring in script using htable and a periodic timer
which dumps the htable values to log file.
Thus, I will end up with lots of code, especially for dumping I have to
address all possible keys manually:
e.g. request route:
$var(key) = $rm + "::" + $dd;
$sht(stat=>$var(key)) = $sht(stat=>$var(key)) + 1;
e.g. reply route:
if ($rs != "200" && $rs != "480" ) {
$var(key) = $rm + "::" + $si + "::XXX";
} else {
$var(key) = $rm + "::" + $si + "::" + $rs;
}
$sht(stat=>$var(key)) = $sht(stat=>$var(key)) + 1;
e.g. dumping:
xlog("PUBLISH::83.136.32.169=$sht(stat=>PUBLISH::83.136.32.169)");
$sht(stat=>PUBLISH::83.136.32.169)=0;
xlog("PUBLISH_200::83.136.32.169=$sht(stat=>PUBLISH_200::83.136.32.169)");
$sht(stat=>PUBLISH_200::83.136.32.169)=0;xlog("PUBLISH_480::83.136.32.169=$sht(stat=>PUBLISH_480::83.136.32.169)");
$sht(stat=>PUBLISH_480::83.136.32.169)=0;
xlog("PUBLISH_XXX::83.136.32.169=$sht(stat=>PUBLISH_XXX::83.136.32.169)");
$sht(stat=>PUBLISH_XXX::83.136.32.169)=0;
It works, but is not very nice, IMO. Thus, I wonder if someone has a
better, more elegant way to achieve this.
Thanks
Klaus
Hi everyone,
I have a problem with Kamailio consuming memory. I started testing with
Kamailio 3.2.1 upgraded to 3.2.2 and also tested 3.1.5, everywhere the
same problem. Whereas Kamailio 1.5.0 is working fine.
Kamailio -V shows the following:
kamailio@test:~$ kamailio -V
version: kamailio 3.2.2 (i386/linux) 98ba92
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, DBG_QM_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 4MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 98ba92
compiled on 17:51:30 Feb 29 2012 with gcc 4.2.4
kamailio@test:~$
My test scenario consists of two SIPp servers (a UAC and a UAS) and the
Kamailio in the middle proxying the SIP traffic.
The UAC sends 300 calls per second (INVITE, 100, 180, 200, ACK) and
releases the calls (BYE, 200) after 20 sec call duration. UAS is simply
sending back the right responds. Protocol is UDP.
After some minutes the Kamailio floods the syslog file with error
messages indicating that he is running out of memory. The SIPp shows
retransmissions and also timeouts. When I stop the test and do a single
call I get some lines of error messages. I found three different sets of
error messages for a single call so far:
Mar 2 09:35:44 test P-CSCFtest[21251]: ERROR:<core> [parser/msg_parser.c:172]: get_hdr_field: out of memory
Mar 2 09:35:44 test P-CSCFtest[21251]: INFO:<core> [parser/msg_parser.c:353]: ERROR: bad header field [To:<sip:00498111111]
Mar 2 09:35:44 test P-CSCFtest[21251]: ERROR: tm [t_lookup.c:1118]: ERROR: reply cannot be parsed
Mar 2 09:35:44 test P-CSCFtest[21251]: ERROR:<core> [msg_translator.c:1884]: ERROR: build_res_buf_from_sip_res: out of mem
Mar 2 09:35:44 test P-CSCFtest[21251]: ERROR:<core> [forward.c:794]: ERROR: forward_reply: building failed
Mar 2 09:35:44 test P-CSCFtest[21228]: ERROR:<core> [msg_translator.c:1884]: ERROR: build_res_buf_from_sip_res: out of mem
Mar 2 09:35:44 test P-CSCFtest[21228]: ERROR: tm [t_reply.c:1786]: ERROR: relay_reply: no mem for outbound reply buffer
Mar 2 09:35:44 test P-CSCFtest[21228]: ERROR:<core> [msg_translator.c:2036]: ERROR: build_res_buf_from_sip_req: out of memory ; needs 311
Mar 2 10:19:43 test P-CSCFtest[21346]: ERROR:<core> [msg_translator.c:1884]: ERROR: build_res_buf_from_sip_res: out of mem
Mar 2 10:19:43 test P-CSCFtest[21346]: ERROR: tm [t_reply.c:1786]: ERROR: relay_reply: no mem for outbound reply buffer
Mar 2 10:19:43 test P-CSCFtest[21346]: ERROR:<core> [msg_translator.c:2036]: ERROR: build_res_buf_from_sip_req: out of memory ; needs 311
Mar 2 10:20:16 test P-CSCFtest[21328]: ERROR:<core> [action.c:852]: ERROR: do_action: memory allocation failure
Mar 2 10:20:16 test P-CSCFtest[21328]: ERROR:<core> [action.c:1568]: run action error at: /usr/local/etc/kamailio//kamailio.cfg:28
Mar 2 10:20:16 test P-CSCFtest[21328]: ERROR:<core> [action.c:852]: ERROR: do_action: memory allocation failure
Mar 2 10:20:16 test P-CSCFtest[21328]: ERROR:<core> [action.c:1568]: run action error at: /usr/local/etc/kamailio//kamailio.cfg:32
Mar 2 10:20:16 test P-CSCFtest[21328]: ERROR:<core> [parser/parse_from.c:71]: ERROR:parse_from_header: out of pkg_memory
Mar 2 10:20:16 test P-CSCFtest[21328]: ERROR: tm [t_lookup.c:1326]: ERROR: new_t: no valid From in INVITE
Mar 2 10:20:16 test P-CSCFtest[21328]: ERROR: tm [t_lookup.c:1478]: ERROR: t_newtran: new_t failed
Mar 2 10:20:16 test P-CSCFtest[21328]: WARNING:<core> [receive.c:209]: WARNING: receive_msg: error while trying script
I repeated the test various times, it always generates a memory problem.
The "top" command shows that the free memory is decreasing constantly
during the test. Stopping the test and waiting for some time (1 hour)
doesn't increase the free memory showed by "top". Only a restart of the
Kamailio frees the memory again.
I executed the test with 30 calls per second too and got the same
behaviour (after some more minutes).
I finally simplified the Kamailio config as far as possible and came to
this minimum:
#!KAMAILIO
listen=10.10.10.10:5060
children=30
user="kamailio"
group="kamailio"
debug=2
disable_core_dump=yes
log_facility=LOG_LOCAL0
log_name="P-CSCFtest"
server_signature=no
sip_warning=0
syn_branch=0
disable_tcp=yes
####### Modules Section #######
mpath="/usr/local/lib/kamailio/modules_k/:/usr/local/lib/kamailio/modules/"
loadmodule "tm.so"
####### Main Routing Logic ########
route{
if (src_ip==1.2.3.4) {
rewritehost("5.6.7.8");
} else {
rewritehost("1.2.3.4");
};
rewriteport("5061");
t_relay();
}
This config still generates the memory problem. After replacing the
"t_relay()" with the stateless "forward()" the problem is gone.
I played around with the number of child processes too, but no difference.
Is this a memory leak of the TM module or is there a different explanation?
Regards Fred
Hello
we installed kamailio succesfully but we have a few problems regarding
calls towards special numbers in which an INVITE is not replied with 200
OK but instead with 183 session progress sent at 1 min interval, during
which the caller hears a waiting message.
unless a human operator answer the call, no 200 OK is replied. if that
waiting time is too long, we noticed that the call is hanged up after 3
min, 180s, that is 3 * session progress .
408 timeout is sent to the caller and cancel to the callee.
we tried to adjust many timers listed in the tm module, but not seems to
work
we'd like to see if anybody has a clue about that ?
thank you very much
Hello, SIP newbie here.
We are a new WISP offering voip to our residential customers. Due to
IP address scarcity we have to use large scale NAT in our network. In
order for our local customers to call each other and have good call
quality we wish to connect their ATA's directly to each other rather
than have the RTP proxied 6000 miles across the public internet.
I'm wondering about the best way to program an outbound proxy to
monitor the calls and bypass the ITSP's B2BUA for local calls. We want
to rely on the ITSP's server for authentication (so we would only
REGISTER our UA's locally after we get an OK from the remote
server. Or perhaps we would not need a local registrar at all.)
The remote server is also where the users manage their account. So we
only want to attempt to connect the 2 UA's directly after the callee
has sent an "OK" response to the INVITE from the ITSP. (The callee may
have set "Do not disturb" on his account at the ITSP, and it needs to
handle voicemail, forwarding etc.)
We have other constraints. The server hardware needs to be very low
power to be installed at our solar-powered head end. Thus for
potentially several hundred clients it needs to handle only SIP, no
media. We could potentially install a media relay server elsewhere,
but hopefully we won't need to do any media proxying at all.
The NAT assignment is all handled by a Mikrotik router at our head
end. I've looked at the milkfish configuration file and it seems like
in some ways, ours should be simpler. Milkfish assumes it is running
on the gateway, so when it sets up an rtpproxy it doesn't cost
anything. For us, it doesn't seem like we should have to do any NAT
fixup or any media proxying. If the connection is local, the 2 UA's
should connect directly with each other. Otherwise, the connection
will be directly between our UA and whatever the ITSP sets up as the
other end, and the ITSP already knows how to traverse our NAT very
well.
One idea I had is that, for local calls, when the initial INVITE is
forwarded from the caller to the ITSP, the caller's original SDP
payload is stashed away somewhere. Then when the INVITE comes through
on the way to the callee, replace the ITSP's SDP info with the stashed
original. Then when the callee responds with an "OK", I forward the
response directly to the caller instead of the ITSP.
There would have to be some fixup of loose ends, also. How to let the
ITSP that its proxy services are no longer needed? (It could have
decided to forward the call to voicemail in the meantime, etc.)
Can you query the SER transaction database by Call-ID to find the
other side of the call and extract information from it?
Perhaps I'm barking up the wrong tree, but I'm sure there's a correct
way to do this.
Any help would be appreciated.
thanks.