Regfile
(→Section 'General' in regfile.conf) |
(→Limit calls only for autenticated users) |
||
(20 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | Regfile is a registration module. It can be used for autentication, registration, and routing | + | Regfile is a registration module. It can be used for autentication, registration, and routing for users configured in a file.<br> |
− | When we talk about users we can refer to phones, softclients or another server. The user can | + | When we talk about users we can refer to phones, softclients or another server. The user can use any protocol that allows registration in Yate like SIP, H323, IAX or Jabber.<br> |
− | + | Regfile can be used as a demo module for people who want to develop their own autentication, registration, or routing module. | |
− | == | + | == How to define users in regfile == |
− | The configuration file is regfile.conf | + | The configuration file is regfile.conf. |
+ | For each user you have to define a section in regfile.conf. | ||
; you have to put username as a category and password into key password | ; you have to put username as a category and password into key password | ||
; if password is missing the module will only register but not authenticate | ; if password is missing the module will only register but not authenticate | ||
Line 14: | Line 15: | ||
;password=something | ;password=something | ||
− | + | === Examples === | |
+ | |||
+ | To register a Grandstream Budgetone SIP phone, with username bt101, to a Yate SIP Server, in regfile.conf: | ||
[bt101] | [bt101] | ||
password=mysecretpass | password=mysecretpass | ||
− | |||
− | + | To register a Jabber user to Yate Jabber Server you have to configure in regfile.conf: | |
+ | |||
+ | ;[username@domain] | ||
+ | [100@192.168.168.1] | ||
+ | password=mysecretpassword | ||
+ | |||
+ | == Defining messages priorities== | ||
− | + | In [general] section you can set the priority of the various messages handled by regfile and define file where registration information can be saved. | |
[general] | [general] | ||
Line 37: | Line 45: | ||
;file=/path/filename | ;file=/path/filename | ||
− | + | You must set the file parameter so that the registered entities will not be lost on reload Yate. | |
'''Note''': The registration of users are lost on Yate restart if you don't set a file for persistent storage in regfile.conf. So only registration is lost, not their account/password. | '''Note''': The registration of users are lost on Yate restart if you don't set a file for persistent storage in regfile.conf. So only registration is lost, not their account/password. | ||
− | If the routing is done from several routing modules then you have to | + | If the routing is done from several routing modules then you have to pay attention to the priorities of the call.route message handler for each module. |
'''Note''': If you also use regexroute.conf for routing, you have to set priority of route. By default they both have 100 priority so at each startup of Yate the order is randomly | '''Note''': If you also use regexroute.conf for routing, you have to set priority of route. By default they both have 100 priority so at each startup of Yate the order is randomly | ||
selected. The one who has '''lower''' priority is first executed. | selected. The one who has '''lower''' priority is first executed. | ||
− | == | + | ==Adding parameters to registered users== |
− | Other | + | Other parameters that can be configured for each defined account: |
+ | [username] | ||
; alternatives: list of called party numbers separated by coma | ; alternatives: list of called party numbers separated by coma | ||
; Note if multiple users share the same party number the call will go to all users. | ; Note if multiple users share the same party number the call will go to all users. | ||
Line 69: | Line 78: | ||
; | ; | ||
;param=value | ;param=value | ||
− | + | ||
== Limit calls only for autenticated users == | == Limit calls only for autenticated users == | ||
Line 81: | Line 90: | ||
* [[Regular_expressions| Regexroute module]] | * [[Regular_expressions| Regexroute module]] | ||
* [[Register| Register module]] | * [[Register| Register module]] | ||
+ | * [[Routing]] | ||
+ | |||
+ | |||
+ | [[Category:Routing]] [[Category:Autentication]] [[Category:Registration]] [[Category:Beginners]] [[Category:Users]] |
Latest revision as of 15:59, 31 October 2013
Regfile is a registration module. It can be used for autentication, registration, and routing for users configured in a file.
When we talk about users we can refer to phones, softclients or another server. The user can use any protocol that allows registration in Yate like SIP, H323, IAX or Jabber.
Regfile can be used as a demo module for people who want to develop their own autentication, registration, or routing module.
Contents |
[edit] How to define users in regfile
The configuration file is regfile.conf.
For each user you have to define a section in regfile.conf.
; you have to put username as a category and password into key password ; if password is missing the module will only register but not authenticate ; if password exists and is empty will blindly authenticate anybody [username] ;password=something
[edit] Examples
To register a Grandstream Budgetone SIP phone, with username bt101, to a Yate SIP Server, in regfile.conf:
[bt101] password=mysecretpass
To register a Jabber user to Yate Jabber Server you have to configure in regfile.conf:
;[username@domain] [100@192.168.168.1] password=mysecretpassword
[edit] Defining messages priorities
In [general] section you can set the priority of the various messages handled by regfile and define file where registration information can be saved.
[general] ; auth setups the user.auth handler priority auth=100 ; register setups the user.register and user.unregister ; handlers priority register=100 ; route setups the call.route handler priority route=100 ; file: string. An auxiliary conf file used to save and load from it autocreated and registered entries ; If file don't exists the registered entities will be lost on reload ;file=/path/filename
You must set the file parameter so that the registered entities will not be lost on reload Yate.
Note: The registration of users are lost on Yate restart if you don't set a file for persistent storage in regfile.conf. So only registration is lost, not their account/password.
If the routing is done from several routing modules then you have to pay attention to the priorities of the call.route message handler for each module.
Note: If you also use regexroute.conf for routing, you have to set priority of route. By default they both have 100 priority so at each startup of Yate the order is randomly selected. The one who has lower priority is first executed.
[edit] Adding parameters to registered users
Other parameters that can be configured for each defined account:
[username] ; alternatives: list of called party numbers separated by coma ; Note if multiple users share the same party number the call will go to all users. ;alternatives= num1,num2,.... ; ; Set/Modify call.route parameters when the caller matches this section ; You can put call.route replacement ${variables} on the right side ; Note: Any parameter except for "password" and "alternatives" will be used for set/modify ; ; Ex: ; Modify caller name ;callername=name ; ; Modify caller number ;caller=number ; ; Replacement example ;callername=John Doe from ${address} ; ;param=value
[edit] Limit calls only for autenticated users
If you want to limit the access to make calls only to autenticated users you have to setup in regexroute.conf in section [default] this line:
${username}^$=-;error=noauth
See also