Brekeke Forum Index » Brekeke SIP Server Forum

Post new topic   Reply to topic
How can we set max time for talk/session
Author Message
adeel.gnome
Brekeke Member


Joined: 09 Jul 2008
Posts: 12

PostPosted: Wed Jul 09, 2008 1:06 am    Post subject: How can we set max time for talk/session Reply with quote

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
View user's profile Visit poster's website
lakeview
Brekeke Master Guru


Joined: 15 Nov 2007
Posts: 319
Location: Florida

PostPosted: Wed Jul 09, 2008 11:11 am    Post subject: Reply with quote

>> 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
View user's profile
adeel.gnome
Brekeke Member


Joined: 09 Jul 2008
Posts: 12

PostPosted: Wed Jul 09, 2008 6:40 pm    Post subject: Reply with quote

>> 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
View user's profile Visit poster's website
janP
Brekeke Master Guru


Joined: 25 Nov 2007
Posts: 336

PostPosted: Thu Jul 10, 2008 6:17 pm    Post subject: Reply with quote

>> 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
View user's profile
adeel.gnome
Brekeke Member


Joined: 09 Jul 2008
Posts: 12

PostPosted: Thu Jul 10, 2008 6:48 pm    Post subject: Reply with quote

>> 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
View user's profile Visit poster's website
janP
Brekeke Master Guru


Joined: 25 Nov 2007
Posts: 336

PostPosted: Fri Jul 11, 2008 10:09 am    Post subject: Reply with quote

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
View user's profile
adeel.gnome
Brekeke Member


Joined: 09 Jul 2008
Posts: 12

PostPosted: Fri Jul 11, 2008 6:33 pm    Post subject: Reply with quote

>>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
View user's profile Visit poster's website
janP
Brekeke Master Guru


Joined: 25 Nov 2007
Posts: 336

PostPosted: Mon Jul 14, 2008 9:58 am    Post subject: Reply with quote

Do you need to set a unique taking-time value to each session?
Is it depending on a user??
Back to top
View user's profile
adeel.gnome
Brekeke Member


Joined: 09 Jul 2008
Posts: 12

PostPosted: Mon Jul 14, 2008 6:57 pm    Post subject: Reply with quote

>>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
View user's profile Visit poster's website
janP
Brekeke Master Guru


Joined: 25 Nov 2007
Posts: 336

PostPosted: Tue Jul 15, 2008 10:39 am    Post subject: Reply with quote

>> 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
View user's profile
adeel.gnome
Brekeke Member


Joined: 09 Jul 2008
Posts: 12

PostPosted: Tue Jul 15, 2008 6:43 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
lakeview
Brekeke Master Guru


Joined: 15 Nov 2007
Posts: 319
Location: Florida

PostPosted: Wed Jul 16, 2008 11:40 am    Post subject: Reply with quote

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
View user's profile
adeel.gnome
Brekeke Member


Joined: 09 Jul 2008
Posts: 12

PostPosted: Wed Aug 13, 2008 11:10 pm    Post subject: Reply with quote

Thanks, Lakeview.
Back to top
View user's profile Visit poster's website
peng
Brekeke Guru


Joined: 20 Jul 2005
Posts: 110

PostPosted: Thu Aug 14, 2008 6:54 pm    Post subject: Reply with quote

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
View user's profile
lakeview
Brekeke Master Guru


Joined: 15 Nov 2007
Posts: 319
Location: Florida

PostPosted: Wed Aug 20, 2008 11:39 am    Post subject: Reply with quote

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
View user's profile
adeel.gnome
Brekeke Member


Joined: 09 Jul 2008
Posts: 12

PostPosted: Wed Aug 20, 2008 6:51 pm    Post subject: Reply with quote

Thanks lakeview.
Can we make dial plans programmatically?
Back to top
View user's profile Visit poster's website
lakeview
Brekeke Master Guru


Joined: 15 Nov 2007
Posts: 319
Location: Florida

PostPosted: Mon Aug 25, 2008 10:37 am    Post subject: Reply with quote

Yes you can.

Try DialPlan plug-in.
http://www.brekeke-sip.com/download/bss/bss_tutorial_dialplan_plugin.txt
Back to top
View user's profile
adeel.gnome
Brekeke Member


Joined: 09 Jul 2008
Posts: 12

PostPosted: Mon Aug 25, 2008 7:17 pm    Post subject: Reply with quote

Thanks, lakeview. Will surely, try it out.
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Brekeke Forum Index » Brekeke SIP Server Forum All times are GMT - 7 Hours
Page 1 of 1