Brekeke Forum Index » Brekeke SIP Server Forum

Post new topic   Reply to topic
Accessing UserRecord vars in DialPlan
Author Message
richtolley
Brekeke Junior Member


Joined: 26 Feb 2015
Posts: 5
Location: UK

PostPosted: Thu Jan 21, 2016 9:41 am    Post subject: Accessing UserRecord vars in DialPlan Reply with quote

1. Brekeke Product Name and Version: BSS 3.5.3.0

2. Java version: 1.8

3. OS type and the version: Windows x64

4. UA (phone), gateway or other hardware/software involved: Bria

5. Your problem:

Hi All

I have managed to get an Auth Plugin working - at least it is authorizing the calls ( record.bAuthorized = true) and outputting good logging information.


I am setting the various UserRecord properties such as

record.amountCredit="1000"
record.szCurrency="GBP"

in the plugin...


How would I access these values in a dial-plan? I have spent hours looking through the forums, Wiki, googling etc.



And if it's not too much to ask...


What I really want to do is return some custom data in the UserRecord.ext object and pass this information into a dialplan plugin.


I have the dialplan plugin working - yay - but can't get data from the auth plugin into the dialplan plugin.


Any help, pointers would be very much appreciated.

Kind Regards

Rich
Back to top
View user's profile
ambrosio
Brekeke Master Guru


Joined: 27 Mar 2008
Posts: 215

PostPosted: Fri Jan 22, 2016 11:20 am    Post subject: Reply with quote

These variables are for working with Radius but you can set them in your own Auth Plugin.

Try the following DialPlan rules for accessing these values.

Rule-1: Call the Auth Plugin
Matching Patterns
$request = ^INVITE
$radius.auth = true
Deploy Patterns
$continue = true


Rule-2: Access to the amountCredit's value
Matching Patterns
$request = ^INVITE
&auth.result = true
&auth.h323-credit-amount = (.+)
Deploy Patterns
$log = credit-amount is %1


Rule-3: Access to the szCurrency's value
Matching Patterns
$request = ^INVITE
&auth.result = true
&auth.h323-currency = (.+)
Deploy Patterns
$log = currency is %1



You can combine these rules to a single rule if you want.
FYI:
http://wiki.brekeke.com/wiki/RADIUS-authentication



If you want to pass a credit-amount value to your DialPlan plugin, Matching Patterns will be like this.
Matching Patterns
$request = ^INVITE
$radius.auth = true
$yourdialplan.method(&auth.h323-credit-amount) = (.+)
Back to top
View user's profile
richtolley
Brekeke Junior Member


Joined: 26 Feb 2015
Posts: 5
Location: UK

PostPosted: Fri Jan 22, 2016 1:29 pm    Post subject: Thank you. Reply with quote

That's really helpful - thank you - I will give it a try.

Very Happy
Back to top
View user's profile
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