func CreateSignalSessionConfiguration(signalSessionConfiguration SignalSessionConfiguration, customer Customer) (newSignalSessionConfiguration db_models.SignalSessionConfiguration, err error) {
	engine, err := ConnectDB()
	if err != nil {
		log.Errorf("database connect error: %s", err)
		return
	}
	dbSignalSessionConfiguration := new(db_models.SignalSessionConfiguration)
	_, err = engine.Where("customer_id = ?", customer.Id).Get(dbSignalSessionConfiguration)
	if err != nil {
		log.Errorf("database query error: %s", err)
		return
	}
	if dbSignalSessionConfiguration != nil && dbSignalSessionConfiguration.Id != 0 {
		err = UpdateSignalSessionConfiguration(signalSessionConfiguration, customer)
		return
	}
	session := engine.NewSession()
	defer session.Close()
	err = session.Begin()
	if err != nil {
		return
	}
	newSignalSessionConfiguration = db_models.SignalSessionConfiguration{
		CustomerId:        customer.Id,
		SessionId:         signalSessionConfiguration.SessionId,
		HeartbeatInterval: signalSessionConfiguration.HeartbeatInterval,
		MissingHbAllowed:  signalSessionConfiguration.MissingHbAllowed,
		MaxRetransmit:     signalSessionConfiguration.MaxRetransmit,
		AckTimeout:        signalSessionConfiguration.AckTimeout,
		AckRandomFactor:   signalSessionConfiguration.AckRandomFactor,
		HeartbeatIntervalIdle: signalSessionConfiguration.HeartbeatIntervalIdle,
		MissingHbAllowedIdle:  signalSessionConfiguration.MissingHbAllowedIdle,
		MaxRetransmitIdle:     signalSessionConfiguration.MaxRetransmitIdle,
		AckTimeoutIdle:        signalSessionConfiguration.AckTimeoutIdle,
		AckRandomFactorIdle:   signalSessionConfiguration.AckRandomFactorIdle,
	}
	_, err = session.Insert(&newSignalSessionConfiguration)
	if err != nil {
		log.Infof("signal_session_configuration insert err: %s", err)
		goto Rollback
	}
	err = session.Commit()
	return
Rollback:
	session.Rollback()
	return
}
/*
Stores SignalSessionConfiguration to the DB.

parameter:
signalSessionConfiguration SignalSessionConfiguration
customer Customer
return:
err error
package models
import (
	"github.com/nttdots/go-dots/dots_server/db_models"
	log "github.com/sirupsen/logrus"
)