<p>If a static buffer is used to build an MI attr, the static buffer will be reused resulting in the last value being used for all MI nodes.</p>
<p>An example is depicted below, where socket is built in a static buffer (see socket_info.h:socket2str()).</p>
<p>The db content:</p>
<pre><code>+----+-------+--------------------------------+------------------+-------+--------+-------+-------------+
| id | setid | destination | socket | state | weight | attrs | description |
+----+-------+--------------------------------+------------------+-------+--------+-------+-------------+
| 1 | 1 | sip:192.168.0.40 | udp:192.168.0.66 | 0 | 1 | | |
| 2 | 2 | sip:192.168.0.40;transport=tcp | tcp:192.168.0.66 | 0 | 1 | | |
| 3 | 10 | sip:192.168.2.10:5080 | tcp:192.168.0.66 | 0 | 1 | | |
+----+-------+--------------------------------+------------------+-------+--------+-------+-------------+
</code></pre>
<p>The MI output (see all sockets being identical):</p>
<pre><code>SET:: 10
URI:: sip:192.168.2.10:5080 flag=A
socket:: udp:192.168.0.66:5060
SET:: 2
URI:: sip:192.168.0.40;transport=tcp flag=A
socket:: udp:192.168.0.66:5060
SET:: 1
URI:: sip:192.168.0.40 flag=A
socket:: udp:192.168.0.66:5060
</code></pre>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/issues/243">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/5479561__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxNjk5ODQyOSwiZGF0YSI6eyJpZCI6MzMzOTYxMTZ9fQ==--d23bec6c95978c3e72aa7d975c1e8bdbbbe323ba.gif" width="1" /></p>