<div dir="ltr"><div><div><div><div>Hi Peter,<br><br></div>I created simple config for freeswitch+kamailio set-up, where everything including registration is handled by Freeswitch(PBX) and you can try to use it, maybe this is what you need.<br><br><a href="https://github.com/os11k/dispatcher">https://github.com/os11k/dispatcher</a><br><br></div>I never tested in in prod, so use it on your own risk.<br><br></div>With kind regards,<br><br></div>Jurijs<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-12-17 17:36 GMT+02:00 Peter Gervai <span dir="ltr"><<a href="mailto:grinapo@gmail.com" target="_blank">grinapo@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I've been browsing the net and the (not so friendly) documentation but<br>
found no readily available solution.<br>
I have tried to fabricate on myself but it seems it's not that easy<br>
without getting deeply familarised with<br>
SIP protocol internals which I don't quite want know.<br>
<br>
The problem seems simple enough, maybe you can easily tell the solution.<br>
<br>
There is kamailio at ip 256.10.10.1. It's task is to accept<br>
connections from SIP clients<br>
and forward them to PBX at 256.20.20.1, and accept PBX packets and<br>
forward them to the<br>
clients.  PBX handles registration, options, invites, everything.<br>
Kamailio does not authenticate, authorise, just forwards everything<br>
back and forth, like a mindless proxy.<br>
No NAT involved.<br>
<br>
[The reason is that K. have to call external scripts whenever an<br>
outbound call (towards the clients) is<br>
initiated, which the PBX is unable to. Please don't advise other<br>
solutions (which isn't able to call executables<br>
in-session).]<br>
<br>
I have created a simplistic config which is not expected to work and<br>
it doesn't quite (plenty of security stuff left out now):<br>
<br>
route {<br>
 if(src_ip==myself) {<br>
   add_path();<br>
   $du="sip:256.20.20.1:95060";<br>
 } else {<br>
  if(src_ip!="256.20.20.1") {<br>
    $du="sip:256.20.20.1:95060";<br>
  } else { #from gateway pkts aren't changed<br>
  }<br>
<br>
  if(!t_relay()) {<br>
    sl_reply_error();<br>
    break;<br>
  }<br>
}<br>
<br>
<br>
There is several possible problems, but it seems Contact: is one main<br>
one since it contains the client instead of<br>
the proxy. Possibly this may even be the almost-good solution.<br>
<br>
I'm sure there's an easy and pretty solution so before I start to make<br>
ugly ones I ask the wise people.<br>
<br>
Thanks,<br>
Peter<br>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div><br></div>