<p>Hi!</p>
<p>I am using FreeSwitch as sipPbx and Opensbc as sip proxy in some prototype, I want to register my FreeSwitch with my sip provider (that is gafachi) and request should go viya SipProxy(Opensbc). </p>
<p>My freeswitch settings are:</p>
<p><gateways><br> <gateway name="gatway ip"><br> /// account username *required* ///<br> <param name="username" value="username"/><br> /// auth realm: *optional* same as gateway name, if blank ///
<br> <!--<param name="realm" value="gafachi"/>--><br> <param name="realm" value="gafachi"/><br> /// account password *required* ///
<br> <param name="password" value="password"/><br> /// extension for inbound calls: *optional* same as username, if blank ///<br> <param name="extension" value="username"/>
<br> /// proxy host: *optional* same as realm, if blank ///<br> <param name="proxy" value="sip proxy ip"/></p>
<p> /// expire in seconds: *optional* 3600, if blank ///<br> <param name="expire-seconds" value="600"/><br> </gateway><br> </gateways></p>
<p><br>As we know realm is the Ip address that goes with username and make request for example username is guest and realm <br>name is gafachi request will be <a href="mailto:guest@gafachi">guest@gafachi</a> and proxy is the ip address of sip proxy.
<br>When we set Geteway setting in freeswitch configuration file "freeswitch.xml"</p>
<p>We gave realm as gafachi ip address and proxy as opensbc machine address .</p>
<p>According to this, register request should to gafachi viya sip-proxy, but when we see this wireshark it add proxy ipaddress in register request instead of realm in sip message. As:</p>
<p>To:<<a href="mailto:sip:a2541shRzJKLjtQA@192.168.96.113">sip:a2541shRzJKLjtQA@192.168.96.113</a>></p>
<p><br>So I debugged the source code of FreeSwitch and changed the code in :</p>
<p>mod_sofia.c and in config sofia() and chage as :</p>
<p>gateway->register_to = switch_core_sprintf(gateway->pool, "sip:%s@%s", username, proxy); </p>
<p>To<br>gateway->register_to = switch_core_sprintf(gateway->pool, "sip:%s@%s", username, realm); </p>
<p> </p>
<p>and its working fine and request go through proxy and secrate code captured by OpenSbc.</p>
<p> <br>Buit i think it is wrong to edit source code:</p>
<p>when I used Asterisk and give register request in sip.conf (Asterisk conf file) like</p>
<p>register=>username@gafachi:password:username@opensbcip and everything seems working fine. </p>
<p>Also In this case it sends REGISTER sip:opensbcip (request uri) and <a href="mailto:username@opensbcip(To">username@opensbcip(To</a> uri) so in this case opensbc takes it as it is going to register with opensbc and doesn't forward the request to gafachi.
</p>
<p><br>I'll be thankful for any guidance on what's going wrong or should I set something else somewhere.<br> <br>Thanks in Advance!<br> <br>Regards,<br>Yogesh</p>