2
votes

I'm using opensips as a transparent proxy server. Original flow of messages is following

Client -------> OpenSips (Invite request)
OpenSips ------------> FS (Invite to Freeswitch)
FS -------------> Opensips (Reply from FreeSwitch)
Opensips ------------------> Client (Reply back to Client)

I'm using dialog module to save dialog state and topological_hiding module to change contact header. It's working fine until FreeSwitch send BYE message. On Freeswitch BYE, opensips generate 404 not here response.

According to configuration of opensips loose_route() return false. Opensips never send BYE to client.

Note: BYE message has same dialog as Invite request.

1

1 Answers

0
votes

When using topology_hiding(), you must match sequential requests using topology_hiding_match(), rather than loose_route(). So if you're doing something like this:

if (has_totag()) {
    if (!loose_route()) {
        xlog("cannot match request to a dialog\n");
        send_reply("404", "Not found");
    }
    route(RELAY);
}

you should change it to:

if (has_totag()) {
    if (!topology_hiding_match()) {
        xlog("cannot match request to a dialog\n");
        send_reply("404", "Not found");
    }
    route(RELAY);
}