Update errors for freeswitch

This commit is contained in:
TeoV
2018-03-16 09:28:07 -04:00
committed by Dan Christian Bogos
parent 3bab281fda
commit 65a1ed19bd
2 changed files with 9 additions and 9 deletions

View File

@@ -144,7 +144,7 @@ func (sm *FSsessions) onChannelPark(fsev FSEvent, connId string) {
fmt.Sprintf("<%s> Could not authorize event %s, error: %s",
utils.FreeSWITCHAgent, fsev.GetUUID(), err.Error()))
sm.unparkCall(fsev.GetUUID(), connId,
fsev.GetCallDestNr(utils.META_DEFAULT), utils.ErrServerError.Error())
fsev.GetCallDestNr(utils.META_DEFAULT), err.Error())
return
}
if authArgs.GetMaxUsage {
@@ -165,7 +165,7 @@ func (sm *FSsessions) onChannelPark(fsev FSEvent, connId string) {
fmt.Sprintf("<%s> error %s setting channel variabile: %s",
utils.FreeSWITCHAgent, err.Error(), CGRResourceAllocation))
sm.unparkCall(fsev.GetUUID(), connId,
fsev.GetCallDestNr(utils.META_DEFAULT), utils.ErrServerError.Error())
fsev.GetCallDestNr(utils.META_DEFAULT), err.Error())
return
}
}
@@ -174,7 +174,7 @@ func (sm *FSsessions) onChannelPark(fsev FSEvent, connId string) {
if _, err := sm.conns[connId].SendApiCmd(fmt.Sprintf("uuid_setvar %s %s %s\n\n",
fsev.GetUUID(), utils.CGR_SUPPLIERS, fsArray)); err != nil {
utils.Logger.Info(fmt.Sprintf("<%s> error setting suppliers: %s", utils.FreeSWITCHAgent, err.Error()))
sm.unparkCall(fsev.GetUUID(), connId, fsev.GetCallDestNr(utils.META_DEFAULT), utils.ErrServerError.Error())
sm.unparkCall(fsev.GetUUID(), connId, fsev.GetCallDestNr(utils.META_DEFAULT), err.Error())
return
}
}
@@ -191,7 +191,7 @@ func (sm *FSsessions) onChannelPark(fsev FSEvent, connId string) {
fmt.Sprintf("<%s> error %s setting channel variabile: %s",
utils.FreeSWITCHAgent, err.Error(), fldName))
sm.unparkCall(fsev.GetUUID(), connId,
fsev.GetCallDestNr(utils.META_DEFAULT), utils.ErrServerError.Error())
fsev.GetCallDestNr(utils.META_DEFAULT), err.Error())
return
}
}
@@ -219,7 +219,7 @@ func (sm *FSsessions) onChannelAnswer(fsev FSEvent, connId string) {
utils.Logger.Err(
fmt.Sprintf("<%s> could not process answer for event %s, error: %s",
utils.FreeSWITCHAgent, chanUUID, err.Error()))
sm.disconnectSession(connId, chanUUID, "", utils.ErrServerError.Error())
sm.disconnectSession(connId, chanUUID, "", err.Error())
return
}
}

View File

@@ -104,19 +104,19 @@ func NewErrNotConnected(serv string) error {
}
func NewErrRALs(err error) error {
return fmt.Errorf("RALS_ERROR: %s", err)
return fmt.Errorf("RALS_ERROR:%s", err)
}
func NewErrResourceS(err error) error {
return fmt.Errorf("RESOURCES_ERROR: %s", err)
return fmt.Errorf("RESOURCES_ERROR:%s", err)
}
func NewErrSupplierS(err error) error {
return fmt.Errorf("SUPPLIERS_ERROR: %s", err)
return fmt.Errorf("SUPPLIERS_ERROR:%s", err)
}
func NewErrAttributeS(err error) error {
return fmt.Errorf("ATTRIBUTES_ERROR: %s", err)
return fmt.Errorf("ATTRIBUTES_ERROR:%s", err)
}
// Centralized returns for APIs