How can we set max time for talk/session

Discuss any topic about Brekeke SIP Server.

Moderator: Brekeke Support Team

Post Reply
adeel.gnome
Posts: 12
Joined: Wed Jul 09, 2008 12:53 am
Contact:

How can we set max time for talk/session

Post by adeel.gnome »

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
Posts: 319
Joined: Thu Nov 15, 2007 11:54 am
Location: Florida

Post by 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
Posts: 12
Joined: Wed Jul 09, 2008 12:53 am
Contact:

Post by 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
Posts: 336
Joined: Sun Nov 25, 2007 2:55 pm

Post by 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
Posts: 12
Joined: Wed Jul 09, 2008 12:53 am
Contact:

Post by 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
Posts: 336
Joined: Sun Nov 25, 2007 2:55 pm

Post by 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
Posts: 12
Joined: Wed Jul 09, 2008 12:53 am
Contact:

Post by 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
Posts: 336
Joined: Sun Nov 25, 2007 2:55 pm

Post by janP »

Do you need to set a unique taking-time value to each session?
Is it depending on a user??
adeel.gnome
Posts: 12
Joined: Wed Jul 09, 2008 12:53 am
Contact:

Post by 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
Posts: 336
Joined: Sun Nov 25, 2007 2:55 pm

Post by 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
Posts: 12
Joined: Wed Jul 09, 2008 12:53 am
Contact:

Post by 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
Posts: 319
Joined: Thu Nov 15, 2007 11:54 am
Location: Florida

Post by 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
Posts: 12
Joined: Wed Jul 09, 2008 12:53 am
Contact:

Post by adeel.gnome »

Thanks, Lakeview.
peng
Posts: 110
Joined: Wed Jul 20, 2005 7:06 pm

Post by peng »

The timeout works only when SIP packckets don't come before the timeout.
I think &net.sip.timeout.talking is not enough.
lakeview
Posts: 319
Joined: Thu Nov 15, 2007 11:54 am
Location: Florida

Post by 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: Select all

  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
Posts: 12
Joined: Wed Jul 09, 2008 12:53 am
Contact:

Post by adeel.gnome »

Thanks lakeview.
Can we make dial plans programmatically?
lakeview
Posts: 319
Joined: Thu Nov 15, 2007 11:54 am
Location: Florida

Post by lakeview »

adeel.gnome
Posts: 12
Joined: Wed Jul 09, 2008 12:53 am
Contact:

Post by adeel.gnome »

Thanks, lakeview. Will surely, try it out.
Post Reply