Allow setting the handler tracking name by individual external scripts.
This must be set before installing the handlers. git-svn-id: http://voip.null.ro/svn/yate@5123 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
42e83cdc11
commit
55d79930e8
|
@ -201,6 +201,7 @@ For read-only parameters you must provide an empty value.<br />
|
||||||
<b>Currently supported parameters:</b><br />
|
<b>Currently supported parameters:</b><br />
|
||||||
id (string) - Identifier of the associated channel, if any<br />
|
id (string) - Identifier of the associated channel, if any<br />
|
||||||
disconnected (bool) - Enable or disable sending "chan.disconnected" messages<br />
|
disconnected (bool) - Enable or disable sending "chan.disconnected" messages<br />
|
||||||
|
trackparam (string) - Set the message handler tracking name, cannot be made empty<br />
|
||||||
reason (string) - Set the disconnect reason that gets received by the peer channel<br />
|
reason (string) - Set the disconnect reason that gets received by the peer channel<br />
|
||||||
timeout (int) - Timeout in milliseconds for answering to messages<br />
|
timeout (int) - Timeout in milliseconds for answering to messages<br />
|
||||||
timebomb (bool) - Terminate this module instance if a timeout occured<br />
|
timebomb (bool) - Terminate this module instance if a timeout occured<br />
|
||||||
|
|
|
@ -264,6 +264,7 @@ private:
|
||||||
String m_script, m_args;
|
String m_script, m_args;
|
||||||
ObjList m_waiting;
|
ObjList m_waiting;
|
||||||
ObjList m_relays;
|
ObjList m_relays;
|
||||||
|
String m_trackName;
|
||||||
String m_reason;
|
String m_reason;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -716,7 +717,7 @@ ExtModReceiver::ExtModReceiver(const char* script, const char* args, File* ain,
|
||||||
m_in(0), m_out(0), m_ain(ain), m_aout(aout),
|
m_in(0), m_out(0), m_ain(ain), m_aout(aout),
|
||||||
m_chan(chan), m_watcher(0), m_selfWatch(false), m_reenter(false), m_setdata(true),
|
m_chan(chan), m_watcher(0), m_selfWatch(false), m_reenter(false), m_setdata(true),
|
||||||
m_timeout(s_timeout), m_timebomb(s_timebomb), m_restart(false),
|
m_timeout(s_timeout), m_timebomb(s_timebomb), m_restart(false),
|
||||||
m_script(script), m_args(args)
|
m_script(script), m_args(args), m_trackName(s_trackName)
|
||||||
{
|
{
|
||||||
Debug(DebugAll,"ExtModReceiver::ExtModReceiver(\"%s\",\"%s\") [%p]",script,args,this);
|
Debug(DebugAll,"ExtModReceiver::ExtModReceiver(\"%s\",\"%s\") [%p]",script,args,this);
|
||||||
m_script.trimBlanks();
|
m_script.trimBlanks();
|
||||||
|
@ -733,7 +734,7 @@ ExtModReceiver::ExtModReceiver(const char* name, Stream* io, ExtModChan* chan, i
|
||||||
m_in(io), m_out(io), m_ain(0), m_aout(0),
|
m_in(io), m_out(io), m_ain(0), m_aout(0),
|
||||||
m_chan(chan), m_watcher(0), m_selfWatch(false), m_reenter(false), m_setdata(true),
|
m_chan(chan), m_watcher(0), m_selfWatch(false), m_reenter(false), m_setdata(true),
|
||||||
m_timeout(s_timeout), m_timebomb(s_timebomb), m_restart(false),
|
m_timeout(s_timeout), m_timebomb(s_timebomb), m_restart(false),
|
||||||
m_script(name)
|
m_script(name), m_trackName(s_trackName)
|
||||||
{
|
{
|
||||||
Debug(DebugAll,"ExtModReceiver::ExtModReceiver(\"%s\",%p,%p) [%p]",name,io,chan,this);
|
Debug(DebugAll,"ExtModReceiver::ExtModReceiver(\"%s\",%p,%p) [%p]",name,io,chan,this);
|
||||||
m_script.trimBlanks();
|
m_script.trimBlanks();
|
||||||
|
@ -1296,7 +1297,7 @@ bool ExtModReceiver::processLine(const char* line)
|
||||||
lock();
|
lock();
|
||||||
bool ok = id && !m_dead && !m_relays.find(id);
|
bool ok = id && !m_dead && !m_relays.find(id);
|
||||||
if (ok) {
|
if (ok) {
|
||||||
MessageRelay *r = new MessageRelay(id,this,0,prio,s_trackName);
|
MessageRelay *r = new MessageRelay(id,this,0,prio,m_trackName);
|
||||||
if (fname)
|
if (fname)
|
||||||
r->setFilter(fname,fvalue);
|
r->setFilter(fname,fvalue);
|
||||||
m_relays.append(r);
|
m_relays.append(r);
|
||||||
|
@ -1362,6 +1363,7 @@ bool ExtModReceiver::processLine(const char* line)
|
||||||
int col = id.find(':');
|
int col = id.find(':');
|
||||||
if (col > 0) {
|
if (col > 0) {
|
||||||
String val(id.substr(col+1));
|
String val(id.substr(col+1));
|
||||||
|
val.trimBlanks();
|
||||||
id = id.substr(0,col);
|
id = id.substr(0,col);
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
Lock mylock(this);
|
Lock mylock(this);
|
||||||
|
@ -1379,6 +1381,13 @@ bool ExtModReceiver::processLine(const char* line)
|
||||||
val = m_chan->disconn();
|
val = m_chan->disconn();
|
||||||
ok = true;
|
ok = true;
|
||||||
}
|
}
|
||||||
|
else if (id == "trackparam") {
|
||||||
|
if (val.null())
|
||||||
|
val = m_trackName;
|
||||||
|
else
|
||||||
|
m_trackName = val;
|
||||||
|
ok = true;
|
||||||
|
}
|
||||||
else if (id == "reason") {
|
else if (id == "reason") {
|
||||||
m_reason = val;
|
m_reason = val;
|
||||||
ok = true;
|
ok = true;
|
||||||
|
|
|
@ -275,6 +275,7 @@ $n = round(1 * Yate::Arg());
|
||||||
if ($n >= 2)
|
if ($n >= 2)
|
||||||
$ban_failures = $n;
|
$ban_failures = $n;
|
||||||
|
|
||||||
|
Yate::SetLocal("trackparam","banbrutes");
|
||||||
Yate::Watch("user.auth");
|
Yate::Watch("user.auth");
|
||||||
Yate::Install("user.authfail",120);
|
Yate::Install("user.authfail",120);
|
||||||
Yate::Install("engine.timer",150);
|
Yate::Install("engine.timer",150);
|
||||||
|
|
Loading…
Reference in New Issue