[SR-Users] SUBSCRIBE within

Daniel-Constantin Mierla miconda at gmail.com
Wed Jun 14 10:48:23 CEST 2017


Hello,


On 12.06.17 17:05, Annus Fictus wrote:
> Hello,
>
> I'm using Kamailio in a Multi Domain setting.
>
> I have a problem with SUBSCRIBE within a Dialog
>
> With the first subscribe no problem:
>
> SUBSCRIBE -> 407 Proxy Auth -> SUBSCRIBE -> 200 OK
>
> In the 200 OK the Contact header contain the Kamailio IP so when the
> Softphone send another SUBSCRIBE within the dialog (at the IP present
> on the contact header) Kamailio answer whit a 404 Not Here because I
> use these lines:
>
> if (is_method("SUBSCRIBE") && is_uri_host_local()) {
>               # in-dialog subscribe requests
>                 route(PRESENCE);
>                 exit;
>         }
>
> So, as the softphone send the new SUBSCRIBE to Kamailio IP and not the
> Kamailio domain, Kamailio not use this block but:
>
>         sl_send_reply("404","Not here");
>         exit;
> }
>
> My question is: Why Kamailio in the Contact Header  of 200 OK of
> SUBSCRIBE use the public IP and not the domain?
>
a dialog is typically established between two endpoints, which are
better identified by an IP address, behind a domain can be many ip
addresses, which can result on requests within dialog being routed to a
different server. If you have only one, set the server_address parameter
to presence module to what you want:

  -
https://www.kamailio.org/docs/modules/stable/modules/presence.html#presence.p.server_address

You can also change the condition so it uses (uri==myself ||
is_uri_host_local()).

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com




More information about the sr-users mailing list