Re: [SR-Users] How to check message queue (buffer) in Kamailio
Hi, Check out rtimer http://kamailio.org/docs/modules/4.1.x/modules/rtimer.html /Morten On Wed, Jul 2, 2014 at 6:59 PM, AliReza Khoshgoftar Monfared khoshgof...@gmail.com wrote: Thanks very much. That is the correct answer. just for the record, one can loadmodule exec and then use something like: exec_avp(netstat -ul | grep ':sip' | awk '{print $$2}',$avp(s:test)); the value of the recv-q is then stored in $avp(s:test) and can be used anywhere Just a side question. I can call exec_avp inside my route{} block obviously. I understand that route{} block is entered anytime that there is a message for processing (correct me if wrong), but if, say, I want to check the value of recv-q every 100ms, where in the config script shall I call it and how shall I specify the calling frequency? Thanks, Alireza On Wed, Jul 2, 2014 at 6:57 AM, Morten Isaksen mi...@misak.dk wrote: Hi, You can use netstat and look at the Recv-Q counter. This should indicate the packets that is waiting for kamailio to process. /Morten On Tue, Jul 1, 2014 at 1:12 PM, Daniel-Constantin Mierla mico...@gmail.com wrote: Hello, the SIP messages send on UDP/SCTP are received directly from the buffer in kernel one by one, each being processed once read. It is hard to know how many are waiting in the kernel. My question would be, when such information would really help? If kamailio is too busy handling traffic, won't get much time to care of other tasks (e.g., predict what is in network read kernel queue). Cheers, Daniel On 30/06/14 16:40, AliReza Khoshgoftar Monfared wrote: Hi, I had another simple question: In a kamailio server (proxy), how do I check the number of messages currently waiting for processing? Is there a variable that I can monitor, say, if I want to make a routing decision in my config based on the number of messages in the queue? Also, is it possible to get a head count by method? or is it only possible after fully parsing the message? I see that ratelimit module uses similar information, but I am not sure how to get the status of these queues that the module uses. Thanks ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-us...@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] How to check message queue (buffer) in Kamailio
Hi, You can use netstat and look at the Recv-Q counter. This should indicate the packets that is waiting for kamailio to process. /Morten On Tue, Jul 1, 2014 at 1:12 PM, Daniel-Constantin Mierla mico...@gmail.com wrote: Hello, the SIP messages send on UDP/SCTP are received directly from the buffer in kernel one by one, each being processed once read. It is hard to know how many are waiting in the kernel. My question would be, when such information would really help? If kamailio is too busy handling traffic, won't get much time to care of other tasks (e.g., predict what is in network read kernel queue). Cheers, Daniel On 30/06/14 16:40, AliReza Khoshgoftar Monfared wrote: Hi, I had another simple question: In a kamailio server (proxy), how do I check the number of messages currently waiting for processing? Is there a variable that I can monitor, say, if I want to make a routing decision in my config based on the number of messages in the queue? Also, is it possible to get a head count by method? or is it only possible after fully parsing the message? I see that ratelimit module uses similar information, but I am not sure how to get the status of these queues that the module uses. Thanks ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-us...@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] insufficient ports returned from mediaproxy
Hi, Answering myself. The problem is documented here. http://mediaproxy.ag-projects.com/issues/2013 So far this patch has solved our problem. /Morten On Thu, May 15, 2014 at 2:45 PM, Morten Isaksen mi...@misak.dk wrote: We have a periodic problem with the communication between mediaproxy (kamailio module) - media-dispatcher - media-relay The problems seems to be that media-dispatcher mixes the requests and answers, so kamailio get a wrong answer to its request. Kamailio 3.1.1 Mediaproxy 2.4.4 I know they are old versions, but I have checket the new releases, and it does not look like anything related to this has been changed. This log snippet illustrates the problem well. We have added a few extra debug information: PID 3433 sends a update request to dispatcher dispatcher sends request to relay 10.253.253.32 relay 10.253.253.32 answers dispatcher PID 5214 sends a remove request to dispatcher dispatcher sends request to relay 10.253.253.32 relay 10.253.253.32 answers dispatcher dispatcher answer PID 3433 with the answer for PID 5214 The answer for PID 3433 is newer received by kamailio. May 15 08:02:33 sip-3-1 /usr/local/sbin/kamailio[5211]: WARNING: script: new request M=INVITE RURI=sip:40804...@76752xxx.example.com F= sip:40804...@76752xxx.example.com T=sip:40804XXX@172.16.9.20IP=172.16.9.20 ID= 738ce06b2a507610599b767b6b164...@hpbxout.one-connect.dk May 15 08:02:33 sip-3-1 media-dispatcher[3433]: debug: Command update Headers ['type: request', 'call_id: 738ce06b2a507610599b767b6b164...@hpbxout.one-connect.dk', 'cseq: 102', 'from_uri: 40804...@76752xxx.example.com', 'to_uri: 40804XXX@172.16.9.20', 'from_tag: as35017b2b', 'user_agent: one-connect', 'signaling_ip: 172.16.9.20', 'media: audio:172.16.9.18:50934:sendrecv:ice=no'] May 15 08:02:33 sip-3-1 media-dispatcher[3433]: debug: Issuing update command to relay at 10.253.253.32 May 15 08:02:33 sip-3-1 media-dispatcher[3433]: debug: To relay update 7529;type: request;call_id: 738ce06b2a507610599b767b6b164...@hpbxout.one-connect.dk;cseq: 102;from_uri: 40804...@76752xxx.example.com;to_uri: 40804XXX@172.16.9.20;from_tag: as35017b2b;user_agent: one-connect;signaling_ip: 172.16.9.20;media: audio:172.16.9.18:50934:sendrecv:ice=no;; May 15 08:02:33 sip-3-1 media-dispatcher[3433]: debug: line received 7529 172.16.8.32 63730 May 15 08:02:33 sip-3-1 /usr/local/sbin/kamailio[5214]: WARNING: script: new request M=BYE RURI=sip:65981002@172.16.9.21:5060 F= sip:65982380@172.16.8.37 T=sip:65981002@172.16.8.8 IP=172.16.8.8 ID= 24b6995108fc59946c0222084a79e1a7@172.16.8.37:5060 May 15 08:02:33 sip-3-1 media-dispatcher[3433]: debug: Command remove Headers ['call_id: 24b6995108fc59946c0222084a79e1a7@172.16.8.37:5060', 'from_tag: as792f4baa', 'to_tag: as798301b8'] May 15 08:02:33 sip-3-1 media-dispatcher[3433]: debug: Issuing remove command to relay at 10.253.253.32 May 15 08:02:33 sip-3-1 media-dispatcher[3433]: debug: To relay remove 7530;call_id: 24b6995108fc59946c0222084a79e1a7@172.16.8.37:5060;from_tag: as792f4baa;to_tag: as798301b8;; May 15 08:02:33 sip-3-1 media-dispatcher[3433]: debug: line received 7530 {from_tag: as792f4baa, start_time: 1400133626.74, call_id: 24b6995108fc59946c0222084a79e1a7@172.16.8.37:5060, duration: 126, streams: [{status: closed, caller_codec: G711a, post_dial_delay: 0.175052881241, callee_codec: G711a, caller_bytes: 1269200, start_time: 0, callee_packets: 6088, callee_bytes: 1217600, caller_packets: 6346, callee_remote: 172.16.9.18:58756, end_time: 126, caller_remote: 172.16.8.37:13014, media_type: audio, callee_local: 172.16.8.32:61298, timeout_wait: 0, caller_local: 172.16.8.32:61296}], to_tag: as798301b8, to_uri: 65981002@172.16.8.8, caller_ua: Asterisk PBX 1.8.12.0, callee_ua: one-connect, from_uri: 65982380@172.16.8.37} May 15 08:02:33 sip-3-1 media-dispatcher[3433]: debug: Got statistics: {'from_tag': 'as792f4baa', 'dialog_id': None, 'start_time': 1400133626.74, 'timed_out': False, 'call_id': ' 24b6995108fc59946c0222084a79e1a7@172.16.8.37:5060', 'to_tag': 'as798301b8', 'streams': [{'status': 'closed', 'caller_codec': 'G711a', 'post_dial_delay': 0.1750528812409, 'callee_codec': 'G711a', 'start_time': 0, 'caller_bytes': 1269200, 'callee_bytes': 1217600, 'caller_packets': 6346, 'end_time': 126, 'callee_remote': ' 172.16.9.18:58756', 'caller_remote': '172.16.8.37:13014', 'media_type': 'audio', 'callee_local': '172.16.8.32:61298', 'timeout_wait': 0, 'caller_local': '172.16.8.32:61296', 'callee_packets': 6088}], 'duration': 126, 'to_uri': '65981002@172.16.8.8', 'from_uri': ' 65982380@172.16.8.37', 'callee_ua': 'one-connect', 'caller_ua': 'Asterisk PBX 1.8.12.0'} May 15 08:02:33 sip-3-1 /usr/local/sbin/kamailio[5211]: ERROR: mediaproxy [mediaproxy.c:1689]: mediaproxy response removed^M May 15 08:02:33 sip-3-1 /usr/local/sbin/kamailio[5211]: ERROR: mediaproxy [mediaproxy.c:1702]: Len of tokens: 1 May 15 08:02:33 sip-3-1 /usr/local/sbin/kamailio
[SR-Users] insufficient ports returned from mediaproxy
:40804...@sip-core.uni-tel.local F=sip:40804...@76752600.example.comt= sip:40804XXX@172.16.9.20 IP=172.16.9.20 ID= 738ce06b2a507610599b767b6b164...@hpbxout.one-connect.dk May 15 08:02:33 sip-3-1 /usr/local/sbin/kamailio[5214]: NOTICE: acc [acc.c:275]: ACC: transaction answered: timestamp=1400133753;method=BYE;from_tag=as04fb28c3;to_tag=367167352;call_id= 51654c57361b47d0751b3d1c33d19a4d@172.16.8.34;code=200;reason=OK -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] Segmentaion fault in Kamailio 4.0.3
__FUNCTION__ = do_forward_reply #3 0x0049e15e in receive_msg (buf=value optimized out, len=313, rcv_info=0x7fff235c1cd0) at receive.c:270 msg = 0x7f0e124ce760 ctx = {rec_lev = 11, run_flags = 0, last_retcode = 206110737, jmp_env = {{__jmpbuf = {139698036884436, 11, 219309716216, 139698419720192, 140733786627520, 4294967295, 140733786627647, 1}, __mask_was_saved = 8576456, __saved_mask = {__val = {0, 28, 16, 0, 219305533392, 1, 0, 139698411461552, 219309716216, 139698036884436, 139698413732672, 139698419717800, 139698413732680, 140733786627416, 219305559701, 140733786627288} ret = value optimized out inb = { s = 0x8d8900 SIP/2.0 100 Trying\r\nVia: SIP/2.0/UDP 178.21.249.20;branch=z9hG4bK8149.c6575a95.0\r\nTo: sip:2...@78799865.pbx.one-connect.dk;tag=07c44e68\r\nFrom: sip:2...@78799865.pbx.one-connect.dk;tag=a6a1c5f60faecf035a..., len = 313} __FUNCTION__ = receive_msg #4 0x00530e46 in udp_rcv_loop () at udp_server.c:557 ---Type return to continue, or q return to quit--- len = 313 buf = SIP/2.0 100 Trying\r\nVia: SIP/2.0/UDP 178.21.249.20;branch=z9hG4bK8149.c6575a95.0\r\nTo: sip:2...@78799865.pbx.one-connect.dk;tag=07c44e68\r\nFrom: sip:2...@78799865.pbx.one-connect.dk;tag=a6a1c5f60faecf035a... from = 0x7f0e12538340 fromlen = 16 ri = {src_ip = {af = 2, len = 4, u = {addrl = {2993962576, 0}, addr32 = {2993962576, 0, 0, 0}, addr16 = {15952, 45684, 0, 0, 0, 0, 0, 0}, addr = Pt\262, '\000' repeats 11 times}}, dst_ip = { af = 2, len = 4, u = {addrl = {351868338, 0}, addr32 = {351868338, 0, 0, 0}, addr16 = {5554, 5369, 0, 0, 0, 0, 0, 0}, addr = \262\025\371\024, '\000' repeats 11 times}}, src_port = 35754, dst_port = 5060, proto_reserved1 = 0, proto_reserved2 = 0, src_su = {s = {sa_family = 2, sa_data = \213\252Pt\262\000\000\000\000\000\000\000}, sin = {sin_family = 2, sin_port = 43659, sin_addr = {s_addr = 2993962576}, sin_zero = \000\000\000\000\000\000\000}, sin6 = {sin6_family = 2, sin6_port = 43659, sin6_flowinfo = 2993962576, sin6_addr = {__in6_u = { __u6_addr8 = '\000' repeats 15 times, __u6_addr16 = {0, 0, 0, 0, 0, 0, 0, 0}, __u6_addr32 = {0, 0, 0, 0}}}, sin6_scope_id = 0}}, bind_address = 0x7f0e124cfbd0, proto = 1 '\001'} __FUNCTION__ = udp_rcv_loop #5 0x0046716a in main_loop () at main.c:1638 i = value optimized out pid = value optimized out si = value optimized out si_desc = udp receiver child=2 sock=178.21.249.20:5060 \000\000\000\000\200\303P\022\016\177\000\000\000\000\000\000\000\000\000\000\003\000\000\000\000\000\000\000\001\000\000\000\001\000\000\000@\350\216\000\000\000\000\000\001\000\000\000\000\000\000\000\200\350\216\000\000\000\000\000\000\000\200\020, '\000' repeats 12 times, \005\000\000\000\000\000\000 nrprocs = value optimized out __FUNCTION__ = main_loop #6 0x0046a002 in main (argc=value optimized out, argv=value optimized out) at main.c:2566 cfg_stream = value optimized out c = value optimized out r = value optimized out tmp = 0x7fff235c377f tmp_len = 0 options = 0x5c08c8 :f:cm:M:dVIhEeb:l:L:n:vKrRDTN:W:w:t:u:g:P:G:SQ:O:a:A: ret = -1 seed = 1722854551 rfd = value optimized out debug_save = value optimized out debug_flag = value optimized out dont_fork_cnt = value optimized out n_lst = value optimized out p = value optimized out __FUNCTION__ = main (gdb) -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Destination number restriction
We use something like this: if ((uri =~ ^sip:90[0-9]{6}@.*) (!avp_check($avp(s:perms),re/9/g))) { xlog($ru : No permissions to call 90X numbers ($ci)); sl_send_reply(403, No permissions to call 90XX); exit; } and then store the information in usr_prefences table. /Morten On Thu, Oct 3, 2013 at 12:14 PM, Keith ke...@hubner.co.uk wrote: Hi, I am looking to restrict calls based on destination numbers, e.g. so people can't call premium rate etc. Which module is best to achieve this? Thanks, Keith ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Destination number restriction
Check the avp documentation at http://kamailio.org/docs/modules/stable/modules/avpops.html and http://www.kamailio.org/dokuwiki/doku.php/tutorials:avpops /Morten On Thu, Oct 3, 2013 at 3:08 PM, Keith ke...@hubner.co.uk wrote: Also I would like to try and store these numbers in a the DB somehow to minimise code. Keith On Thu, Oct 3, 2013 at 1:40 PM, sr-users-requ...@lists.sip-router.orgwrote: Send sr-users mailing list submissions to sr-users@lists.sip-router.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users or, via email, send a message with subject or body 'help' to sr-users-requ...@lists.sip-router.org You can reach the person managing the list at sr-users-ow...@lists.sip-router.org When replying, please edit your Subject line so it is more specific than Re: Contents of sr-users digest... Today's Topics: 1. Destination number restriction (Keith) 2. Re: append_hf to reply generated by kamailio (Grant Bagdasarian) 3. Re: append_hf to reply generated by kamailio (Grant Bagdasarian) 4. Re: append_hf to reply generated by kamailio (Klaus Darilion) 5. Re: Destination number restriction (Morten Isaksen) -- Message: 1 Date: Thu, 3 Oct 2013 11:14:10 +0100 From: Keith ke...@hubner.co.uk To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List sr-users@lists.sip-router.org Subject: [SR-Users] Destination number restriction Message-ID: CAK7Ybu8= jnk+p4aseb66xp6_3juqxo1jhqbipvabdoeg5gj...@mail.gmail.com Content-Type: text/plain; charset=iso-8859-1 Hi, I am looking to restrict calls based on destination numbers, e.g. so people can't call premium rate etc. Which module is best to achieve this? Thanks, Keith -- next part -- An HTML attachment was scrubbed... URL: http://lists.sip-router.org/pipermail/sr-users/attachments/20131003/b0f780c0/attachment-0001.html -- Message: 2 Date: Thu, 3 Oct 2013 12:31:25 +0200 From: Grant Bagdasarian g...@cm.nl To: Kamailio (SER) - Users Mailing List sr-users@lists.sip-router.org Subject: Re: [SR-Users] append_hf to reply generated by kamailio Message-ID: FB7D97A214987F458242ACBDF87614073B1C757D31@clubvirtual40.ClubMessage.local Content-Type: text/plain; charset=us-ascii Replacing the exit statement with return, does the trick. The reply reaches the onreply_route and that's where I add the header, but after a while it generates a 483 Too Many Hops. My capture server also receives a lot of INVITE, ACK, 603 messages. A lot of Via and Record-Route headers are added to the INVITE and 603 (Via only). Why does this happen? From: sr-users-boun...@lists.sip-router.org [mailto: sr-users-boun...@lists.sip-router.org] On Behalf Of Grant Bagdasarian Sent: Thursday, October 3, 2013 11:39 AM To: sr-users@lists.sip-router.org Subject: [SR-Users] append_hf to reply generated by kamailio Hello, Is it possible to append a new header to a reply generated by Kamailio and also have it present when duplicating the message to a capture server? At the moment the 603 Reply is duplicated to my capture server, but I don't know how to append a new header, because the kamailio script stops executing after exit is called. From what I understood: onreply_route is only executed when receiving replies. Is there a reply_route which is executed for all replies, including the ones generated by kamailio itself? For instance inside this code block: request_route { . if($var(routing_query_result) =~ DESTINATION_NOT_ALLOWED) { xlog(L_INFO, [R-CORE-INCOMING-INVITE:$ci] ! Rejecting the call, because the destination is not allowed\r\n); sl_send_reply(603, Decline); exit; } . } -- next part -- An HTML attachment was scrubbed... URL: http://lists.sip-router.org/pipermail/sr-users/attachments/20131003/1b8d073f/attachment-0001.html -- Message: 3 Date: Thu, 3 Oct 2013 12:57:22 +0200 From: Grant Bagdasarian g...@cm.nl To: Kamailio (SER) - Users Mailing List sr-users@lists.sip-router.org Subject: Re: [SR-Users] append_hf to reply generated by kamailio Message-ID: FB7D97A214987F458242ACBDF87614073B1C757D49@clubvirtual40.ClubMessage.local Content-Type: text/plain; charset=us-ascii My bad, I forgot to make something clear. The IF statement is in a different route which is called by de main request_route. So when the return statement is executed the control is passed back to the main request_route, which in turn relays the INVITE back to itself. That's probably causing the 483 Too Many Hops response
Re: [SR-Users] Diversion header authentication
Hi, Try to give is_user_in() the whole URI as in sip:username@domain or just username@domain. I am not sure what format it expects. /Morten On Wed, Apr 10, 2013 at 12:03 PM, phillman25 phillma...@gmail.com wrote: Thank you Daniel and Morten for your assistance and prompt reply. To use the tobody transformation, i see that i would need to upgrade to 4.1 right? Im currently on 3.3. I tried the below code: $var(i)=0; while($(hdr(Diversion)[$var(i)]) != $null ) { $avp(s:divhdr) = $(hdr(Diversion)[$var(i)]); avp_subst($avp(s:divhdr), /.*sip:(.*)(@.*)/\1/); xlog(L_WARN, $avp(s:divhdr)); if (!is_user_in($avp(s:divhdr), 7)) { sl_send_reply(403, NOT ALLOWED); exit; }; $var(i) = $var(i) +1; } However, it seems like group module cant parse the output 313 as seen below: Apr 10 13:16:43 SipProxy-Test /usr/local/sbin/kamailio[7471]: WARNING: script: 313 Apr 10 13:16:43 SipProxy-Test /usr/local/sbin/kamailio[7471]: ERROR: group [group.c:114]: failed to parse URI 313 Apr 10 13:16:43 SipProxy-Test /usr/local/sbin/kamailio[7471]: ERROR: group [group.c:158]: failed to get username@domain A bigger issue is that a certain client is sending more than one diversion header with different format as seen below: Diversion: tel:22030009;reason=no-answer;screen=no;privacy=off Diversion: Solonas A sip:16@10.10.10.22;reason=unconditional So in this case i cant really know how to extract the diversion number using a static substitution. Is there a way to adapt to different formats to extract the diversion number? Thanking you in advance Phillip Date: Tue, 09 Apr 2013 16:43:56 +0200 From: Daniel-Constantin Mierla mico...@gmail.com Subject: Re: [SR-Users] Diversion header authentication To: Kamailio (SER) - Users Mailing List sr-users@lists.sip-router.org Message-ID: 5164292c.4080...@gmail.com Content-Type: text/plain; charset=iso-8859-1; Format=flowed Hello, just adding that the tobody transformation could be handy to extract the user or uri part of a Diversion header, not to fight with subst expressions: - http://www.kamailio.org/wiki/cookbooks/devel/transformations#to-body_transformations Cheers, Daniel On 4/9/13 3:16 PM, Morten Isaksen wrote: Hi, I have not tested this, but try: $avp(s:divhdr) = $(hdr(Diversion)[$var(i)]); avp_subst($avp(s:divhdr), /.*sip:\+45(.*)(@.*)/\1/); # Extract number between +45 and @ if (is_user_in($avp(s:divhdr), 1) { ... } Please note that there can be more than one Diverseion header. In that case you can use: $var(i)=0; while($(hdr(Diversion)[$var(i)]) != $null ) { $avp(s:divhdr) = $(hdr(Diversion)[$var(i)]); xlog(L_WARN, $avp(s:divhdr)); $var(i) = $var(i) +1; } /Morten ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Diversion header authentication
Hi, I have not tested this, but try: $avp(s:divhdr) = $(hdr(Diversion)[$var(i)]); avp_subst($avp(s:divhdr), /.*sip:\+45(.*)(@.*)/\1/); # Extract number between +45 and @ if (is_user_in($avp(s:divhdr), 1) { ... } Please note that there can be more than one Diverseion header. In that case you can use: $var(i)=0; while($(hdr(Diversion)[$var(i)]) != $null ) { $avp(s:divhdr) = $(hdr(Diversion)[$var(i)]); xlog(L_WARN, $avp(s:divhdr)); $var(i) = $var(i) +1; } /Morten On Tue, Apr 9, 2013 at 11:12 AM, phillman25 phillma...@gmail.com wrote: Dear List I am currently using the group module to authenticate inbound calls using the From header using the below code: if (!is_user_in(From, 1)) { sl_send_reply(403, NOT ALLOWED); exit; }; }; I want to now authenticate the Diversion header, when the call is diverted, the same way as above using the group module how could i proceed with this? thanking you in advance Phillip ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] db_mode 3 in usrloc module
I have tried backport the usrloc and permissions module from 3.1.6 but I get the same error. :( I have just tried to backport commit d173cc2dab95dba6ededdaa352bf1e2bde1faa0f (srdb1: keep PID per DB connection) and so far it seems to work in the test enviroment. /Morten On Wed, Mar 27, 2013 at 2:49 PM, Morten Isaksen mi...@misak.dk wrote: I did a diff on the usrloc from version 3.1.1 and 3.1.6 and the db handles is the only change. /Morten On Wed, Mar 27, 2013 at 2:44 PM, Daniel-Constantin Mierla mico...@gmail.com wrote: On 3/27/13 2:25 PM, Morten Isaksen wrote: Thanks, Daniel. We have a few custom patches in this version, so I will try this patch first, and if it does not work I will try to upgrade to 3.1.6. Look at the log in branch 3.1, there might be other related patches to the module done before this one. Cheers, Daniel /Morten On Wed, Mar 27, 2013 at 1:35 PM, Daniel-Constantin Mierla mico...@gmail.com wrote: Hello, very likely is related to: - http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=97f788a3f1e4e993c99fb1225a1fbcbe4ff0ffc8 You should upgrade to latest in 3.1.x series, nothing needs to be changed in terms of configuration file or database. You install over the latest version in that branch. Not recommended, but ultimately you can get only the patch. But if you apply the patches for the other fixed issues in the branch, you end up in latest version. Cheers, Daniel On 3/27/13 1:07 PM, Morten Isaksen wrote: Hi again, A small update. If I raise debug from debug=2 to debug=3 it starts every time. And once about every 20 times I start kamailio it also runs fine. On Wed, Mar 27, 2013 at 11:02 AM, Morten Isaksen mi...@misak.dk wrote: Hi, I have an older installation of Kamailio (3.1.1). It is configured with modparam(usrloc, db_mode, 2) I tried to change this to modparam(usrloc, db_mode, 3) to not have to restart kamailio when I change the alias table directly from SQL. But then kamailio shutsdown after about one second with this error: Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [db.c:408]: invalid version 0 for table trusted found, expected 5 (check table structure and table version) Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: permissions [trusted.c:250]: error during table version check. Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [sr_module.c:832]: init_mod_child(): Error while initializing module permissions (/usr/local/lib/kamailio/modules_k/permissions.so) Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [pt.c:481]: ERROR: fork_tcp_process(): init_child failed for process 28, pid 11510, tcp receiver child=6 Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [tcp_main.c:4811]: ERROR: tcp_main: fork failed: Success Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11512]: : core [pass_fd.c:293]: ERROR: receive_fd: EOF on 44 Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11482]: ALERT: core [main.c:738]: child process 11510 exited normally, status=255 Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11482]: INFO: core [main.c:756]: INFO: terminating due to SIGCHLD I have not made any changes to the permissions/trusted module, so I suspect it is some shared database conection problem. Is it a known bug in this version? I would prefer not to upgrade the installation and hopes one of you can point me to a patch I can backport. -- Morten Isaksen -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-us...@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio World Conference, April 16-17, 2013, Berlin - http://conference.kamailio.com - ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-us...@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio World Conference, April 16-17, 2013, Berlin - http://conference.kamailio.com - ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen -- Morten Isaksen
[SR-Users] db_mode 3 in usrloc module
Hi, I have an older installation of Kamailio (3.1.1). It is configured with modparam(usrloc, db_mode, 2) I tried to change this to modparam(usrloc, db_mode, 3) to not have to restart kamailio when I change the alias table directly from SQL. But then kamailio shutsdown after about one second with this error: Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [db.c:408]: invalid version 0 for table trusted found, expected 5 (check table structure and table version) Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: permissions [trusted.c:250]: error during table version check. Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [sr_module.c:832]: init_mod_child(): Error while initializing module permissions (/usr/local/lib/kamailio/modules_k/permissions.so) Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [pt.c:481]: ERROR: fork_tcp_process(): init_child failed for process 28, pid 11510, tcp receiver child=6 Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [tcp_main.c:4811]: ERROR: tcp_main: fork failed: Success Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11512]: : core [pass_fd.c:293]: ERROR: receive_fd: EOF on 44 Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11482]: ALERT: core [main.c:738]: child process 11510 exited normally, status=255 Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11482]: INFO: core [main.c:756]: INFO: terminating due to SIGCHLD I have not made any changes to the permissions/trusted module, so I suspect it is some shared database conection problem. Is it a known bug in this version? I would prefer not to upgrade the installation and hopes one of you can point me to a patch I can backport. -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] db_mode 3 in usrloc module
Hi again, A small update. If I raise debug from debug=2 to debug=3 it starts every time. And once about every 20 times I start kamailio it also runs fine. On Wed, Mar 27, 2013 at 11:02 AM, Morten Isaksen mi...@misak.dk wrote: Hi, I have an older installation of Kamailio (3.1.1). It is configured with modparam(usrloc, db_mode, 2) I tried to change this to modparam(usrloc, db_mode, 3) to not have to restart kamailio when I change the alias table directly from SQL. But then kamailio shutsdown after about one second with this error: Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [db.c:408]: invalid version 0 for table trusted found, expected 5 (check table structure and table version) Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: permissions [trusted.c:250]: error during table version check. Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [sr_module.c:832]: init_mod_child(): Error while initializing module permissions (/usr/local/lib/kamailio/modules_k/permissions.so) Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [pt.c:481]: ERROR: fork_tcp_process(): init_child failed for process 28, pid 11510, tcp receiver child=6 Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [tcp_main.c:4811]: ERROR: tcp_main: fork failed: Success Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11512]: : core [pass_fd.c:293]: ERROR: receive_fd: EOF on 44 Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11482]: ALERT: core [main.c:738]: child process 11510 exited normally, status=255 Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11482]: INFO: core [main.c:756]: INFO: terminating due to SIGCHLD I have not made any changes to the permissions/trusted module, so I suspect it is some shared database conection problem. Is it a known bug in this version? I would prefer not to upgrade the installation and hopes one of you can point me to a patch I can backport. -- Morten Isaksen -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] db_mode 3 in usrloc module
Thanks, Daniel. We have a few custom patches in this version, so I will try this patch first, and if it does not work I will try to upgrade to 3.1.6. /Morten On Wed, Mar 27, 2013 at 1:35 PM, Daniel-Constantin Mierla mico...@gmail.com wrote: Hello, very likely is related to: - http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=97f788a3f1e4e993c99fb1225a1fbcbe4ff0ffc8 You should upgrade to latest in 3.1.x series, nothing needs to be changed in terms of configuration file or database. You install over the latest version in that branch. Not recommended, but ultimately you can get only the patch. But if you apply the patches for the other fixed issues in the branch, you end up in latest version. Cheers, Daniel On 3/27/13 1:07 PM, Morten Isaksen wrote: Hi again, A small update. If I raise debug from debug=2 to debug=3 it starts every time. And once about every 20 times I start kamailio it also runs fine. On Wed, Mar 27, 2013 at 11:02 AM, Morten Isaksen mi...@misak.dk wrote: Hi, I have an older installation of Kamailio (3.1.1). It is configured with modparam(usrloc, db_mode, 2) I tried to change this to modparam(usrloc, db_mode, 3) to not have to restart kamailio when I change the alias table directly from SQL. But then kamailio shutsdown after about one second with this error: Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [db.c:408]: invalid version 0 for table trusted found, expected 5 (check table structure and table version) Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: permissions [trusted.c:250]: error during table version check. Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [sr_module.c:832]: init_mod_child(): Error while initializing module permissions (/usr/local/lib/kamailio/modules_k/permissions.so) Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [pt.c:481]: ERROR: fork_tcp_process(): init_child failed for process 28, pid 11510, tcp receiver child=6 Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [tcp_main.c:4811]: ERROR: tcp_main: fork failed: Success Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11512]: : core [pass_fd.c:293]: ERROR: receive_fd: EOF on 44 Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11482]: ALERT: core [main.c:738]: child process 11510 exited normally, status=255 Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11482]: INFO: core [main.c:756]: INFO: terminating due to SIGCHLD I have not made any changes to the permissions/trusted module, so I suspect it is some shared database conection problem. Is it a known bug in this version? I would prefer not to upgrade the installation and hopes one of you can point me to a patch I can backport. -- Morten Isaksen -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-us...@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio World Conference, April 16-17, 2013, Berlin - http://conference.kamailio.com - ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] db_mode 3 in usrloc module
I did a diff on the usrloc from version 3.1.1 and 3.1.6 and the db handles is the only change. /Morten On Wed, Mar 27, 2013 at 2:44 PM, Daniel-Constantin Mierla mico...@gmail.com wrote: On 3/27/13 2:25 PM, Morten Isaksen wrote: Thanks, Daniel. We have a few custom patches in this version, so I will try this patch first, and if it does not work I will try to upgrade to 3.1.6. Look at the log in branch 3.1, there might be other related patches to the module done before this one. Cheers, Daniel /Morten On Wed, Mar 27, 2013 at 1:35 PM, Daniel-Constantin Mierla mico...@gmail.com wrote: Hello, very likely is related to: - http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=97f788a3f1e4e993c99fb1225a1fbcbe4ff0ffc8 You should upgrade to latest in 3.1.x series, nothing needs to be changed in terms of configuration file or database. You install over the latest version in that branch. Not recommended, but ultimately you can get only the patch. But if you apply the patches for the other fixed issues in the branch, you end up in latest version. Cheers, Daniel On 3/27/13 1:07 PM, Morten Isaksen wrote: Hi again, A small update. If I raise debug from debug=2 to debug=3 it starts every time. And once about every 20 times I start kamailio it also runs fine. On Wed, Mar 27, 2013 at 11:02 AM, Morten Isaksen mi...@misak.dk wrote: Hi, I have an older installation of Kamailio (3.1.1). It is configured with modparam(usrloc, db_mode, 2) I tried to change this to modparam(usrloc, db_mode, 3) to not have to restart kamailio when I change the alias table directly from SQL. But then kamailio shutsdown after about one second with this error: Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [db.c:408]: invalid version 0 for table trusted found, expected 5 (check table structure and table version) Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: permissions [trusted.c:250]: error during table version check. Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [sr_module.c:832]: init_mod_child(): Error while initializing module permissions (/usr/local/lib/kamailio/modules_k/permissions.so) Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [pt.c:481]: ERROR: fork_tcp_process(): init_child failed for process 28, pid 11510, tcp receiver child=6 Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11510]: ERROR: core [tcp_main.c:4811]: ERROR: tcp_main: fork failed: Success Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11512]: : core [pass_fd.c:293]: ERROR: receive_fd: EOF on 44 Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11482]: ALERT: core [main.c:738]: child process 11510 exited normally, status=255 Mar 26 20:38:55 sip-3-1 /usr/local/sbin/kamailio[11482]: INFO: core [main.c:756]: INFO: terminating due to SIGCHLD I have not made any changes to the permissions/trusted module, so I suspect it is some shared database conection problem. Is it a known bug in this version? I would prefer not to upgrade the installation and hopes one of you can point me to a patch I can backport. -- Morten Isaksen -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-us...@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio World Conference, April 16-17, 2013, Berlin - http://conference.kamailio.com - ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-us...@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio World Conference, April 16-17, 2013, Berlin - http://conference.kamailio.com - ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Kamailio World Conference - Registration is open
Anyone else have trrouble registering with bank transfer? When I click submit I just get redirected to http://conference.kamailio.com/k01/ /Morten On Mon, Jan 7, 2013 at 6:00 PM, Daniel-Constantin Mierla mico...@gmail.comwrote: Hello, the registration for Kamailio World Conference is now open! You can see more details and register at: - http://conference.kamailio.**com/k01/registration/http://conference.kamailio.com/k01/registration/ There is already a great group of speakers and interesting proposed talks. More regarding the content will be published in the near future, keep an eye on event's web site: - http://conference.kamailio.com If you are considering to speak at the conference, submit your proposal as soon as possible, the slots are filling up quickly. Looking forward to meeting many of you at the conference! Daniel -- Daniel-Constantin Mierla - http://www.asipto.com http://twitter.com/#!/miconda - http://www.linkedin.com/in/**micondahttp://www.linkedin.com/in/miconda __**_ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/**cgi-bin/mailman/listinfo/sr-**usershttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] OPTIONS packet from dispatcher module
Hi, I have an issue with the OPTIONS packets from the dispatcher module does not contain a max-forward header. This causes the gateway in the other end to not reply to the OPTIONS packet. Can anyone please give a hint where en the code I need to change that. I noticed that dispatcher module uses the tm module to send the OPTIONS but after that I got lost in the code. -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] Shared memory fragmentation
Hi, We have 2 Kamailio 3.0.3 servers that has been running with carrierroute for about 2 years without any problems. They have 128 MB shared memory and modparam(carrierroute, config_source, db) modparam(carrierroute, db_url, DBURL) modparam(carrierroute, fetch_rows, 500) The carrierroute table is about 91K lines and have been growing slowly. Suddenly we get this ERROR: carrierroute [cr_data.c:585]: could not allocate shared memory from available pool after a few kamctl cr reload. I increased the shared memory to 256 MB but with the same result. I have now increased it to 512 MB and it seems to work better now. I have noticed this. After a restart the shmem counters is like this: shmem:total_size = 536870912 shmem:used_size = 28486752 shmem:real_used_size = 40147128 shmem:max_used_size = 41135424 shmem:free_size = 496723784 shmem:fragments = 555 And after the first kamctl cr reload it is like this: shmem:total_size = 536870912 shmem:used_size = 28619016 shmem:real_used_size = 51842768 shmem:max_used_size = 76993616 shmem:free_size = 485028144 shmem:fragments = 722063 Notice the increase in fragments. Sequentials kamctl cr reload does not change the fragments allot. Any ideas? -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Group-based routing (Carrierroute - DRouting)
In carrierroute you can specify carrier and domain and do group bares routing based on these values. /Morten On Thu, Jan 19, 2012 at 2:58 PM, Carlo Dimaggio jaasmail...@gmail.com wrote: Hi all, I need group-based routing, that is I want a routing table for each type of subscriber (residential, business,...). I have seen that Drouting does it throught groupID and I'm wondering about the same behaviour with carrierroute module (as LCR uses only flat costs). Can the carrier parameter be the right way to do it? I have no special requirement about the number of routes. However, Is the DRouting actively maintained? Regards, ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] route return value confusion
I had a similar problem with avp_db_query if (avp_db_query(...) == -2) { xlog(...); } did not work, but $var(r) = avp_db_query(); if ($var(r) == -2) { xlog(...); } did work. /Morten On Sat, Dec 10, 2011 at 3:16 PM, Juha Heinanen j...@tutpro.com wrote: i have defined two routes: route [TEST_ROUTE_MINUS_ONE] { return (-1); } route [TEST_ROUTE_PLUS_ONE] { return (1); } and then test them with these statements: if (route(TEST_ROUTE_MINUS_ONE) == -1) { xlog(L_INFO, TEST_ROUTE returned -1\n); } if (!route(TEST_ROUTE_MINUS_ONE)) { xlog(L_INFO, TEST_ROUTE returned failure\n); } if (route(TEST_ROUTE_PLUS_ONE) == 1) { xlog(L_INFO, TEST_ROUTE returned 1\n); } if (route(TEST_ROUTE_PLUS_ONE)) { xlog(L_INFO, TEST_ROUTE returned success\n); } can someone explain, why i get only three lines to syslog? Dec 10 16:14:56 sip /usr/sbin/sip-proxy[16099]: INFO: TEST_ROUTE_MINUS_ONE returned failure Dec 10 16:14:56 sip /usr/sbin/sip-proxy[16099]: INFO: TEST_ROUTE_PLUS_ONE returned 1 Dec 10 16:14:56 sip /usr/sbin/sip-proxy[16099]: INFO: TEST_ROUTE_PLUS_ONE returned success -- juha ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Kamailio Dispatcher and FreeSwitch, Too many hops.
Please send the full capture. 2011/10/10 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: When trying to dial 101 this is a tshark output on the Kamailio: 0.00 71.12.95.46 - 215.183.255.142 SIP Status: 480 Temporarily Unavailable 0.000196 215.183.255.142 - 71.12.95.46 SIP Request: ACK sip:1...@sip.my-domain.com 0.000255 215.183.255.142 - 95.214.24.165 SIP Status: 480 Temporarily Unavailable 0.447130 95.214.24.165 - 215.183.255.142 SIP Request: ACK sip:1...@sip.my-domain.com On Sun, Oct 9, 2011 at 12:14 PM, Morten Isaksen mi...@misak.dk wrote: From Kamailio. 2011/10/8 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: From Kamailio or FreeSwitch? On Sat, Oct 8, 2011 at 10:28 PM, Morten Isaksen mi...@misak.dk wrote: Can you capture one of the calls that fails with tcpdump. Also try to add some xlog lines in the configuration file for debuging. What does the log from rtpproxy show? 2011/10/8 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: Dear Morten and everyone else. I'm still struggling with Kamailio as a simple dispatcher for FreeSwitch. This is my configuration so far (with help from Morten): http://pastebin.com/nBPSpe6S Connecting an iPhone and an Android makes the calls between them timeout. Connecting one of the phones and my laptops makes calls between them produce the error Too many hops. With all of them I'm able to call in to the Freeswitch, for listening to voicemail, hold music etc. So I guess it's still NAT problems or similar? Can anyone spot the error, missing thing or something else that is wrong with the config? P.S. Adding phones, laptops etc. directly to FreeSwitch, without Kamailio, makes everything works. 2011/10/7 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com Hi Morten. I've tested it a lot know, your latest config-example. At it actually works when I connect 2 devices, 1 iPhone and 1 Android. But when connecting 1 phone and my laptop with SFLPhone or Linphone I cannot call the laptop. Does that make any sense? 2011/10/6 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com Still getting Too Many Hops :( On Thu, Oct 6, 2011 at 10:19 PM, Morten Isaksen mi...@misak.dk wrote: Try this one http://pastebin.com/mahKECAw /Morten 2011/10/6 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: Hi Morten. I've tried to add that part: http://pastebin.com/MmKnbKLz But now it won't even register. Do you know any config-example for a working dispatcher for Kamailio? On Thu, Oct 6, 2011 at 10:54 AM, Morten Isaksen mi...@misak.dk wrote: This part # handle requests within SIP dialogs route(WITHINDLG); 2011/10/6 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: Hi Morten. Do you mean anything specific in the standard config: http://pastebin.com/Aj4mHAJq Because that handles registrations, subscriber list etc. etc... I'm only interested in Kamailio as a dispatcher. And I've already tried adding the PATH module with the use_received parameter and add_path() and add_path_received() functions. That didn't help. On Wed, Oct 5, 2011 at 7:41 PM, Morten Isaksen mi...@misak.dk wrote: Hi, You need to handle in dialog routing - check one of the configs that ships with kamailio. Right now Kamailio forwards all SIP packets to freeswitch, even the ones that freeswitch sends to Kamailio. /Morten 2011/10/5 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: I have a setup with Kamailio as dispatcher in front of a FreeSwitch server. This is my kamailio.cfg: http://pastebin.com/8PR2GFBD I'm currently getting Too many hops when calling between SIP clients. I am able to call to FreeSwitch and listen to voicemail, hold music etc. After a long conversation with a FreeSwitch expert, and some tests, I was told that Kamailio delivers the wrong IP (NAT problems) to FreeSwitch. I've also run tshark on both FreeSwitch and Kamailio and when calling between clients they just send the packets between each other. Can anyone help me out? I've tried to Google a lot for this problem and asked in several IRC channels, mailing lists and forums. Without any luck. ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Kamailio Dispatcher and FreeSwitch, Too many hops.
From Kamailio. 2011/10/8 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: From Kamailio or FreeSwitch? On Sat, Oct 8, 2011 at 10:28 PM, Morten Isaksen mi...@misak.dk wrote: Can you capture one of the calls that fails with tcpdump. Also try to add some xlog lines in the configuration file for debuging. What does the log from rtpproxy show? 2011/10/8 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: Dear Morten and everyone else. I'm still struggling with Kamailio as a simple dispatcher for FreeSwitch. This is my configuration so far (with help from Morten): http://pastebin.com/nBPSpe6S Connecting an iPhone and an Android makes the calls between them timeout. Connecting one of the phones and my laptops makes calls between them produce the error Too many hops. With all of them I'm able to call in to the Freeswitch, for listening to voicemail, hold music etc. So I guess it's still NAT problems or similar? Can anyone spot the error, missing thing or something else that is wrong with the config? P.S. Adding phones, laptops etc. directly to FreeSwitch, without Kamailio, makes everything works. 2011/10/7 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com Hi Morten. I've tested it a lot know, your latest config-example. At it actually works when I connect 2 devices, 1 iPhone and 1 Android. But when connecting 1 phone and my laptop with SFLPhone or Linphone I cannot call the laptop. Does that make any sense? 2011/10/6 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com Still getting Too Many Hops :( On Thu, Oct 6, 2011 at 10:19 PM, Morten Isaksen mi...@misak.dk wrote: Try this one http://pastebin.com/mahKECAw /Morten 2011/10/6 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: Hi Morten. I've tried to add that part: http://pastebin.com/MmKnbKLz But now it won't even register. Do you know any config-example for a working dispatcher for Kamailio? On Thu, Oct 6, 2011 at 10:54 AM, Morten Isaksen mi...@misak.dk wrote: This part # handle requests within SIP dialogs route(WITHINDLG); 2011/10/6 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: Hi Morten. Do you mean anything specific in the standard config: http://pastebin.com/Aj4mHAJq Because that handles registrations, subscriber list etc. etc... I'm only interested in Kamailio as a dispatcher. And I've already tried adding the PATH module with the use_received parameter and add_path() and add_path_received() functions. That didn't help. On Wed, Oct 5, 2011 at 7:41 PM, Morten Isaksen mi...@misak.dk wrote: Hi, You need to handle in dialog routing - check one of the configs that ships with kamailio. Right now Kamailio forwards all SIP packets to freeswitch, even the ones that freeswitch sends to Kamailio. /Morten 2011/10/5 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: I have a setup with Kamailio as dispatcher in front of a FreeSwitch server. This is my kamailio.cfg: http://pastebin.com/8PR2GFBD I'm currently getting Too many hops when calling between SIP clients. I am able to call to FreeSwitch and listen to voicemail, hold music etc. After a long conversation with a FreeSwitch expert, and some tests, I was told that Kamailio delivers the wrong IP (NAT problems) to FreeSwitch. I've also run tshark on both FreeSwitch and Kamailio and when calling between clients they just send the packets between each other. Can anyone help me out? I've tried to Google a lot for this problem and asked in several IRC channels, mailing lists and forums. Without any luck. ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Kamailio Dispatcher and FreeSwitch, Too many hops.
Can you capture one of the calls that fails with tcpdump. Also try to add some xlog lines in the configuration file for debuging. What does the log from rtpproxy show? 2011/10/8 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: Dear Morten and everyone else. I'm still struggling with Kamailio as a simple dispatcher for FreeSwitch. This is my configuration so far (with help from Morten): http://pastebin.com/nBPSpe6S Connecting an iPhone and an Android makes the calls between them timeout. Connecting one of the phones and my laptops makes calls between them produce the error Too many hops. With all of them I'm able to call in to the Freeswitch, for listening to voicemail, hold music etc. So I guess it's still NAT problems or similar? Can anyone spot the error, missing thing or something else that is wrong with the config? P.S. Adding phones, laptops etc. directly to FreeSwitch, without Kamailio, makes everything works. 2011/10/7 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com Hi Morten. I've tested it a lot know, your latest config-example. At it actually works when I connect 2 devices, 1 iPhone and 1 Android. But when connecting 1 phone and my laptop with SFLPhone or Linphone I cannot call the laptop. Does that make any sense? 2011/10/6 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com Still getting Too Many Hops :( On Thu, Oct 6, 2011 at 10:19 PM, Morten Isaksen mi...@misak.dk wrote: Try this one http://pastebin.com/mahKECAw /Morten 2011/10/6 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: Hi Morten. I've tried to add that part: http://pastebin.com/MmKnbKLz But now it won't even register. Do you know any config-example for a working dispatcher for Kamailio? On Thu, Oct 6, 2011 at 10:54 AM, Morten Isaksen mi...@misak.dk wrote: This part # handle requests within SIP dialogs route(WITHINDLG); 2011/10/6 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: Hi Morten. Do you mean anything specific in the standard config: http://pastebin.com/Aj4mHAJq Because that handles registrations, subscriber list etc. etc... I'm only interested in Kamailio as a dispatcher. And I've already tried adding the PATH module with the use_received parameter and add_path() and add_path_received() functions. That didn't help. On Wed, Oct 5, 2011 at 7:41 PM, Morten Isaksen mi...@misak.dk wrote: Hi, You need to handle in dialog routing - check one of the configs that ships with kamailio. Right now Kamailio forwards all SIP packets to freeswitch, even the ones that freeswitch sends to Kamailio. /Morten 2011/10/5 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: I have a setup with Kamailio as dispatcher in front of a FreeSwitch server. This is my kamailio.cfg: http://pastebin.com/8PR2GFBD I'm currently getting Too many hops when calling between SIP clients. I am able to call to FreeSwitch and listen to voicemail, hold music etc. After a long conversation with a FreeSwitch expert, and some tests, I was told that Kamailio delivers the wrong IP (NAT problems) to FreeSwitch. I've also run tshark on both FreeSwitch and Kamailio and when calling between clients they just send the packets between each other. Can anyone help me out? I've tried to Google a lot for this problem and asked in several IRC channels, mailing lists and forums. Without any luck. ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org
Re: [SR-Users] Kamailio Dispatcher and FreeSwitch, Too many hops.
This part # handle requests within SIP dialogs route(WITHINDLG); 2011/10/6 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: Hi Morten. Do you mean anything specific in the standard config: http://pastebin.com/Aj4mHAJq Because that handles registrations, subscriber list etc. etc... I'm only interested in Kamailio as a dispatcher. And I've already tried adding the PATH module with the use_received parameter and add_path() and add_path_received() functions. That didn't help. On Wed, Oct 5, 2011 at 7:41 PM, Morten Isaksen mi...@misak.dk wrote: Hi, You need to handle in dialog routing - check one of the configs that ships with kamailio. Right now Kamailio forwards all SIP packets to freeswitch, even the ones that freeswitch sends to Kamailio. /Morten 2011/10/5 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: I have a setup with Kamailio as dispatcher in front of a FreeSwitch server. This is my kamailio.cfg: http://pastebin.com/8PR2GFBD I'm currently getting Too many hops when calling between SIP clients. I am able to call to FreeSwitch and listen to voicemail, hold music etc. After a long conversation with a FreeSwitch expert, and some tests, I was told that Kamailio delivers the wrong IP (NAT problems) to FreeSwitch. I've also run tshark on both FreeSwitch and Kamailio and when calling between clients they just send the packets between each other. Can anyone help me out? I've tried to Google a lot for this problem and asked in several IRC channels, mailing lists and forums. Without any luck. ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Kamailio Dispatcher and FreeSwitch, Too many hops.
Try this one http://pastebin.com/mahKECAw /Morten 2011/10/6 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: Hi Morten. I've tried to add that part: http://pastebin.com/MmKnbKLz But now it won't even register. Do you know any config-example for a working dispatcher for Kamailio? On Thu, Oct 6, 2011 at 10:54 AM, Morten Isaksen mi...@misak.dk wrote: This part # handle requests within SIP dialogs route(WITHINDLG); 2011/10/6 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: Hi Morten. Do you mean anything specific in the standard config: http://pastebin.com/Aj4mHAJq Because that handles registrations, subscriber list etc. etc... I'm only interested in Kamailio as a dispatcher. And I've already tried adding the PATH module with the use_received parameter and add_path() and add_path_received() functions. That didn't help. On Wed, Oct 5, 2011 at 7:41 PM, Morten Isaksen mi...@misak.dk wrote: Hi, You need to handle in dialog routing - check one of the configs that ships with kamailio. Right now Kamailio forwards all SIP packets to freeswitch, even the ones that freeswitch sends to Kamailio. /Morten 2011/10/5 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: I have a setup with Kamailio as dispatcher in front of a FreeSwitch server. This is my kamailio.cfg: http://pastebin.com/8PR2GFBD I'm currently getting Too many hops when calling between SIP clients. I am able to call to FreeSwitch and listen to voicemail, hold music etc. After a long conversation with a FreeSwitch expert, and some tests, I was told that Kamailio delivers the wrong IP (NAT problems) to FreeSwitch. I've also run tshark on both FreeSwitch and Kamailio and when calling between clients they just send the packets between each other. Can anyone help me out? I've tried to Google a lot for this problem and asked in several IRC channels, mailing lists and forums. Without any luck. ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Kamailio Dispatcher and FreeSwitch, Too many hops.
Hi, You need to handle in dialog routing - check one of the configs that ships with kamailio. Right now Kamailio forwards all SIP packets to freeswitch, even the ones that freeswitch sends to Kamailio. /Morten 2011/10/5 Henrik Aagaard Sørensen henrikaagaardsoren...@gmail.com: I have a setup with Kamailio as dispatcher in front of a FreeSwitch server. This is my kamailio.cfg: http://pastebin.com/8PR2GFBD I'm currently getting Too many hops when calling between SIP clients. I am able to call to FreeSwitch and listen to voicemail, hold music etc. After a long conversation with a FreeSwitch expert, and some tests, I was told that Kamailio delivers the wrong IP (NAT problems) to FreeSwitch. I've also run tshark on both FreeSwitch and Kamailio and when calling between clients they just send the packets between each other. Can anyone help me out? I've tried to Google a lot for this problem and asked in several IRC channels, mailing lists and forums. Without any luck. ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] dispatcher, LCR, carrierroute or mtree?
You can reload from command line with kamctl fifo mt_reload tree name /Morten On Tue, Oct 4, 2011 at 2:07 AM, Skyler skchopper...@gmail.com wrote: Hi Daniel, Does mt_reload need to be run upon adding/removing entries in db? If so, is there a way to run mt_reload automatically every so often via kamailio.cfg? What would I be searching in docs to find an example of that? Cheers, Skyler On Mon, 2011-10-03 at 18:14 +0200, Daniel-Constantin Mierla wrote: Hello, what I use in such case is a combination between mtree and dispatcher. DIDs are matched against mtree and as a result on successful match is the ID to use with dispatcher to find where to relay/redirect it. Cheers, Daniel On 10/3/11 9:23 AM, Skyler wrote: Hi all, I need to setup an inbound DID router for 8 proxies and ~300 DID's. Very simple, a call comes in from pstn kamailio looks up DID for exact match in mysql returns location If db result returns noservice redirect to 1.2.3.4 else remain in call-flow and send to destination. Having a failure route capability would be nice. From what I've read on each of the 4 modules, any could do what I need though each have their own complexities. I'm still new to kamailio and hoping to utilize the group here for some advice. I'd like to keep this as simple as possible then adding/deleting DID's from the db as needed for routing. In your experience which would be the best module to use in order to achieve my goal? TIA, Skyler ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Incoming calls question
Hi, We use carrierroute in this scenario and it works great. You could also use htable to do the same. The drawback is that you need to reload the whole routetable in carrierroute every time you change an entry. /Morten On Mon, Oct 3, 2011 at 1:56 PM, Javier Vidal -- Quasar javier.qua...@gmail.com wrote: i have a question, i have to make a system to recieve several calls and the same time, and depending of destination DDI i have to rewrite the URI's IP. I am not going to have Registered users, only IP validation. The question is: What is the better way to consult thousands DDIs and get the IP from mysql? I had thought, use sqlops.so module, but i think that i could have problems with it. Another posibility is use the carrierroute and use the full pattern for the DDI. Thank for all sugestions. Javier V. ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] Lazy evaluation in if expressions?
Does Kamailio use lazy evaluation in if expressions? Like if ($var(a) == 2 $var(b) ==3) { ... } then $var(b) == 3 is only evaluated if $var(a) == 2 is true -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Kamailio Freezes and no calls are processed
Hi, On Sat, Aug 20, 2011 at 10:16 PM, Omar o...@321communications.com wrote: The only difference is we have added some AVPs variables to process, and kamailio stops processing new calls, is not regular, but seems is related to the number of calls received. No additional calls can be processed after certain time, or maybe some amount of calls. we were unable to isolate the problem, but kamailio.fifo is removed, which never happened before. No core dump created. did anybody have a similar issue. I had a similar issue some time ago. Look in the archives and you will find som backtraces from gdb. The problem went away when I changed the dialog module not to write to DB but only use memory. -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] Change aliases table without a restart of Kamailio
Hi, Is there any way to reload the content of the aliases table without restarting Kamailio? I have this in my cfg file if (lookup(location)) { xlog(L_WARN, Callee is online - - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); route(TO_USER_SIPCHECKS); route(RELAY); } else if (lookup(aliases)) { xlog(L_WARN, Callee is in aliases - - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); route(TO_USER_SIPCHECKS); route(RELAY); } else { xlog(L_WARN, Callee is offline - - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); t_newtran(); t_reply(486, Busy here); exit; } And changes in the aliases table does is ignored until I restart Kamailio. -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Change aliases table without a restart of Kamailio
Hi, I just learned that you can update the aliases table with kamctl alias rm and kamctl alias add. That solves my problem and I am still able to keep db_mode=2. But thanks for your help. :) /Morten On Tue, Jul 19, 2011 at 1:24 PM, Alex Balashov abalas...@evaristesys.com wrote: On 07/19/2011 07:13 AM, Morten Isaksen wrote: Does this means that I have to use db_mode=3 in order to for the changes in aliases to apear without a restart? Since there does not appear to be an MI or RPC command in usrloc to reload the table from the database side, yes. The general assumption of usrloc is that updates are made from within Kamailio and synced to the database for persistence, not the other way around. Perhaps the aliases table is not the optimal mechanism for you. That would degrade the performance much with the location table lookup. What makes you say that? How many lookup requests are you throwing at this thing? Is it more computationally expensive? Yes, absolutely. But unless you're doing tens of thousands of lookups per second, it's inconsequential on contemporary hardware. Also, RDBMs themselves do excellent caching, especially if you give them enough RAM. As Donald Knuth said, premature optimisation is the root of all evil. If I'm wrong about how big of a deal this really is, consider making creative use of 'htable' or 'memcache' as a caching strategy. -- 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/ ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Kamailio stops responding after 10 days or so
=0x7fffafb7dd20) at receive.c:196 msg = 0x0 ctx = {rec_lev = 9034719, run_flags = 0, last_retcode = 9295720, jmp_env = {{__jmpbuf = {47051129731136, 8, 47051127553476, 2, 217355168616, 47051061455248, 47051127553501, 4294967295}, __mask_was_saved = -236996544, __saved_mask = {__val = {8230504, 9007856, 16, 9482320, 140736141450636, 0, 217350982997, 1, 0, 8963168, 47051127486569, 217355168616, 2, 150476210, 217351006434, 0} ret = value optimized out inb = { s = 0x874a40 INVITE sip:20322595@178.21.248.8:5060;transport=udp SIP/2.0\r\nRecord-Route: sip:178.21.248.20;lr;ftag=as3d313976\r\nVia: SIP/2.0/UDP 178.21.248.20;branch=z9hG4bKdd3a.3d0516e1.0\r\nVia: SIP/2.0/UDP 81.27, len = 928} #11 0x005067ab in udp_rcv_loop () at udp_server.c:520 len = 928 tmp = value optimized out from = value optimized out fromlen = 16 ri = {src_ip = {af = 2, len = 4, u = {addrl = {351802802, 420}, addr32 = {351802802, 0, 420, 0}, addr16 = {5554, 5368, 0, 0, 420, 0, 0, 0}, addr = \262\025\370\024\000\000\000\000\244\001\000\000\000\000\000}}, dst_ip = {af = 2, len = 4, u = {addrl = {150476210, 0}, addr32 = {150476210, 0, 0, 0}, addr16 = {5554, 2296, 0, 0, 0, 0, 0, 0}, addr = \262\025\370\b, '\000' repeats 11 times}}, src_port = 5060, dst_port = 5060, proto_reserved1 = 0, proto_reserved2 = 0, src_su = {s = {sa_family = 2, sa_data = \023IJ\025\370\024\000\000\000\000\000\000\000}, sin = {sin_family = 2, sin_port = 50195, sin_addr = {s_addr = 351802802}, sin_zero = \000\000\000\000\000\000\000}, sin6 = {sin6_family = 2, sin6_port = 50195, sin6_flowinfo = 351802802, sin6_addr = {in6_u = { u6_addr8 = '\000' repeats 15 times, u6_addr16 = {0, 0, 0, 0, 0, 0, 0, 0}, u6_addr32 = {0, 0, 0, 0}}}, sin6_scope_id = 0}}, bind_address = 0x8972f0, proto = 1 '\001'} buf = INVITE sip:20322595@178.21.248.8:5060;transport=udp SIP/2.0\r\nRecord-Route: sip:178.21.248.20;lr;ftag=as3d313976\r\nVia: SIP/2.0/UDP 178.21.248.20;branch=z9hG4bKdd3a.3d0516e1.0\r\nVia: SIP/2.0/UDP 81.27 #12 0x00455cdf in main_loop () at main.c:1447 i = 2 pid = value optimized out si = 0x8972f0 si_desc = udp receiver child=2 sock=178.21.248.8:5060\000\000\000\000\000\004, '\000' repeats 11 times, \001, '\000' repeats 11 times, \b\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\004, '\000' repeats 23 times\350, \337\267\257\377\177\000\000\252\267H\000\000\000\000 #13 0x00456de2 in main (argc=value optimized out, argv=0x7fffafb7dfe8) at main.c:2251 cfg_stream = 0x1b95010 c = value optimized out r = value optimized out tmp = 0x7fffafb7ef76 ---Type return to continue, or q return to quit--- tmp_len = 16777216 port = 0 proto = 0 ret = value optimized out seed = 524492455 rfd = value optimized out debug_save = 0 debug_flag = 0 dont_fork_cnt = 0 n_lst = 0x0 On Thu, Apr 7, 2011 at 10:52 PM, Daniel-Constantin Mierla mico...@gmail.com wrote: Hello, do you get high CPU usage by kamailio? What you can do is to attach with gdb to kamailio processes and see what they are doing: gdb /path/to/kamailio pid_of_a_kamailio_process bt You should attach to the sip worker processes - you can find the type of processes with 'kamctl ps'. Cheers, Daniel On 4/7/11 9:02 PM, Morten Isaksen wrote: Hi! Kamailio 3.0.3. I have a strange problem with one of our Kamailio servers. This one is used for routing (with carrierroute) and to send presence information (with pua module) Once every 10 day or so I get this error and then Kamailio stops responding to any SIP packets. Apr 6 08:05:48 sip-core-1 /usr/local/sbin/kamailio[9186]: WARNING: script: Failure route - M=INVITE RURI=sip:8615x...@178.xx.xx.xx F=sip:861X@188.120.93.114:1025 T=sip:86155x...@sip1.uni-tel.dk IP=178.XX.XX.XX ID=6de881ec07f9c6494ee589cf208da358@10.11.87.206 Apr 6 08:05:48 sip-core-1 /usr/local/sbin/kamailio[9186]: ERROR: carrierroute [cr_func.c:95]: cannot find AVP 'carrier' Apr 6 08:05:48 sip-core-1 /usr/local/sbin/kamailio[9186]: ERROR: carrierroute [cr_func.c:805]: invalid carrier id -1 Apr 6 08:05:48 sip-core-1 /usr/local/sbin/kamailio[9186]: ERROR: script: cr_next_domain failed Shared memory size is 128M and over halv is free just before the error. The server is in production and does handle debug1 well, so I do not have much information in the log files. Private memory is the default size. Any ideas what it could be, or how to investegate further? I think my next steps would be to increase the private memory og to increase children=4 to children=8 -- Daniel-Constantin Mierla http://www.asipto.com -- Morten Isaksen ___ SIP
[SR-Users] ACC og ACC_RADIUS module
Hi, We have a OpenSER 1.1 platform running with radius accounting and I am in the progress of updating it to Kamailio 3.1. I am trying to decide if I should do accounting via Radius or directly to MySQL on the new platform. The only benefits a can see with Radius is that you can build some redundancy into your radius client. If one Radius server is failing then try the next and you can configure radius to log to a file if the DB is down. But i think you can get the same level of redundancy with a replicated DB setup with heartbeat/pacemaker. If I choose to do the accounting direct to MySQL I will skip the Radius layer (and one error source). Are there any other pros and cons? -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] Problem reloading carrierroute
Hi, Kamailio 3.0.3. A few days ago we got a problem when kamctl cr reload was executed. Jan 24 08:50:27 sip-core-2 /usr/local/sbin/kamailio[1639]: ERROR: db_mysql [km_dbase.c:346]: no memory left Jan 24 08:50:27 sip-core-2 /usr/local/sbin/kamailio[1639]: ERROR: carrierroute [cr_db.c:331]: Fetching rows failed Jan 24 08:50:27 sip-core-2 /usr/local/sbin/kamailio[1639]: ERROR: carrierroute [cr_data.c:181]: could not load routing data I tried to increase the shared memory from 32M to 64M but that did not seem to help. It failed again after a few hours. The last thing I tried was to insert modparam(carrierroute, fetch_rows, 2000) into kamailio.cfg and is waiting to see if that helped. The carrierroute table is about 16K rows. Is it private og shared memory that is missing? Any other ideas how to fix this? -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Problem with Kamailio not routing ACK to a 200 OK
Hi Daniel, Thank you very much for the help. I will report the bug to Aastra. /Morten On Mon, Nov 15, 2010 at 4:22 PM, Daniel-Constantin Mierla mico...@gmail.com wrote: Hello, I got the pcap file and had the time too check it. There seems to be an extra LF at the end of ACK: 0230 73 65 72 2d 41 67 65 6e 74 3a 20 41 61 73 74 72 ser-Agen t: Aastr 0240 61 20 49 6e 74 65 6c 6c 69 67 61 74 65 0d 0a 43 a Intell igate..C 0250 6f 6e 74 65 6e 74 2d 4c 65 6e 67 74 68 3a 20 30 ontent-L ength: 0 0260 0d 0a 0d 0a 0a . Once the last header is finished and ended with CRLF, there must be another CRLF and that's it if content length is 0. According to wireshark and the capture you sent, there is an extra 0x0a (LF), so instead of ending in CRLFCRLF, the ACK ends in CRLFCRLFLF You can remove the content-length check in sanity function, but I recomend you report to vendor to get the issue fixed there. Cheers, Daniel On 11/11/10 11:28 PM, Daniel-Constantin Mierla wrote: Hello, On 11/11/10 11:02 PM, Morten Isaksen wrote: Hi Daniel, The Via line is OK, it was the email formating. I am using Kamailio 3.0.3 and the sanity docs says: This function makes a row of sanity checks on the given request. The function returns false (-1) if one of the checks failed. If one of the checks fails the module sends a precise error reply via sl_send_reply. Thus there is no need to reply with a generic error message. it happens sometime that some module parameters control the behavior of exported functions and it is not mentioned in description. This one was discovered pretty recently and the description of sanity_check() don't refer to autodrop parameter. I will try to update asap. I have solved the problem by removing the sanity_check. I am just a bit curious why it failed. That should be found to see where is the failure. As a second guess based on checks, it may be that the ACK has some whitespace in the body. Do you have pcap version of this ACK trace? Daniel But thank you very much for your help. /Morten On Thu, Nov 11, 2010 at 8:20 PM, Daniel-Constantin Mierla mico...@gmail.com wrote: Hello, looking now again at the trace you sent first time, the ACK is: U 2010/10/28 10:51:13.267863 178.21.248.20:5060 - 178.21.248.7:5060 ACKsip:1...@178.21.248.56:5060 SIP/2.0. Record-Route:sip:178.21.248.20;lr;ftag=AI8DA85D59B9B6634F. Via: SIP/2.0/UDP 178.21.248.20;branch=z9hG4bK690c.97354e4.2. Via: SIP/2.0/UDP 87.104.233.108:5060;rport=5060;branch=z9hG4bK07103fe69c8af048b9b8216eb2f7233f. To:sip:86987...@sip.uni-tel.dk;tag=1c2073920452. From:sip:87776...@sip.uni-tel.dk;tag=AI8DA85D59B9B6634F. Call-ID:ai231ca9bd0a4a1...@10.0.0.150. CSeq: 2 ACK. Max-Forwards: 69. Route:sip:178.21.248.7;lr=on;ftag=AI8DA85D59B9B6634F;did=f48.5fd1db02. User-Agent: Aastra Intelligate. Content-Length: 0. I thought that it may be the email body formatting so that the second Via header body gets on next line after SIP/2.0/UDP. Can you check your trace, is it on next line (i.e., there is a new line)? If the Via is on two lines like it is presented, then it is invalid. A header body can continue on a new line, but it as to start with whitespace. Regarding sanity, the module drops silently broken messages if you don't set autodrop to 0: http://kamailio.org/docs/modules/stable/modules/sanity.html#autodrop Note that you need latest version of branch 3.1/master for it. Cheers, Daniel On 11/11/10 1:50 PM, Morten Isaksen wrote: Hi, I narrowed it down to the sanity_check. if(!sanity_check(1511, 7)) { xlog(L_WARN, sanity check - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); exit; } The sanity_check fails but does not send a reply back or log the above line. I have commented it out and now the ACK is forwarded. /Morten On Mon, Nov 8, 2010 at 3:00 PM, Morten Isaksenmi...@misak.dk wrote: Hi, On Fri, Oct 29, 2010 at 10:59 AM, Daniel-Constantin Mierla mico...@gmail.com wrote: Hello, On 10/28/10 1:37 PM, Morten Isaksen wrote: Hi, I have a strange problem with Kamailio 3.0.2. When one of our end users makes a call Kamailio does not route the ACK (in response to the 200 OK). For all other end users it works fine. For me it looks the the has_totag() checks for some reason fails and then t_check_trans() thinks it is a ACK to a local transactions and then terminates the script. Otherwise there should be more lines in the log file. if you add an xlog() after the if with has_totag(), do you get the message in the logs? Sorry for the delay, but a had to wait for the customer to make a test call. I placed a xlog(L_WARN, has_totag after - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); just after the if (has_totag()) { .. } and it does not show in the log. It looks very strange to me. Do you have any ideas what is wrong. /Morten Cheers
Re: [SR-Users] Problem with Kamailio not routing ACK to a 200 OK
Hi, I narrowed it down to the sanity_check. if(!sanity_check(1511, 7)) { xlog(L_WARN, sanity check - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); exit; } The sanity_check fails but does not send a reply back or log the above line. I have commented it out and now the ACK is forwarded. /Morten On Mon, Nov 8, 2010 at 3:00 PM, Morten Isaksen mi...@misak.dk wrote: Hi, On Fri, Oct 29, 2010 at 10:59 AM, Daniel-Constantin Mierla mico...@gmail.com wrote: Hello, On 10/28/10 1:37 PM, Morten Isaksen wrote: Hi, I have a strange problem with Kamailio 3.0.2. When one of our end users makes a call Kamailio does not route the ACK (in response to the 200 OK). For all other end users it works fine. For me it looks the the has_totag() checks for some reason fails and then t_check_trans() thinks it is a ACK to a local transactions and then terminates the script. Otherwise there should be more lines in the log file. if you add an xlog() after the if with has_totag(), do you get the message in the logs? Sorry for the delay, but a had to wait for the customer to make a test call. I placed a xlog(L_WARN, has_totag after - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); just after the if (has_totag()) { .. } and it does not show in the log. It looks very strange to me. Do you have any ideas what is wrong. /Morten Cheers, Daniel The conf is pretty standard. route{ xlog(L_WARN, New request - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); xlog(L_WARN, ua=$ua); if (!mf_process_maxfwd_header(10)) { sl_send_reply(483,Too Many Hops); exit; } if(!sanity_check(1511, 7)) { xlog(Malformed SIP message from $si:$sp\n); exit; } if (has_totag()) { xlog(L_WARN, has_totag start - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); # sequential request withing a dialog should # take the path determined by record-routing if (loose_route()) { xlog(L_WARN, loose_route - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); route(RELAY); } else { if (is_method(SUBSCRIBE) uri == myself) { # in-dialog subscribe requests #route(PRESENCE); exit; } if ( is_method(ACK) ) { if ( t_check_trans() ) { xlog(L_WARN, ACK t_check_trans - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); # non loose-route, but stateful ACK; must be an ACK after a 487 or e.g. 404 from upstream server t_relay(); exit; } else { xlog(Ignoring ACK - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); # ACK without matching transaction ... ignore and discard.\n); exit; } } sl_send_reply(404,Not here); } xlog(L_WARN, has_totag end - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); exit; } #initial requests # CANCEL processing if (is_method(CANCEL)) { if (t_check_trans()) t_relay(); exit; } setflag(4); t_check_trans(); ... The log files show: Oct 28 10:51:13 sip-core-1 /usr/local/sbin/kamailio[10503]: WARNING: script: New request - M=ACK RURI=sip:1...@178.21.248.56:5060 F=sip:87776...@sip.uni-tel.dk T=sip:869 87...@sip.uni-tel.dk IP=178.21.248.20 id=ai231ca9bd0a4a1...@10.0.0.150 Oct 28 10:51:13 sip-core-1 /usr/local/sbin/kamailio[10503]: WARNING: script: ua=Aastra Intelligate The trace U 2010/10/28 10:51:02.616337 178.21.248.7:5060 - 178.21.248.56:5060 INVITE sip:86987...@178.21.248.56 SIP/2.0. Record-Route:sip:178.21.248.7;lr;ftag=AI8DA85D59B9B6634F;did=f48.5fd1db02. Record-Route:sip:178.21.248.20;lr;ftag=AI8DA85D59B9B6634F. Via: SIP/2.0/UDP 178.21.248.7;branch=z9hG4bK690c.9cfea506.0. Via: SIP/2.0/UDP 178.21.248.20;branch=z9hG4bK690c.97354e4.0. Via: SIP/2.0/UDP 87.104.233.108:5060;rport=5060;branch=z9hG4bK3c70fae55c8b362ff34e6c782cc21592. To:sip:86987...@sip.uni-tel.dk. From:sip:87776...@sip.uni-tel.dk;tag=AI8DA85D59B9B6634F. Call-ID: ai231ca9bd0a4a1...@10.0.0.150. CSeq: 2 INVITE. Max-Forwards: 68. Contact:sip:87776...@87.104.233.108:5060;line=AI7EFC34995E724DD7. Accept: application/sdp. Allow: ACK,BYE,CANCEL,INVITE,NOTIFY,OPTIONS
Re: [SR-Users] Problem with Kamailio not routing ACK to a 200 OK
Hi, On Fri, Oct 29, 2010 at 10:59 AM, Daniel-Constantin Mierla mico...@gmail.com wrote: Hello, On 10/28/10 1:37 PM, Morten Isaksen wrote: Hi, I have a strange problem with Kamailio 3.0.2. When one of our end users makes a call Kamailio does not route the ACK (in response to the 200 OK). For all other end users it works fine. For me it looks the the has_totag() checks for some reason fails and then t_check_trans() thinks it is a ACK to a local transactions and then terminates the script. Otherwise there should be more lines in the log file. if you add an xlog() after the if with has_totag(), do you get the message in the logs? Sorry for the delay, but a had to wait for the customer to make a test call. I placed a xlog(L_WARN, has_totag after - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); just after the if (has_totag()) { .. } and it does not show in the log. It looks very strange to me. Do you have any ideas what is wrong. /Morten Cheers, Daniel The conf is pretty standard. route{ xlog(L_WARN, New request - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); xlog(L_WARN, ua=$ua); if (!mf_process_maxfwd_header(10)) { sl_send_reply(483,Too Many Hops); exit; } if(!sanity_check(1511, 7)) { xlog(Malformed SIP message from $si:$sp\n); exit; } if (has_totag()) { xlog(L_WARN, has_totag start - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); # sequential request withing a dialog should # take the path determined by record-routing if (loose_route()) { xlog(L_WARN, loose_route - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); route(RELAY); } else { if (is_method(SUBSCRIBE) uri == myself) { # in-dialog subscribe requests #route(PRESENCE); exit; } if ( is_method(ACK) ) { if ( t_check_trans() ) { xlog(L_WARN, ACK t_check_trans - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); # non loose-route, but stateful ACK; must be an ACK after a 487 or e.g. 404 from upstream server t_relay(); exit; } else { xlog(Ignoring ACK - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); # ACK without matching transaction ... ignore and discard.\n); exit; } } sl_send_reply(404,Not here); } xlog(L_WARN, has_totag end - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n); exit; } #initial requests # CANCEL processing if (is_method(CANCEL)) { if (t_check_trans()) t_relay(); exit; } setflag(4); t_check_trans(); ... The log files show: Oct 28 10:51:13 sip-core-1 /usr/local/sbin/kamailio[10503]: WARNING: script: New request - M=ACK RURI=sip:1...@178.21.248.56:5060 F=sip:87776...@sip.uni-tel.dk T=sip:869 87...@sip.uni-tel.dk IP=178.21.248.20 id=ai231ca9bd0a4a1...@10.0.0.150 Oct 28 10:51:13 sip-core-1 /usr/local/sbin/kamailio[10503]: WARNING: script: ua=Aastra Intelligate The trace U 2010/10/28 10:51:02.616337 178.21.248.7:5060 - 178.21.248.56:5060 INVITE sip:86987...@178.21.248.56 SIP/2.0. Record-Route:sip:178.21.248.7;lr;ftag=AI8DA85D59B9B6634F;did=f48.5fd1db02. Record-Route:sip:178.21.248.20;lr;ftag=AI8DA85D59B9B6634F. Via: SIP/2.0/UDP 178.21.248.7;branch=z9hG4bK690c.9cfea506.0. Via: SIP/2.0/UDP 178.21.248.20;branch=z9hG4bK690c.97354e4.0. Via: SIP/2.0/UDP 87.104.233.108:5060;rport=5060;branch=z9hG4bK3c70fae55c8b362ff34e6c782cc21592. To:sip:86987...@sip.uni-tel.dk. From:sip:87776...@sip.uni-tel.dk;tag=AI8DA85D59B9B6634F. Call-ID: ai231ca9bd0a4a1...@10.0.0.150. CSeq: 2 INVITE. Max-Forwards: 68. Contact:sip:87776...@87.104.233.108:5060;line=AI7EFC34995E724DD7. Accept: application/sdp. Allow: ACK,BYE,CANCEL,INVITE,NOTIFY,OPTIONS,REFER. P-Preferred-Identity:sip:87776...@sip.uni-tel.dk. Privacy: none. User-Agent: Aastra Intelligate. Content-Type: application/sdp. Content-Length: 280. X-trunktype: IC. . v=0. o=intelligate 1194032777 1194032777 IN IP4 87.104.233.106. s=call. c=IN IP4 178.21.248.22. t=0 0. m=audio 60984 RTP/AVP 8 0 18 101. a=rtpmap:8 PCMA/8000. a=rtpmap:0 PCMU/8000. a=rtpmap:18 G729/8000. a=rtpmap:101 telephone-event/8000
[SR-Users] Problem with Kamailio not routing ACK to a 200 OK
;tag=AI8DA85D59B9B6634F. To: sip:86987...@sip.uni-tel.dk;tag=1c2073920452. Call-ID: ai231ca9bd0a4a1...@10.0.0.150. CSeq: 2 INVITE. Contact: sip:1...@178.21.248.56:5060. Record-Route: sip:178.21.248.7;lr;ftag=AI8DA85D59B9B6634F;did=f48.5fd1db02,sip:178.21.248.20;lr;ftag=AI8DA85D59B9B6634F. Supported: em,timer,replaces,path,early-session,resource-priority. Allow: REGISTER,OPTIONS,INVITE,ACK,CANCEL,BYE,NOTIFY,PRACK,REFER,INFO,SUBSCRIBE,UPDATE. Server: Audiocodes-Sip-Gateway-Mediant 2000/v.5.60A.035.002. Content-Type: application/sdp. Content-Length: 259. . v=0. o=AudiocodesGW 2073965634 2073965290 IN IP4 178.21.248.56. s=Phone-Call. c=IN IP4 178.21.248.56. t=0 0. m=audio 6050 RTP/AVP 8 101. c=IN IP4 178.21.248.56. a=rtpmap:8 PCMA/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-15. a=ptime:20. a=sendrecv. # U 2010/10/28 10:51:12.882388 178.21.248.7:5060 - 178.21.248.20:5060 SIP/2.0 200 OK. Via: SIP/2.0/UDP 178.21.248.20;branch=z9hG4bK690c.97354e4.0. Via: SIP/2.0/UDP 87.104.233.108:5060;rport=5060;branch=z9hG4bK3c70fae55c8b362ff34e6c782cc21592. From: sip:87776...@sip.uni-tel.dk;tag=AI8DA85D59B9B6634F. To: sip:86987...@sip.uni-tel.dk;tag=1c2073920452. Call-ID: ai231ca9bd0a4a1...@10.0.0.150. CSeq: 2 INVITE. Contact: sip:1...@178.21.248.56:5060. Record-Route: sip:178.21.248.7;lr;ftag=AI8DA85D59B9B6634F;did=f48.5fd1db02,sip:178.21.248.20;lr;ftag=AI8DA85D59B9B6634F. Supported: em,timer,replaces,path,early-session,resource-priority. Allow: REGISTER,OPTIONS,INVITE,ACK,CANCEL,BYE,NOTIFY,PRACK,REFER,INFO,SUBSCRIBE,UPDATE. Server: Audiocodes-Sip-Gateway-Mediant 2000/v.5.60A.035.002. Content-Type: application/sdp. Content-Length: 259. . v=0. o=AudiocodesGW 2073965634 2073965290 IN IP4 178.21.248.56. s=Phone-Call. c=IN IP4 178.21.248.56. t=0 0. m=audio 6050 RTP/AVP 8 101. c=IN IP4 178.21.248.56. a=rtpmap:8 PCMA/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-15. a=ptime:20. a=sendrecv. # This is the problem packet U 2010/10/28 10:51:13.267863 178.21.248.20:5060 - 178.21.248.7:5060 ACK sip:1...@178.21.248.56:5060 SIP/2.0. Record-Route: sip:178.21.248.20;lr;ftag=AI8DA85D59B9B6634F. Via: SIP/2.0/UDP 178.21.248.20;branch=z9hG4bK690c.97354e4.2. Via: SIP/2.0/UDP 87.104.233.108:5060;rport=5060;branch=z9hG4bK07103fe69c8af048b9b8216eb2f7233f. To: sip:86987...@sip.uni-tel.dk;tag=1c2073920452. From: sip:87776...@sip.uni-tel.dk;tag=AI8DA85D59B9B6634F. Call-ID: ai231ca9bd0a4a1...@10.0.0.150. CSeq: 2 ACK. Max-Forwards: 69. Route: sip:178.21.248.7;lr=on;ftag=AI8DA85D59B9B6634F;did=f48.5fd1db02. User-Agent: Aastra Intelligate. Content-Length: 0. -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] set cfg variables via sercmd
Kamailio 3.0.3. I am trying to change a variable (in the cfg variable framwork) from sercmd, but I get an error [r...@sip-core-1 ~]# sercmd cfg.set_now_int recording enabled 1 error: 500 - command cfg.set_now_int not found I have installed readline and ncurses which seems to be needed by looking at sercmd.c. Any ideas what I am missing? -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] calltrace mechanism available?
Hi, You could use the dialog module and then create a trigger in mysql that insert the row to be deleted in another table. /Morten On Fri, Oct 15, 2010 at 4:00 PM, Nicolas Rüger nicolasrue...@gmx.de wrote: Hello, I am looking for a possibility to trace kamailio on a per call basis. I need something like... id | caller | callee | start_time | end_time | ... as a table in the kamailio database because I want to evaluate these CDRs for SPIT-Prevention. Therefore I need these traces to be stored in database even after the call has ended. My alternative idea is to use perl-scripts to print the needed values in database for each call. Any suggestion or feedback is appreciated!!! Thank you! Regards, Nicolas -- GRATIS! Movie-FLAT mit über 300 Videos. Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] Record-route issue in Kamailio 3.0.3
Hi, I think I have found a issue with recourd-route in Kamailio 3.0.3. My old setup was: Microsoft OCS -- (TCP) OpenSER (UDP) --- (UDP) Mediant 2000 (ISDN). That worked fine. Now I have inserted a new server in this setup. Microsoft OCS -- (TCP) OpenSER (UDP) --- (UDP) Kamailio (UDP) -- (UDP) Mediant 2000 (ISDN). When OpenSer sends the message to Kamailio the recourd-routes look like this: Record-Route: sip:x.x.248.20;r2=on;lr;ftag=3d9e7d131b Record-Route: sip:x.x.248.20;transport=tcp;r2=on;lr;ftag=3d9e7d131b But when the message comes back from Kamailio it is: Record-Route: sip:x.x.248.7;lr=on;ftag=3d9e7d131b;did=584.1a683a45,sip:x.x.248.20;r2=on;lr;ftag=3d9e7d131b,sip:x.x.248.20;transport=tcp;r2=on;lr;ftag=3d9e7d131b OpenSER forwards the message to the OCS with Record-route unchanged and the OCS gets confused and does not reply. I am not that strong in the SIP RFC's. Is it part of the SIP standard to compact the record-route into one line? Is it a bug in Kamailio or is it just a parameter that needs to be changed? Any help will be much appreciated. -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Record-route issue in Kamailio 3.0.3
Hi, I was mistaken. This is not the problem. OCS kan handle r-r with multiple entry. This one works OK - The OCS sends a PRACK SIP/2.0 180 Ringing Via: SIP/2.0/TCP x.x.42.177:65371;rport=65371;branch=z9hG4bK991996e6 From: sip:+XX04963;ext=4...@rpvocsmed01.rpdc.local;user=phone;epid=E1A3C38520;tag=74504cfc7a To: sip:+x07...@sip.uni-tel.dk;user=phone;tag=1c564710455 Call-ID: 707d32ae-acaf-4c13-8117-f9b39c42f26e CSeq: 1429 INVITE Contact: sip:1...@x.x.248.56:5060 Record-Route: sip:x.x.248.20;r2=on;lr;ftag=74504cfc7a,sip:x.x.248.20;transport=tcp;r2=on;lr;ftag=74504cfc7a Supported: em,timer,replaces,path,early-session,resource-priority Allow: REGISTER,OPTIONS,INVITE,ACK,CANCEL,BYE,NOTIFY,PRACK,REFER,INFO,SUBSCRIBE,UPDATE Require: 100rel RSeq: 1 Server: Audiocodes-Sip-Gateway-Mediant 2000/v.5.60A.035.002 Content-Type: application/sdp Content-Length: 258 v=0 o=AudiocodesGW 564744967 564744627 IN IP4 x.x.248.56 s=Phone-Call c=IN IP4 x.x.248.18 t=0 0 m=audio 62722 RTP/AVP 8 101 c=IN IP4 178.21.248.18 a=rtpmap:8 PCMA/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=ptime:20 a=sendrecv But the OCS does not answer this. Could it be lr=on that triggers the problem? I do not have access to the OCS myself. SIP/2.0 180 Ringing Via: SIP/2.0/TCP x.x.42.177:65251;rport=65251;branch=z9hG4bK9a5a33df From: sip:+X04960;ext=4...@rpvocsmed01.rpdc.local;user=phone;epid=E1A3C38520;tag=6f5e4da8ab To: sip:+37...@sip.uni-tel.dk;user=phone;tag=1c11675351 Call-ID: acf61479-f483-42d8-b5c0-be4feaf6dad7 CSeq: 1412 INVITE Contact: sip:1...@x.x.248.56:5060 Record-Route: sip:x.x.248.7;lr=on;ftag=6f5e4da8ab;did=5e1.cffb1006,sip:x.x.248.20;r2=on;lr;ftag=6f5e4da8ab,sip:x.x.248.20;transport=tcp;r2=on;lr;ftag=6f5e4da8ab Supported: em,timer,replaces,path,early-session,resource-priority Allow: REGISTER,OPTIONS,INVITE,ACK,CANCEL,BYE,NOTIFY,PRACK,REFER,INFO,SUBSCRIBE,UPDATE Require: 100rel RSeq: 1 Server: Audiocodes-Sip-Gateway-Mediant 2000/v.5.60A.035.002 Content-Type: application/sdp Content-Length: 256 v=0 o=AudiocodesGW 11709683 11709345 IN IP4 178.21.248.56 s=Phone-Call c=IN IP4 x.x.248.22 t=0 0 m=audio 63608 RTP/AVP 8 101 c=IN IP4 x.x.248.22 a=rtpmap:8 PCMA/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=ptime:20 a=sendrecv On Thu, Oct 14, 2010 at 4:57 PM, Juha Heinanen j...@tutpro.com wrote: Morten Isaksen writes: When OpenSer sends the message to Kamailio the recourd-routes look like this: Record-Route: sip:x.x.248.20;r2=on;lr;ftag=3d9e7d131b Record-Route: sip:x.x.248.20;transport=tcp;r2=on;lr;ftag=3d9e7d131b But when the message comes back from Kamailio it is: Record-Route: sip:x.x.248.7;lr=on;ftag=3d9e7d131b;did=584.1a683a45,sip:x.x.248.20;r2=on;lr;ftag=3d9e7d131b,sip:x.x.248.20;transport=tcp;r2=on;lr;ftag=3d9e7d131b OpenSER forwards the message to the OCS with Record-route unchanged and the OCS gets confused and does not reply. then file a bug to ocs folks, because ocs should understand r-r header that contains more than one entry. -- juha ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Record-route issue in Kamailio 3.0.3
Hi, That solved the problem with OCS. :) /Morten On Thu, Oct 14, 2010 at 6:34 PM, Ovidiu Sas o...@voipembedded.com wrote: The spec requires just lr. There were some buggy clients that couldn't do just lr and therefor lr=on was introduced. If it works with lr, then don't enable lr=on (which is disabled by default): modparam(rr, enable_full_lr, 0) http://www.kamailio.org/docs/modules/3.1.x/modules_k/rr.html#id2805457 Regards, Ovidiu Sas On Thu, Oct 14, 2010 at 12:19 PM, Morten Isaksen mi...@misak.dk wrote: Hi, I was mistaken. This is not the problem. OCS kan handle r-r with multiple entry. This one works OK - The OCS sends a PRACK SIP/2.0 180 Ringing Via: SIP/2.0/TCP x.x.42.177:65371;rport=65371;branch=z9hG4bK991996e6 From: sip:+XX04963;ext=4...@rpvocsmed01.rpdc.local;user=phone;epid=E1A3C38520;tag=74504cfc7a To: sip:+x07...@sip.uni-tel.dk;user=phone;tag=1c564710455 Call-ID: 707d32ae-acaf-4c13-8117-f9b39c42f26e CSeq: 1429 INVITE Contact: sip:1...@x.x.248.56:5060 Record-Route: sip:x.x.248.20;r2=on;lr;ftag=74504cfc7a,sip:x.x.248.20;transport=tcp;r2=on;lr;ftag=74504cfc7a Supported: em,timer,replaces,path,early-session,resource-priority Allow: REGISTER,OPTIONS,INVITE,ACK,CANCEL,BYE,NOTIFY,PRACK,REFER,INFO,SUBSCRIBE,UPDATE Require: 100rel RSeq: 1 Server: Audiocodes-Sip-Gateway-Mediant 2000/v.5.60A.035.002 Content-Type: application/sdp Content-Length: 258 v=0 o=AudiocodesGW 564744967 564744627 IN IP4 x.x.248.56 s=Phone-Call c=IN IP4 x.x.248.18 t=0 0 m=audio 62722 RTP/AVP 8 101 c=IN IP4 178.21.248.18 a=rtpmap:8 PCMA/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=ptime:20 a=sendrecv But the OCS does not answer this. Could it be lr=on that triggers the problem? I do not have access to the OCS myself. SIP/2.0 180 Ringing Via: SIP/2.0/TCP x.x.42.177:65251;rport=65251;branch=z9hG4bK9a5a33df From: sip:+X04960;ext=4...@rpvocsmed01.rpdc.local;user=phone;epid=E1A3C38520;tag=6f5e4da8ab To: sip:+37...@sip.uni-tel.dk;user=phone;tag=1c11675351 Call-ID: acf61479-f483-42d8-b5c0-be4feaf6dad7 CSeq: 1412 INVITE Contact: sip:1...@x.x.248.56:5060 Record-Route: sip:x.x.248.7;lr=on;ftag=6f5e4da8ab;did=5e1.cffb1006,sip:x.x.248.20;r2=on;lr;ftag=6f5e4da8ab,sip:x.x.248.20;transport=tcp;r2=on;lr;ftag=6f5e4da8ab Supported: em,timer,replaces,path,early-session,resource-priority Allow: REGISTER,OPTIONS,INVITE,ACK,CANCEL,BYE,NOTIFY,PRACK,REFER,INFO,SUBSCRIBE,UPDATE Require: 100rel RSeq: 1 Server: Audiocodes-Sip-Gateway-Mediant 2000/v.5.60A.035.002 Content-Type: application/sdp Content-Length: 256 v=0 o=AudiocodesGW 11709683 11709345 IN IP4 178.21.248.56 s=Phone-Call c=IN IP4 x.x.248.22 t=0 0 m=audio 63608 RTP/AVP 8 101 c=IN IP4 x.x.248.22 a=rtpmap:8 PCMA/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=ptime:20 a=sendrecv On Thu, Oct 14, 2010 at 4:57 PM, Juha Heinanen j...@tutpro.com wrote: Morten Isaksen writes: When OpenSer sends the message to Kamailio the recourd-routes look like this: Record-Route: sip:x.x.248.20;r2=on;lr;ftag=3d9e7d131b Record-Route: sip:x.x.248.20;transport=tcp;r2=on;lr;ftag=3d9e7d131b But when the message comes back from Kamailio it is: Record-Route: sip:x.x.248.7;lr=on;ftag=3d9e7d131b;did=584.1a683a45,sip:x.x.248.20;r2=on;lr;ftag=3d9e7d131b,sip:x.x.248.20;transport=tcp;r2=on;lr;ftag=3d9e7d131b OpenSER forwards the message to the OCS with Record-route unchanged and the OCS gets confused and does not reply. then file a bug to ocs folks, because ocs should understand r-r header that contains more than one entry. -- juha ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Morten Isaksen ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users