Author |
Message |
adeel.gnome Brekeke Member
Joined: 09 Jul 2008 Posts: 12
|
Posted: Wed Jul 09, 2008 1:06 am Post subject: How can we set max time for talk/session |
|
|
1. Brekeke Product Name and version:
Brekeke PBX, Version 2.2.1.6
2. Java version:
jdk 1.6.0_10
3. OS type and the version:
Linux, openSUSE 11.0
4. UA (phone), gateway or other hardware/software involved:
5. Select your network pattern from http://www.brekeke-sip.com/bbs/network/networkpatterns.html :
6. Your problem:
Am I only one missing time parameter in given callControl() method?
I mean, how can we set the time value using setSchedule() or setScheduleTerminate() methods inside session plugin. Yes, I know we can, but suppose the value is coming from database. Do we need to access our database from our plugin, which resides under PBX application? That not really sounds good.
Any other options?? Please share with me.
--
Adeel Ansari |
|
Back to top |
|
lakeview Brekeke Master Guru
Joined: 15 Nov 2007 Posts: 319
Location: Florida
|
Posted: Wed Jul 09, 2008 11:11 am Post subject: |
|
|
>> how can we set the time value using setSchedule() or setScheduleTerminate()
Did you read the plug-in document?
>> but suppose the value is coming from database.
It is incorrect...
>> Any other options?? Please share with me.
The property variable "net.sip.timeout.talking" can specify the talking time. Let you try. |
|
Back to top |
|
adeel.gnome Brekeke Member
Joined: 09 Jul 2008 Posts: 12
|
Posted: Wed Jul 09, 2008 6:40 pm Post subject: |
|
|
>> Did you read the plug-in document?
Yes. I managed to set both the schedule time and schedule terminate time
>> It is incorrect...
Suppose, we have different values for different calls/sessions. Based on the caller.
>> The property variable "net.sip.timeout.talking" can specify the talking time. Let you try.
I believe, thats the value which is applied by default. Do we need to read and apply it in our plugin? However, it seems like one value for all calls/sessions.
Am I missing the idea?
Thanks for your response.
--
Adeel |
|
Back to top |
|
janP Brekeke Master Guru
Joined: 25 Nov 2007 Posts: 336
|
Posted: Thu Jul 10, 2008 6:17 pm Post subject: |
|
|
>> Suppose, we have different values for different calls/sessions. Based on the caller.
I see... I understand your situation.
I think the checking of your database from the plug-in as you mentioned is a good idea. |
|
Back to top |
|
adeel.gnome Brekeke Member
Joined: 09 Jul 2008 Posts: 12
|
Posted: Thu Jul 10, 2008 6:48 pm Post subject: |
|
|
>> I think the checking of your database from the plug-in as you mentioned is a good idea.
Hmmm.... very fine. Well, if you or anybody else know if there is any hook for callControl() method? So, we can build some plugin around that, then expose that plugin as a webservice, and use that instead of UserImpl.
Is it making any sound to you folks?
Thanks. |
|
Back to top |
|
janP Brekeke Master Guru
Joined: 25 Nov 2007 Posts: 336
|
Posted: Fri Jul 11, 2008 10:09 am Post subject: |
|
|
adeel,
Where does "callControl()" method come from?
I couldn't find such a method in the Accounting plug-in document...
In my thought, you need to call setSchedule() or setScheduleTerminate() from the "eventTalkStart()" method. |
|
Back to top |
|
adeel.gnome Brekeke Member
Joined: 09 Jul 2008 Posts: 12
|
Posted: Fri Jul 11, 2008 6:33 pm Post subject: |
|
|
>>Where does "callControl()" method come from?
I couldn't find such a method in the Accounting plug-in document...
Oops!! my mistake I didn't make it clear from the start. Actually, its one of the method exposed via webservice, UserImpl.
>>In my thought, you need to call setSchedule() or setScheduleTerminate() from the "eventTalkStart()" method.
Yes, thats the reason we need to access the database from our plugin. I mean to get the time value and pass as an argument.
Thanks. |
|
Back to top |
|
janP Brekeke Master Guru
Joined: 25 Nov 2007 Posts: 336
|
Posted: Mon Jul 14, 2008 9:58 am Post subject: |
|
|
Do you need to set a unique taking-time value to each session?
Is it depending on a user?? |
|
Back to top |
|
adeel.gnome Brekeke Member
Joined: 09 Jul 2008 Posts: 12
|
Posted: Mon Jul 14, 2008 6:57 pm Post subject: |
|
|
>>Do you need to set a unique taking-time value to each session?
Yes.
>>Is it depending on a user??
Nope, it depends on the CALLER. |
|
Back to top |
|
janP Brekeke Master Guru
Joined: 25 Nov 2007 Posts: 336
|
Posted: Tue Jul 15, 2008 10:39 am Post subject: |
|
|
>> Nope, it depends on the CALLER.
how many callers?
with the dialplan below..
CALLER-1's talking-time will be 60000sec (1min).
CALLER-2's talking-time will be 120000sec (2min).
Matching Patterns | $request = ^INVITE From = sip:CALLER-1@
| Deploy Patterns | &net.sip.timeout.talking = 60000
|
Matching Patterns | $request = ^INVITE From = sip:CALLER-2@
| Deploy Patterns | &net.sip.timeout.talking = 120000
|
|
|
Back to top |
|
adeel.gnome Brekeke Member
Joined: 09 Jul 2008 Posts: 12
|
Posted: Tue Jul 15, 2008 6:43 pm Post subject: |
|
|
Suppose n callers. Where n can be between 1 and million+. Callers are stored in the database with their details.
Thanks for showing the complete dial plan. Is it possible to define a dial plan on the fly - and also remove it - for an external application, say may be using a webservice?
Thanks for your inputs. |
|
Back to top |
|
lakeview Brekeke Master Guru
Joined: 15 Nov 2007 Posts: 319
Location: Florida
|
Posted: Wed Jul 16, 2008 11:40 am Post subject: |
|
|
Hi adeel,
>> say may be using a webservice?
The Brekeke SIP Server's Advanced Edition has a webservice interface.
For example...
Matching Patterns | $request = ^INVITE From = sip:(.+)@ $soapget( "http://soap.server", "http://soap.serve", "getValue","user = %1" ) = (.+)
| Deploy Patterns | &net.sip.timeout.talking = %2
|
|
|
Back to top |
|
adeel.gnome Brekeke Member
Joined: 09 Jul 2008 Posts: 12
|
Posted: Wed Aug 13, 2008 11:10 pm Post subject: |
|
|
Thanks, Lakeview. |
|
Back to top |
|
peng Brekeke Guru
Joined: 20 Jul 2005 Posts: 110
|
Posted: Thu Aug 14, 2008 6:54 pm Post subject: |
|
|
The timeout works only when SIP packckets don't come before the timeout.
I think &net.sip.timeout.talking is not enough. |
|
Back to top |
|
lakeview Brekeke Master Guru
Joined: 15 Nov 2007 Posts: 319
Location: Florida
|
Posted: Wed Aug 20, 2008 11:39 am Post subject: |
|
|
Here is the solution.
DialPlan:
Matching Patterns | $request = ^INVITE From = sip:(.+)@ $soapget( "http://soap.server", "http://soap.serve", "getValue","user = %1" ) = (.+)
| Deploy Patterns | &my.timer = %2
|
Session Plug-in:
Code: |
public void eventTalkStart( EventStat evstat )
{
setScheduleTerminate( env.getLong( "my.timer" ) ) ;
}
|
In this example, I defined the variable "my.timer" which indicates the timer for termination. |
|
Back to top |
|
adeel.gnome Brekeke Member
Joined: 09 Jul 2008 Posts: 12
|
Posted: Wed Aug 20, 2008 6:51 pm Post subject: |
|
|
Thanks lakeview.
Can we make dial plans programmatically? |
|
Back to top |
|
lakeview Brekeke Master Guru
Joined: 15 Nov 2007 Posts: 319
Location: Florida
|
|
Back to top |
|
adeel.gnome Brekeke Member
Joined: 09 Jul 2008 Posts: 12
|
Posted: Mon Aug 25, 2008 7:17 pm Post subject: |
|
|
Thanks, lakeview. Will surely, try it out. |
|
Back to top |
|
|