irontec / itsbc

Irontec Tiny SBC. OpenSIPS & RTPEngine based micro SBC with Web Administration
GNU General Public License v3.0
35 stars 27 forks source link

first options always returns not found #10

Open ralonsom opened 6 years ago

ralonsom commented 6 years ago

After receiving the registration and sending it to the PBX. The first options that the PBX sends to the terminal the SBC always answers Not Found options.txt

cruzccl commented 6 years ago

Hi @ralonsom,

OPTIONS traversed the same logic as method that initiate sessions, instead of be handled asap.

Commit 9c4e328 adds a logic that answers a 200 and allows checking that OpenSIPS is alive.

Can you try it, please?

Regards,

ralonsom commented 6 years ago

Hi, I think this is not the solution, this way we are sending OK to the PBX options to the terminals, and we are giving it as "online" in the eyes of the PBX.

But it may be the terminal has been turned off.

cruzccl commented 6 years ago

Hi @ralonsom,

As you say, OPTIONS sent to ITSBC are not valid to test if terminals are reachable, they only guarantee that ITSBC is up and running.

ITSBC is responsible for handling REGISTER messages from UACs and forwarding them to behind SIP entity (e.g. PBX) whenever a change is detected. PBX should relay on ITSBC for those tasks, so they don't need to monitor the UACs.

This means that using mid_registrar module, if the PBX has a valid registration, it should send an INVITE to ITSBC and, in the case that the UAC is suddenly DOWN, ITSBC would answer a 408 that may trigger failover logics in the PBX.

This is the current implementation, but of course it could be changed so that OPTIONS traverse ITSBC as INVITEs do.

We may implement that way if we find time, on the meanwhile of course a PR is always welcome ;)

Regards,