<div dir="auto"><div>Hi Michael,</div><div dir="auto"><br></div><div dir="auto">the mostly used model AFAIK is dispatcher cos you can define groups (also with only one member). That's more flexible if you scale up the backend services. </div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Also an docker newbie the macvlan driver gives you native ip access within the container. </div><div dir="auto"><br></div><div dir="auto">The socket error message shows up an socket in Kamailio config like listen directive that is not available but the config generates an request for that. </div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">can't fwd to af 2, proto 1  (no corresponding listening socket)<br><br>Did you switch protocols from udp to tcp or vice versa? Then you need also udp AND tcp enabled in Kamailio. </div><div dir="auto"><br></div><div dir="auto">Cheers </div><div dir="auto">Karsten Horsmann </div><div dir="auto"><br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">Michael Iedema <<a href="mailto:michael@kapsulate.com" target="_blank" rel="noreferrer">michael@kapsulate.com</a>> schrieb am Di., 19. Nov. 2019, 10:30:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I am trying to place Kamailio between several SIP services which are differentiated by port and by the type of message they handle. To be concrete, here are the services:<br>
<br>
Originator:<br>
 - reachable on port 5060<br>
 - originates all traffic to the services<br>
<br>
Service A:<br>
 - reachable on port 5061<br>
 - handles REGISTER<br>
<br>
Service B:<br>
 - reachable on port 5062<br>
 - handles INVITE<br>
<br>
Service C:<br>
 - reachable on port 5063<br>
 - handles MESSAGE<br>
<br>
The services, originator and Kamailio instance may all be run on the same IP or may be split onto different addresses. Previously, the originator needed to know the address and port of each service. Now I want to make Kamailio responsible for that task so it can be done more intelligently.<br>
<br>
To start though I simply want to get traffic flowing between the services and this is where I’m struggling to climb the learning curve. In my test setup the originator and all services are on the same IP with only Kamailio running on a different IP.<br>
<br>
Address 1            Address 2<br>
========================<br>
Originator  <-->  Kamailio:6060<br>
                               |<br>
                               |<br>
Service A  <-------> |<br>
Service B  <-------> |<br>
Service C  <-------> |<br>
<br>
<br>
My first attempt at the logic looks like this:<br>
<br>
# HOST DEFINITIONS<br>
#!substdef "/HOST_ORIGINATOR/<a href="http://192.168.86.110/" rel="noreferrer noreferrer noreferrer" target="_blank">192.168.86.110/</a>"<br>
#!substdef "/HOST_REGISTER/<a href="http://192.168.86.110/" rel="noreferrer noreferrer noreferrer" target="_blank">192.168.86.110/</a>“<br>
#!substdef "/HOST_INVITE/<a href="http://192.168.86.110/" rel="noreferrer noreferrer noreferrer" target="_blank">192.168.86.110/</a>"<br>
#!substdef "/HOST_MESSAGE/<a href="http://192.168.86.110/" rel="noreferrer noreferrer noreferrer" target="_blank">192.168.86.110/</a>"<br>
<br>
# PORT DEFINITIONS<br>
#!substdef “/PORT_ORIGINATOR/5060/"<br>
#!substdef "/PORT_REGISTER/5061/“<br>
#!substdef "/PORT_INVITE/5062/"<br>
#!substdef "/PORT_MESSAGE/5063/"<br>
<br>
# ROUTE LOGIC<br>
route {<br>
<br>
  # ORIGINATOR sent us something<br>
  if ( $(ct{nameaddr.uri}{uri.port}) == HOST_ORIGINATOR ) {<br>
<br>
    xlog("L_INFO", "ORIGINATOR: sent $rm\n”);<br>
<br>
    if (is_method("REGISTER")) {<br>
      $du = "sip: HOST_REGISTER:PORT_REGISTER";<br>
      xlog("L_INFO", "ORIGINATOR -> REGISTER: Destination URI is now $du\n");<br>
      t_relay();<br>
      exit;<br>
    }<br>
  }<br>
…<br>
<br>
#### END SNIPPET ####<br>
<br>
<br>
My very newbie questions are:<br>
 - Am I even on the right track here? I understand that t_relay() establishes a stateful dialog handler between the originator and register services.<br>
 - Can I accomplish this bi-directional path statelessly with forward()?<br>
 - Do I need to add logic to handle the messages from the REGISTER service back to ORIGINATOR?<br>
<br>
This config currently fails because of "no corresponding socket found” when the relay triggers. I believe this is because I’m running the Kamailio instance in a Docker container so my first step today is to set up a native install.<br>
<br>
I also looked at the dispatcher module which seems very close to what I want to do. Maybe that’s a more natural way to go?<br>
<br>
<br>
<br>
Anyway, apologies for the lengthy explanation. I hope it is at least clear what I intend to do. I will gladly research and do trial and error to solve this but need to know I’m going down roughly the right path. I’m not sure what I should even be googling even of the time :-)<br>
<br>
<br>
Thanks as always for your time and the great software!<br>
<br>
Regards,<br>
-Michael<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" rel="noreferrer noreferrer" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer noreferrer noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div></div></div>