Forums Read-only archive

How can we set max time for talk/session

18 posts · Brekeke SIP Server Forum

adeel.gnome Original post
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/ ... terns.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
lakeview
>> 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.
adeel.gnome
>> 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
janP
>> 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.
adeel.gnome
>> 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.
janP
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.
adeel.gnome
>>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.
janP
Do you need to set a unique taking-time value to each session?
Is it depending on a user??
adeel.gnome
>>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.
janP
>> 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 Pattern:]
$request = ^INVITE
From = sip:CALLER-1@

[Deploy Pattern:]
&net.sip.timeout.talking = 60000
-----------------------------


-----------------------------
[Matching Pattern:]
$request = ^INVITE
From = sip:CALLER-2@

[Deploy Pattern:]
&net.sip.timeout.talking = 120000
-----------------------------
adeel.gnome
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.
lakeview
Hi adeel,

>> say may be using a webservice?

The Brekeke SIP Server's Advanced Edition has a webservice interface.

For example...
-----------------------------
[Matching Pattern:]
$request = ^INVITE
From = sip:(.+)@
$soapget( "http://soap.server", "http://soap.serve", "getValue","user=%1" ) = (.+)

[Deploy Pattern:]
&net.sip.timeout.talking = %2
-----------------------------
adeel.gnome
Thanks, Lakeview.
peng
The timeout works only when SIP packckets don't come before the timeout.
I think &net.sip.timeout.talking is not enough.
lakeview
Here is the solution.

DialPlan:
-----------------------------
[Matching Pattern:]
$request = ^INVITE
From = sip:(.+)@
$soapget( "http://soap.server", "http://soap.serve", "getValue","user=%1" ) = (.+)

[Deploy Pattern:]
&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.
adeel.gnome
Thanks lakeview.
Can we make dial plans programmatically?
lakeview
adeel.gnome
Thanks, lakeview. Will surely, try it out.