<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Thanks Juha,<div><br></div><div>We will do this after some holidays.</div><div><br></div><div>Adrian</div><div><br></div><div><div><div>On 02 Nov 2014, at 10:10, Juha Heinanen <<a href="mailto:jh@tutpro.com">jh@tutpro.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">enclosed find 'darcs diff' patches of the media_ip feature for easy<br>merging to latest darcs versions of python-sipsimple and sylkserver.<br><br>for some reason, i was not able to create a new tracker issue on this. i<br>logged in, but didn't find a 'new issue' button.<br><br>i would appreciate if these could be merged to darcs archives.<br><br>-- juha<br><br>diff -rN -u old-python-sipsimple/sipsimple/account/__init__.py new-python-sipsimple/sipsimple/account/__init__.py<br>--- old-python-sipsimple/sipsimple/account/__init__.py<span class="Apple-tab-span" style="white-space:pre">       </span>2014-11-02 13:52:38.276370538 +0200<br>+++ new-python-sipsimple/sipsimple/account/__init__.py<span class="Apple-tab-span" style="white-space:pre"> </span>2014-11-02 13:52:39.512376672 +0200<br>@@ -29,7 +29,7 @@<br> from sipsimple.account.xcap import XCAPManager<br> from sipsimple.core import Credentials, SIPURI, ContactURIFactory<br> from sipsimple.configuration import ConfigurationManager, Setting, SettingsGroup, SettingsObject, SettingsObjectID<br>-from sipsimple.configuration.datatypes import AudioCodecList, MSRPConnectionModel, MSRPRelayAddress, MSRPTransport, NonNegativeInteger, Path, SIPAddress, SIPProxyAddress, SRTPEncryption, STUNServerAddressList, VideoCodecList, XCAPRoot<br>+from sipsimple.configuration.datatypes import AudioCodecList, MSRPConnectionModel, MSRPRelayAddress, MSRPTransport, NonNegativeInteger, Path, SIPAddress, SIPProxyAddress, SRTPEncryption, STUNServerAddressList, VideoCodecList, XCAPRoot, IPAddress<br> from sipsimple.configuration.settings import SIPSimpleSettings<br> from sipsimple.payloads import ParserError<br> from sipsimple.payloads.messagesummary import MessageSummary<br>@@ -61,6 +61,7 @@<br>     video_codec_list = Setting(type=VideoCodecList, default=None, nillable=True)<br>     srtp_encryption = Setting(type=SRTPEncryption, default='disabled')<br>     use_srtp_without_tls = Setting(type=bool, default=False)<br>+    media_ip = Setting(type=IPAddress, default=None, nillable=True)<br><br><br> class NATTraversalSettings(SettingsGroup):<br>diff -rN -u old-python-sipsimple/sipsimple/application.py new-python-sipsimple/sipsimple/application.py<br>--- old-python-sipsimple/sipsimple/application.py<span class="Apple-tab-span" style="white-space:pre">      </span>2014-11-02 13:52:38.320370757 +0200<br>+++ new-python-sipsimple/sipsimple/application.py<span class="Apple-tab-span" style="white-space:pre">      </span>2014-11-02 13:52:39.504376628 +0200<br>@@ -154,6 +154,7 @@<br>                        tls_privkey_file=None,<br>                        # rtp<br>                        rtp_port_range=(settings.rtp.port_range.start, settings.rtp.port_range.end),<br>+                       media_ip = settings.rtp.media_ip,<br>                        # audio<br>                        codecs=list(settings.rtp.audio_codec_list),<br>                        # video<br>diff -rN -u old-python-sipsimple/sipsimple/session.py new-python-sipsimple/sipsimple/session.py<br>--- old-python-sipsimple/sipsimple/session.py<span class="Apple-tab-span" style="white-space:pre">     </span>2014-11-02 13:52:38.516371728 +0200<br>+++ new-python-sipsimple/sipsimple/session.py<span class="Apple-tab-span" style="white-space:pre">  </span>2014-11-02 13:52:39.508376647 +0200<br>@@ -1008,9 +1008,11 @@<br>                     wait_count -= 1<br>             try:<br>                 contact_uri = self.account.contact[PublicGRUUIfAvailable, self.route]<br>-                local_ip = host.outgoing_ip_for(self.route.address)<br>-                if local_ip is None:<br>+                if settings.rtp.media_ip is None:<br>+                    local_ip = host.outgoing_ip_for(self.route.address)<br>                     raise ValueError("could not get outgoing IP address")<br>+                else:<br>+                    local_ip = str(settings.rtp.media_ip)<br>             except (KeyError, ValueError), e:<br>                 for stream in self.proposed_streams:<br>                     notification_center.remove_observer(self, sender=stream)<br>@@ -1276,7 +1278,10 @@<br><br>             remote_sdp = self._invitation.sdp.proposed_remote<br>             sdp_connection = remote_sdp.connection or (media.connection for media in remote_sdp.media if media.connection is not None).next()<br>-            local_ip = host.outgoing_ip_for(sdp_connection.address) if sdp_connection.address != '0.0.0.0' else sdp_connection.address<br>+            if settings.rtp.media_ip is None:<br>+                local_ip = host.outgoing_ip_for(sdp_connection.address) if sdp_connection.address != '0.0.0.0' else sdp_connection.address<br>+            else:<br>+                local_ip = str(settings.rtp.media_ip)<br>             if local_ip is None:<br>                 for stream in self.proposed_streams:<br>                     notification_center.remove_observer(self, sender=stream)<br>diff -rN -u old-sylkserver/sylk/configuration/__init__.py new-sylkserver/sylk/configuration/__init__.py<br>--- old-sylkserver/sylk/configuration/__init__.py<span class="Apple-tab-span" style="white-space:pre">   </span>2014-11-02 14:03:30.611605295 +0200<br>+++ new-sylkserver/sylk/configuration/__init__.py<span class="Apple-tab-span" style="white-space:pre">      </span>2014-11-02 14:03:59.743749755 +0200<br>@@ -59,6 +59,7 @@<br>     srtp_encryption = ConfigSetting(type=SRTPEncryption, value='optional')<br>     timeout = ConfigSetting(type=NonNegativeInteger, value=30)<br>     sample_rate = ConfigSetting(type=SampleRate, value=32000)<br>+    media_ip = ConfigSetting(type=IPAddress, value=None)<br><br><br> class ThorNodeConfig(ConfigSection):<br>diff -rN -u old-sylkserver/sylk/configuration/settings.py new-sylkserver/sylk/configuration/settings.py<br>--- old-sylkserver/sylk/configuration/settings.py<span class="Apple-tab-span" style="white-space:pre">   </span>2014-11-02 14:03:30.615605311 +0200<br>+++ new-sylkserver/sylk/configuration/settings.py<span class="Apple-tab-span" style="white-space:pre">      </span>2014-11-02 14:03:59.743749755 +0200<br>@@ -15,7 +15,7 @@<br><br> from sylk import __version__ as server_version<br> from sylk.configuration import ServerConfig, SIPConfig, MSRPConfig, RTPConfig<br>-from sylk.configuration.datatypes import AudioCodecs, NillablePath, Path, Port, SIPProxyAddress<br>+from sylk.configuration.datatypes import AudioCodecs, NillablePath, Path, Port, SIPProxyAddress, IPAddress<br><br><br> # Account settings extensions<br>@@ -34,6 +34,7 @@<br>     audio_codec_list = Setting(type=AudioCodecs, default=None, nillable=True)<br>     srtp_encryption = Setting(type=SRTPEncryption, default=RTPConfig.srtp_encryption)<br>     use_srtp_without_tls = Setting(type=bool, default=True)<br>+    media_ip = Setting(type=IPAddress, default=RTPConfig.media_ip, nillable=True)<br><br><br> class AccountSIPSettingsExtension(AccountSIPSettings):<br>@@ -85,6 +86,7 @@<br>     audio_codec_list = Setting(type=AudioCodecs, default=RTPConfig.audio_codecs)<br>     port_range = Setting(type=PortRange, default=PortRange(RTPConfig.port_range.start, RTPConfig.port_range.end))<br>     timeout = Setting(type=NonNegativeInteger, default=RTPConfig.timeout)<br>+    media_ip = Setting(type=IPAddress, default=RTPConfig.media_ip, nillable=True)<br><br><br> def sip_port_validator(port, sibling_port):<br>diff -rN -u old-sylkserver/sylk/server.py new-sylkserver/sylk/server.py<br>--- old-sylkserver/sylk/server.py<span class="Apple-tab-span" style="white-space:pre">        </span>2014-11-02 14:03:30.623605360 +0200<br>+++ new-sylkserver/sylk/server.py<span class="Apple-tab-span" style="white-space:pre">      </span>2014-11-02 14:03:59.679749442 +0200<br>@@ -25,7 +25,7 @@<br> import sylk.extensions<br><br> from sylk.applications import IncomingRequestHandler<br>-from sylk.configuration import ServerConfig, SIPConfig, ThorNodeConfig<br>+from sylk.configuration import ServerConfig, SIPConfig, RTPConfig, ThorNodeConfig<br> from sylk.configuration.settings import AccountExtension, BonjourAccountExtension, SylkServerSettingsExtension<br> from sylk.log import Logger<br> from sylk.session import SessionManager<br>@@ -112,6 +112,7 @@<br>                        tls_privkey_file=None,<br>                        # rtp<br>                        rtp_port_range=(settings.rtp.port_range.start, settings.rtp.port_range.end),<br>+                       media_ip=settings.rtp.media_ip,<br>                        # audio<br>                        codecs=list(settings.rtp.audio_codec_list),<br>                        # logging<br>@@ -226,12 +227,14 @@<br>     def _NH_SIPApplicationDidStart(self, notification):<br>         settings = SIPSimpleSettings()<br>         local_ip = SIPConfig.local_ip<br>+        media_ip = RTPConfig.media_ip<br>         log.msg("SylkServer started, listening on:")<br>         for transport in settings.sip.transport_list:<br>             try:<br>                 log.msg("%s:%d (%s)" % (local_ip, getattr(self.engine, '%s_port' % transport), transport.upper()))<br>             except TypeError:<br>                 pass<br>+        log.msg("Media IP: %s" % media_ip)<br><br>     def _NH_SIPApplicationWillEnd(self, notification):<br>         log.msg('SIP application will end: %s' % self.end_reason)<br>_______________________________________________<br>SIPBeyondVoIP mailing list<br><a href="mailto:SIPBeyondVoIP@lists.ag-projects.com">SIPBeyondVoIP@lists.ag-projects.com</a><br>http://lists.ag-projects.com/mailman/listinfo/sipbeyondvoip<br></blockquote></div><br><div>
<div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">--<br>Adrian<br><br><br></div>

</div>
<br></div></body></html>