Re: [SR-Users] How to limit number of calls in Kamailio proxy
Austin, the block beginning with dlg_manage() should be placed between route(AUTH) and route(PSTN). It is commented out and put outside the main routing block so I'm not sure if that was the case.. If the problem persists please get the dialogs list before calling, while the callee's phone is ringing after the call is established and after the call is cleared. If I am not mistaken the command is: kamctl fifo profile_list_dlgs caller On 11/05/2011 03:02 AM, Austin Einter wrote: Dear Andrew Here I am attaching the config file I am using currently. Please suggest me if something is wrong there. Also how do I limit the maximum number of calls. Thanks, Austin ___ 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 limit number of calls in Kamailio proxy
Dear Andrew Here I am attaching the config file I am using currently. Please suggest me if something is wrong there. Also how do I limit the maximum number of calls. Thanks, Austin On Thu, Nov 3, 2011 at 2:33 PM, Andrew Pogrebennyk apogreben...@sipwise.com wrote: Austin, Actually you could share your config to the mailing list, I will tell you if there is something blatantly wrong ;-) Regards, Andrew On 11/03/2011 06:15 AM, Jason Penton wrote: Hi Austin, Have a look at the TM module docs. You will find the appropriate commands there. HTH On Nov 3, 2011 3:01 AM, Austin Einter austin.ein...@gmail.com mailto:austin.ein...@gmail.com wrote: Dear Andrew, Henning Thanks for sharing very useful information. I am bit new to kamailio, probably askingvery easy questions, please bear with me. I am not sure if I am forwording the INVITE statelessly or not. How do I check if INVITE is forwarded statelessly. Andrew you have mentioned 'So make sure that a transaction exists or create it explicitly using the tm module. Not sure, how do I check if transaction exists or not. And how can I create it. Please give me some pointers or a sample config file. Regards, Austin ___ 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 kamailio.cfg Description: Binary data ___ 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 limit number of calls in Kamailio proxy
Austin, Actually you could share your config to the mailing list, I will tell you if there is something blatantly wrong ;-) Regards, Andrew On 11/03/2011 06:15 AM, Jason Penton wrote: Hi Austin, Have a look at the TM module docs. You will find the appropriate commands there. HTH On Nov 3, 2011 3:01 AM, Austin Einter austin.ein...@gmail.com mailto:austin.ein...@gmail.com wrote: Dear Andrew, Henning Thanks for sharing very useful information. I am bit new to kamailio, probably askingvery easy questions, please bear with me. I am not sure if I am forwording the INVITE statelessly or not. How do I check if INVITE is forwarded statelessly. Andrew you have mentioned 'So make sure that a transaction exists or create it explicitly using the tm module. Not sure, how do I check if transaction exists or not. And how can I create it. Please give me some pointers or a sample config file. Regards, Austin ___ 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 limit number of calls in Kamailio proxy
Dear Andrew, Henning Thanks for sharing very useful information. I am bit new to kamailio, probably askingvery easy questions, please bear with me. I am not sure if I am forwording the INVITE statelessly or not. How do I check if INVITE is forwarded statelessly. Andrew you have mentioned 'So make sure that a transaction exists or create it explicitly using the tm module. Not sure, how do I check if transaction exists or not. And how can I create it. Please give me some pointers or a sample config file. Regards, Austin On Mon, Oct 31, 2011 at 4:37 PM, Andrew Pogrebennyk apogreben...@sipwise.com wrote: Austin, That is strange, because I am using similar setup successfully. Actually I don't know if it counts the calls that are being established, I didn't care for it. While looking through the docs: http://kamailio.org/docs/modules/3.1.x/modules_k/dialog.html#id2524304 the following note caught my eye: IMPORTANT: Users of this function should make sure that the dialog created is further processed statefully. Specifically, if a stateless response is sent out after dlg_manage() is called, the dialog cannot be handled properly. So make sure that a transaction exists or create it explicitly using the tm module. This is a shortcoming of the current implementation that may be resolved in a future version hopefully. Could it be that you are forwarding the INVITE statelessly? Regards, Andrew On 10/30/2011 01:08 PM, Austin Einter wrote: Thanks Andrew I added profile_with_value module parameter and with that I am able to overcome this error. My code looks as below. dlg_manage(); if (is_method(INVITE)) { if (!has_totag()) { #$var(SIZE) = 0; get_profile_size(caller, $fu, $var(SIZE)); xlog(Number of calls present now is $var(SIZE)\n); if( $var(SIZE) MAX_NUMBER_OF_CALLS ) { sl_send_reply(503, Simultaneous calls limit reached); xlog(Rejected calls with 503 Simultaneous calls limit reached\n); exit; } else { xlog(Allowed call. Looks max calls limit not reached. Calls= $var(SIZE)\n); } set_dlg_profile(caller,$fu); } } Whole purpose is to limit number of active calls at any point of time. $var(SIZE) gives the number of calls are being established, but not the number of calls are already established. So if I am making multiple calls at a point of time, it is blocking call attempts beyond limit. But after all call setup complete, again $var(SIZE) becomes zero and allows new calls. Has anybody done this (limiting number of calls at any point of time). If so can you please share the configuration file changes. To get $var(SIZE) working properly, do I need to enable MySql, please advice. Regards Austin ___ 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
Re: [SR-Users] How to limit number of calls in Kamailio proxy
Hi Austin, Have a look at the TM module docs. You will find the appropriate commands there. HTH On Nov 3, 2011 3:01 AM, Austin Einter austin.ein...@gmail.com wrote: Dear Andrew, Henning Thanks for sharing very useful information. I am bit new to kamailio, probably askingvery easy questions, please bear with me. I am not sure if I am forwording the INVITE statelessly or not. How do I check if INVITE is forwarded statelessly. Andrew you have mentioned 'So make sure that a transaction exists or create it explicitly using the tm module. Not sure, how do I check if transaction exists or not. And how can I create it. Please give me some pointers or a sample config file. Regards, Austin On Mon, Oct 31, 2011 at 4:37 PM, Andrew Pogrebennyk apogreben...@sipwise.com wrote: Austin, That is strange, because I am using similar setup successfully. Actually I don't know if it counts the calls that are being established, I didn't care for it. While looking through the docs: http://kamailio.org/docs/modules/3.1.x/modules_k/dialog.html#id2524304 the following note caught my eye: IMPORTANT: Users of this function should make sure that the dialog created is further processed statefully. Specifically, if a stateless response is sent out after dlg_manage() is called, the dialog cannot be handled properly. So make sure that a transaction exists or create it explicitly using the tm module. This is a shortcoming of the current implementation that may be resolved in a future version hopefully. Could it be that you are forwarding the INVITE statelessly? Regards, Andrew On 10/30/2011 01:08 PM, Austin Einter wrote: Thanks Andrew I added profile_with_value module parameter and with that I am able to overcome this error. My code looks as below. dlg_manage(); if (is_method(INVITE)) { if (!has_totag()) { #$var(SIZE) = 0; get_profile_size(caller, $fu, $var(SIZE)); xlog(Number of calls present now is $var(SIZE)\n); if( $var(SIZE) MAX_NUMBER_OF_CALLS ) { sl_send_reply(503, Simultaneous calls limit reached); xlog(Rejected calls with 503 Simultaneous calls limit reached\n); exit; } else { xlog(Allowed call. Looks max calls limit not reached. Calls= $var(SIZE)\n); } set_dlg_profile(caller,$fu); } } Whole purpose is to limit number of active calls at any point of time. $var(SIZE) gives the number of calls are being established, but not the number of calls are already established. So if I am making multiple calls at a point of time, it is blocking call attempts beyond limit. But after all call setup complete, again $var(SIZE) becomes zero and allows new calls. Has anybody done this (limiting number of calls at any point of time). If so can you please share the configuration file changes. To get $var(SIZE) working properly, do I need to enable MySql, please advice. Regards Austin ___ 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 ___ 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 limit number of calls in Kamailio proxy
On Sunday 30 October 2011, Austin Einter wrote: [...] To get $var(SIZE) working properly, do I need to enable MySql, please advice. Hi Austin, its not necessary to enable mySQL database support in the dialog module to use the dialog profile support to e.g. get the number of concurrent calls. Best regards, Henning ___ 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 limit number of calls in Kamailio proxy
Thanks Andrew I added profile_with_value module parameter and with that I am able to overcome this error. My code looks as below. dlg_manage(); if (is_method(INVITE)) { if (!has_totag()) { #$var(SIZE) = 0; get_profile_size(caller, $fu, $var(SIZE)); xlog(Number of calls present now is $var(SIZE)\n); if( $var(SIZE) MAX_NUMBER_OF_CALLS ) { sl_send_reply(503, Simultaneous calls limit reached); xlog(Rejected calls with 503 Simultaneous calls limit reached\n); exit; } else { xlog(Allowed call. Looks max calls limit not reached. Calls= $var(SIZE)\n); } set_dlg_profile(caller,$fu); } } Whole purpose is to limit number of active calls at any point of time. $var(SIZE) gives the number of calls are being established, but not the number of calls are already established. So if I am making multiple calls at a point of time, it is blocking call attempts beyond limit. But after all call setup complete, again $var(SIZE) becomes zero and allows new calls. Has anybody done this (limiting number of calls at any point of time). If so can you please share the configuration file changes. To get $var(SIZE) working properly, do I need to enable MySql, please advice. Regards Austin On Sun, Oct 30, 2011 at 12:28 PM, Andrew Pogrebennyk apogreben...@sipwise.com wrote: On 10/30/2011 06:00 AM, Austin Einter wrote: When I run kamailio, I get below error. 0(4925) CRITICAL: dialog [dialog.c:297]: profile caller not definited [...] Any idea why this error comes and how to fix it. You should really define profile caller by putting it into profiles_with_value module parameter: http://kamailio.org/docs/modules/3.1.x/modules_k/dialog.html#id2523534 ___ 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
Re: [SR-Users] How to limit number of calls in Kamailio proxy
Alex Initially I did not put dlg_manage(), after reading your post I added the dlg_manage(). Now in route section my code in kamailio.config looks as below. *dlg_manage(); if (is_method(INVITE)) { if (!has_totag()) { if($DLG_count 1) { sl_send_reply(503,RESOURCE UNAVAILABLE); exit; } else { setflag(FLD_DLG); xlog(Dialog count = $DLG_count\n); } } * The end result still remains same. The DLG_count still shows as 0 irrespective of number of calls present in system. Can somebody points whats wrong I am doing here. Regards, Austin On Sat, Oct 29, 2011 at 8:58 AM, Alex Balashov abalas...@evaristesys.comwrote: Are you calling dlg_manage() when processing the initial INVITE request? -- This message was painstakingly thumbed out on my mobile, so apologies for brevity, errors, and general sloppiness. 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/ On Oct 28, 2011, at 8:57 PM, Austin Einter austin.ein...@gmail.com wrote: This is continuation with limiting number of calls per Kamailio proxy server. I modified kamailio.cfg as below. 1. loadmodule dialog.so 2. modparam(dialog, enable_stats, 1) 3. modparam(dialog, dlg_flag, 4) Next, as dialog module I can use either active_dialogs() or $DLG_count to find number of calls present at any given point of time. However if I use active_dialogs() I get parse error when I run kamailio proxy. Next I used $DLG_count , but always I am getting value of $DLG_count as 0. In route section, I added code as below. if (is_method(INVITE)) { if($DLG_count 1) { sl_send_reply(503,RESOURCE UNAVAILABLE); exit; } else { xlog(Dialog count = $DLG_count\n); } } Everytime a new call starts , it prints $DLG_count as 0. Kindly let me know whats going wrong here. Regards Austin ___ 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 ___ 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 limit number of calls in Kamailio proxy
Hi All Still I am struggling to find a solution how to control the number of calls. I have few more doubts regarding this. 1. Do I need to enable mysql , so that these counters such as $DLG_count will be updated properly. Now I am getting 0 always irrespective of number of calls in system. 2. For testing purpose, I wanted to set max calls at any point of time should not be more than 1. So I had the check as below *if($DLG_count 1) * I read in some previous posts where someone was mentioning the check as *if ( avp_check($DLG_count, gt/i:10) ) * Please let me know which one is correct. 3. How do I debug whats going wrong. Why $DBG_count is not updated. Thanks in advance. Regards, Austin On Sat, Oct 29, 2011 at 2:40 PM, Austin Einter austin.ein...@gmail.comwrote: Alex Initially I did not put dlg_manage(), after reading your post I added the dlg_manage(). Now in route section my code in kamailio.config looks as below. *dlg_manage(); if (is_method(INVITE)) { if (!has_totag()) { if($DLG_count 1) { sl_send_reply(503,RESOURCE UNAVAILABLE); exit; } else { setflag(FLD_DLG); xlog(Dialog count = $DLG_count\n); } } * The end result still remains same. The DLG_count still shows as 0 irrespective of number of calls present in system. Can somebody points whats wrong I am doing here. Regards, Austin On Sat, Oct 29, 2011 at 8:58 AM, Alex Balashov abalas...@evaristesys.comwrote: Are you calling dlg_manage() when processing the initial INVITE request? -- This message was painstakingly thumbed out on my mobile, so apologies for brevity, errors, and general sloppiness. 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/ On Oct 28, 2011, at 8:57 PM, Austin Einter austin.ein...@gmail.com wrote: This is continuation with limiting number of calls per Kamailio proxy server. I modified kamailio.cfg as below. 1. loadmodule dialog.so 2. modparam(dialog, enable_stats, 1) 3. modparam(dialog, dlg_flag, 4) Next, as dialog module I can use either active_dialogs() or $DLG_count to find number of calls present at any given point of time. However if I use active_dialogs() I get parse error when I run kamailio proxy. Next I used $DLG_count , but always I am getting value of $DLG_count as 0. In route section, I added code as below. if (is_method(INVITE)) { if($DLG_count 1) { sl_send_reply(503,RESOURCE UNAVAILABLE); exit; } else { xlog(Dialog count = $DLG_count\n); } } Everytime a new call starts , it prints $DLG_count as 0. Kindly let me know whats going wrong here. Regards Austin ___ 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 ___ 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 limit number of calls in Kamailio proxy
Are you calling dlg_manage() when processing the initial INVITE request? -- This message was painstakingly thumbed out on my mobile, so apologies for brevity, errors, and general sloppiness. 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/ On Oct 28, 2011, at 8:57 PM, Austin Einter austin.ein...@gmail.com wrote: This is continuation with limiting number of calls per Kamailio proxy server. I modified kamailio.cfg as below. 1. loadmodule dialog.so 2. modparam(dialog, enable_stats, 1) 3. modparam(dialog, dlg_flag, 4) Next, as dialog module I can use either active_dialogs() or $DLG_count to find number of calls present at any given point of time. However if I use active_dialogs() I get parse error when I run kamailio proxy. Next I used $DLG_count , but always I am getting value of $DLG_count as 0. In route section, I added code as below. if (is_method(INVITE)) { if($DLG_count 1) { sl_send_reply(503,RESOURCE UNAVAILABLE); exit; } else { xlog(Dialog count = $DLG_count\n); } } Everytime a new call starts , it prints $DLG_count as 0. Kindly let me know whats going wrong here. Regards Austin ___ 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