Changed default value for resource priority in presences generated by the jingle module and made it configurable.
git-svn-id: http://voip.null.ro/svn/yate@3664 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
3dfe2351b6
commit
6067a2cff0
|
@ -19,6 +19,11 @@
|
|||
; If this parameter is empty the module will handle all resources
|
||||
;resources=
|
||||
|
||||
; resource_priority: integer: Resource priority for presence sent by the module
|
||||
; Interval allowed -128..127
|
||||
; Defaults to 0
|
||||
;resource_priority=0
|
||||
|
||||
; jingle_version: integer: Jingle session version to use for outgoing calls
|
||||
; Defaults to the newest version if missing or invalid
|
||||
; Allowed values are 0 or 1
|
||||
|
|
|
@ -498,7 +498,7 @@ static bool s_cryptoMandatory = false; // Offer mandatory crypto on o
|
|||
static bool s_acceptRelay = false;
|
||||
static bool s_offerRawTransport = true; // Offer RAW UDP transport on outgoing sessions
|
||||
static bool s_offerIceTransport = true; // Offer ICE UDP transport on outgoing sessions
|
||||
static String s_priority = "-1"; // Resource priority for presence generated by this module
|
||||
static int s_priority = 0; // Resource priority for presence generated by this module
|
||||
static JGSession::Version s_sessVersion = JGSession::VersionUnknown; // Default jingle session version for outgoing calls
|
||||
static String s_capsNode = "http://yate.null.ro/yate/jingle/caps"; // node for entity capabilities
|
||||
static bool s_serverMode = true; // Server/client mode
|
||||
|
@ -3172,6 +3172,14 @@ void YJGDriver::initialize()
|
|||
s_offerRawTransport = sect->getBoolValue("offerrawudp",true);
|
||||
s_offerIceTransport = sect->getBoolValue("offericeudp",true);
|
||||
|
||||
int prio = sect->getIntValue("resource_priority");
|
||||
if (prio < -128)
|
||||
s_priority = -128;
|
||||
else if (prio > 127)
|
||||
s_priority = 127;
|
||||
else
|
||||
s_priority = prio;
|
||||
|
||||
// Init codecs in use. Check each codec in known codecs list against the configuration
|
||||
s_usedCodecs.clear();
|
||||
bool defcodecs = s_cfg.getBoolValue("codecs","default",true);
|
||||
|
@ -3850,7 +3858,7 @@ void YJGDriver::notifyPresence(const JabberID& from, const char* to, bool online
|
|||
m->addParam("operation",online ? "online" : "offline");
|
||||
if (online) {
|
||||
XmlElement* xml = XMPPUtils::createPresence(0,0);
|
||||
XMPPUtils::setPriority(*xml,s_priority);
|
||||
XMPPUtils::setPriority(*xml,String(s_priority));
|
||||
xml->addChild(XMPPUtils::createEntityCapsGTalkV1());
|
||||
xml->addChild(new XmlElement(*m_entityCaps));
|
||||
m->addParam(new NamedPointer("xml",xml));
|
||||
|
|
Loading…
Reference in New Issue