mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-14 20:59:53 +05:00
Updating radigo for udp/tcp connections, initial radius agent looping packets back
This commit is contained in:
@@ -50,10 +50,22 @@ type RadiusAgent struct {
|
||||
}
|
||||
|
||||
func (ra *RadiusAgent) handleAuth(req *radigo.Packet) (rpl *radigo.Packet, err error) {
|
||||
utils.Logger.Debug(fmt.Sprintf("RadiusAgent handleAuth, received request: %+v", req))
|
||||
rpl = req.Reply()
|
||||
rpl.Code = radigo.AccessAccept
|
||||
for _, avp := range req.AVPs {
|
||||
rpl.AVPs = append(rpl.AVPs, avp)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (ra *RadiusAgent) handleAcct(req *radigo.Packet) (rpl *radigo.Packet, err error) {
|
||||
utils.Logger.Debug(fmt.Sprintf("RadiusAgent handleAcct, received req: %+v", req))
|
||||
rpl = req.Reply()
|
||||
rpl.Code = radigo.AccountingResponse
|
||||
for _, avp := range req.AVPs {
|
||||
rpl.AVPs = append(rpl.AVPs, avp)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -66,7 +78,7 @@ func (ra *RadiusAgent) ListenAndServe() (err error) {
|
||||
}
|
||||
}()
|
||||
go func() {
|
||||
utils.Logger.Info(fmt.Sprintf("<RadiusAgent> Start listening for acct requests on <%s>", ra.cgrCfg.RadiusAgentCfg().ListenAcct))
|
||||
utils.Logger.Info(fmt.Sprintf("<RadiusAgent> Start listening for acct req on <%s>", ra.cgrCfg.RadiusAgentCfg().ListenAcct))
|
||||
if err := ra.rsAcct.ListenAndServe(); err != nil {
|
||||
errListen <- err
|
||||
}
|
||||
|
||||
2
glide.lock
generated
2
glide.lock
generated
@@ -18,7 +18,7 @@ imports:
|
||||
- name: github.com/cgrates/osipsdagram
|
||||
version: 3d6beed663452471dec3ca194137a30d379d9e8f
|
||||
- name: github.com/cgrates/radigo
|
||||
version: b0690a5c829349f3c1bb0973f422788b870a9acc
|
||||
version: 244e1809979396730f907f96819ce86fcafb0c81
|
||||
- name: github.com/cgrates/rpcclient
|
||||
version: dddae42e9344e877627cd4b7aba075d63b452c0b
|
||||
- name: github.com/ChrisTrenkamp/goxpath
|
||||
|
||||
Reference in New Issue
Block a user