Author |
Message |
richtolley Brekeke Junior Member
Joined: 26 Feb 2015 Posts: 5
Location: UK
|
Posted: Thu Jan 21, 2016 9:41 am Post subject: Accessing UserRecord vars in DialPlan |
|
|
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 |
|
ambrosio Brekeke Master Guru
Joined: 27 Mar 2008 Posts: 215
|
Posted: Fri Jan 22, 2016 11:20 am Post subject: |
|
|
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 |
|
richtolley Brekeke Junior Member
Joined: 26 Feb 2015 Posts: 5
Location: UK
|
Posted: Fri Jan 22, 2016 1:29 pm Post subject: Thank you. |
|
|
That's really helpful - thank you - I will give it a try.
|
|
Back to top |
|
|