Hello Bogdan, I appreciate a lot your response regarding my inquiry. I've been reading that tutorial as well as the AVPops and dialog modules documentation for about a month now. I tried to adapt that route block for inbound calls and here's a portion of what I have on our OpenSIPS 1.5 config file:
------------------------------------------------------------------------------- modparam("dialog", "dlg_flag", 4) modparam("dialog", "profiles_with_value", "inbound") ...... } else if (uri=~"sip:1234567...@.*") { route(3); rewritehost("111.222.111.222"); ....... route[3] { ## have we done our checking on this call? if(!isflagset(31)) { # user has max channel limit set as preference if(is_avp_set("$avp(s:channels)/n") && avp_check("$avp(s:channels)", "gt/i:0")) { # get the current calls for DID get_profile_size("inbound","$tU","$var(calls)"); # check within limit if($avp(s:channels) > $var(calls)) { xlog("L_INFO", "Call control: DID '$tU' currently has '$var(calls)' of '$avp(s:channels)' active calls before this one\n"); $var(setprofile) = 1; } else { xlog("L_INFO", "Call control: DID '$tU' channel limit exceeded [$var(calls)/$avp(s:channels)] \n"); send_reply("487", "Request Terminated: Channel limit exceeded\n"); exit; } } else { $var(setprofile) = 0; } call_control(); switch ($retcode) { case 2: # Call with no limit case 1: # Call with a limit under callcontrol management (either prepaid or postpaid) break; case -1: # Not enough credit (prepaid call) xlog("L_INFO", "Call control: not enough credit for prepaid call\n"); acc_rad_request("402"); sl_send_reply("402", "Not enough credit"); exit; break; case -2: # Locked by call in progress (prepaid call) xlog("L_INFO", "Call control: prepaid call locked by another call in progress\n"); acc_rad_request("403"); sl_send_reply("403", "Call locked by another call in progress"); exit; break; default: # Internal error (message parsing, communication, ...) xlog("L_INFO", "Call control: internal server error\n"); acc_rad_request("500"); sl_send_reply("500", "Internal server error"); exit; } if($var(setprofile) > 0) { create_dialog(); set_dlg_profile("inbound","$tU"); } ## mark checking done setflag(31); } } ---------------------------------------------------------------- And here are the logs appearing on /var/log/messages: Jan 6 05:53:22 opensips cdrtool[20998]: MaxSessionTime Duration=36000 callid=28a35ce1-4d7a175-25a58...@124.123.234.229 From=si p:12135551...@124.123.234.229 <p%3a12135551...@124.123.234.229>Gateway=124.123.234.229 To=sip:1234567...@124.123.234.241:5060 ;user=phone Jan 6 05:53:22 opensips cdrtool[20998]: MaxSessionTime=unlimited Type=postpaid callid=28a35ce1-4d7a175-25a58...@124.123.234.229 BillingParty= 12135551...@124.123.234.229 Jan 6 05:53:22 opensips call-control[21263]: Call id 28a35ce1-4d7a175-25a58...@64.77.234.229 of 12135551...@124.123.234.229 to sip:1234567...@124.123.234.241:5060;user=phone is postpaid not limited Jan 6 05:53:22 opensips /usr/local/sbin/opensips[1636]: new branch at sip:1234567...@111.222.111.222:5060;user=phone Jan 6 05:53:22 opensips /usr/local/sbin/opensips[1640]: incoming reply Jan 6 05:53:22 opensips /usr/local/sbin/opensips[1636]: incoming reply Jan 6 05:53:22 opensips /usr/local/sbin/opensips[1636]: ACC: transaction answered: timestamp=1262786002;method=INVITE;from_t ag=14fe61da-25a58684-e5ea4d40;to_tag=as6a53f46c;call_id= 28a35ce1-4d7a175-25a58...@64.77.234.229;code=200;reason=OK Jan 6 05:53:22 opensips /usr/local/sbin/opensips[1637]: Recive call variable : <null> <null> As for the channels limit value, do I have to define it on usr_preferences table? I have these records on the said table: mysql> select * from usr_preferences; +----+------+------------+--------+---------------+------+------------+---------------------+ | id | uuid | username | domain | attribute | type | value | last_modified | +----+------+------------+--------+---------------+------+------------+---------------------+ | 1 | | 1234567890 | | channels | 0 | 3 | 1900-01-01 00:00:01 | | 2 | | 0 | | called_number | 0 | 12135551234 | 1900-01-01 00:00:01 | +----+------+------------+--------+---------------+------+------------+---------------------+ 2 rows in set (0.00 sec) Unfortunately, I'm not quite sure on what section or portion of opensips.cfg file I will have to put the loading of user preferences to the AVPs. Any inputs or suggestions will be greatly appreciated? Thank you very much. --conpaj-- On Wed, Jan 6, 2010 at 11:26 PM, Bogdan-Andrei Iancu <bog...@voice-system.ro > wrote: > Hi Johnson, > > The idea is to use dialog profiles to keep trace of the ongoing calls > (per resource). As a first step take a look at the following tutorial: > > http://www.opensips.org/Resources/DocsTutConcurrentCalls > > Regards, > Bogdan > > Johnson Pajayat wrote: > > Hi! > > > > I'm a newbie with OpenSIPS administration and configuration and I > > searched on the mail archives regarding limiting the channels but only > > found the site regarding "Concurrent calls limitation". I've been > > trying to grasp the whole idea about AVPops and dialog module but > > unfortunately I'm having a hard time understanding it. If ever, does > > anyone here be kind enough to point me to any available documents or > > sample configurations file that will help me limit the channels on > > inbound calls to a single or group of DIDs? Implementation will be > > done static first and hopefully once I got the whole idea, will be > > implementing a dynamic one. > > > > Thank you very much. > > > > --conpaj-- > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Users mailing list > > Users@lists.opensips.org > > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > > > > > -- > Bogdan-Andrei Iancu > www.voice-system.ro > > > _______________________________________________ > Users mailing list > Users@lists.opensips.org > http://lists.opensips.org/cgi-bin/mailman/listinfo/users >
_______________________________________________ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users