[OpenSIPS-Devel] [opensips] Bogus output MI command for MI attr built on a static buffer (#243)

Ovidiu Sas notifications at github.com
Thu May 29 18:00:29 CEST 2014


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.

An example is depicted below, where socket is built in a static buffer (see socket_info.h:socket2str()).

The db content:
```
+----+-------+--------------------------------+------------------+-------+--------+-------+-------------+
| 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 |       |             |
+----+-------+--------------------------------+------------------+-------+--------+-------+-------------+
```

The MI output (see all sockets being identical):
```
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
```

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/243
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20140529/0b95892d/attachment.htm>


More information about the Devel mailing list