Yate server > Yate bugs

TCP external modules and Engine::dispatch

(1/1)

andr04:
I have the following function which returns CallEndpoint by channel id:
--- Code: ---static CallEndpoint* locateChan(const String& id, bool peer = false)
{
    if (id.null())
return 0;
    Message m("chan.locate");
    m.addParam("id",id);
    if (!Engine::dispatch(m))
return 0;
    CallEndpoint* ce = static_cast<CallEndpoint*>(m.userObject(YATOM("CallEndpoint")));
    if (!ce)
return 0;
    return peer ? ce->getPeer() : ce;
}
--- End code ---

This code is used from ExtModReceiver::processLine as follows. And this works if external module is a pipe script, but doesn't work if it a TCP socket. I tried to debug it without success: Engine::dispatch doesn't work.

The difference which I've found is TCP extmodule starts from an additional thread of ExtListener which is a server for processing incoming connections (it's true approach). Can this broke Engine::dispatch? Or may be other reasons?

marian:
Can you tell what happens?
- channel id is empty: add debug to see it
- chan.locate fails: check message with sniffer enabled
- chan.locate returns NULL or a non CallEndpoint descendant: NULL may be checked with message sniffer
- returned CallEndpoint has no peer and peer was requested: add debug to see it

Navigation

[0] Message Index

Go to full version