On Wed, Apr 15, 2009 at 12:53 PM, Jinsong Hu <jinsong...@hotmail.com> wrote: > I pasted this with 1.5 kamailio, and loaded module dialog.so, the script > doesn't even work. > I suspect it is because "$var(SIZE)" > so I loaded avpops.so, it doesn't help. > > I then searched http://kamailio.org/docs/modules/1.5.x/dialog.html > and found > > get_profile_size("inbound_call","$avp(size)"); > xlog("currently there are $avp(size) inbound calls\n"); > .. > get_profile_size("caller","$fu"); > xlog("currently, the user %fu has $avp(size) active outgoing calls\n"); > I pasted this to the script, still have problem:# /etc/init.d/kamailio > restart | grep ERRORApr 15 03:45:14 [4666] ERROR:core:main: bad config file > (4 errors)looks the problem is also $avp(size) is not defined. doesn anybody > knows how to get this solved ?Jimmy.
Hello, please try to put $var(SIZE) = 0; before the previous code snippet. Also, be aware that I'm still using kamailio 1.4 so you may encounter other issues as I have not tested it with 1.5. regards, takeshi > > ----- Original Message ----- From: "mayamatakeshi" <mayamatake...@gmail.com> > To: "Jinsong Hu" <jinsong...@hotmail.com> > Cc: <users@lists.kamailio.org> > Sent: Saturday, April 11, 2009 8:29 PM > Subject: Re: [Kamailio-Users] using dialog to limit concurrent call, and > limit monthly limits > > > On Sat, Apr 11, 2009 at 3:44 PM, Jinsong Hu <jinsong...@hotmail.com> wrote: >> >> 2. people can use a single username/password , but uses it as a trunk, so >> they run multiple channels of voice call . With this they can run up >> thousands of dollars of bills on the kamailio owner. There are suggestion >> that we use dialog module to limit it. However no sample code is given. >> this is a sample code I googled: >> if ( avp_check("$DLG_count", "gt/i:10") ) { >> sl_send_reply("403","no more calls accepted"); >> exit; >> } >> but looks DLG_count is a global variable. Does any body have a better >> example ? > > Hello, > here's an example limiting the number of simultaneous calls for each user: > > get_profile_size("caller", "$fu", "$var(SIZE)"); > if( $var(SIZE) >= MAX_NUMBER_OF_CALLS ){ > sl_send_reply("503", "Simultaneous calls limit reached"); > exit; > } > set_dlg_profile("caller","$fu"); > > _______________________________________________ Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users