diff --git a/src/attribute.c b/src/attribute.c index 17a454c..4dd6241 100644 --- a/src/attribute.c +++ b/src/attribute.c @@ -289,6 +289,13 @@ attribute_getter_msg_time(G_GNUC_UNUSED Attribute *attr, Message *msg) return g_strdup(timeval_to_time(msg_get_time(msg), value)); } +static gchar * +attribute_getter_msg_transport(G_GNUC_UNUSED Attribute *attr, Message *msg) +{ + return g_strdup(packet_transport(msg->packet)); +} + + void attr_set_regex_pattern(Attribute *attr, gchar *pattern) { @@ -374,6 +381,7 @@ attribute_init() //! SIP Transport (SIP over TCP, UDP, WS, ...) attribute = attr_new("transport", "Trans", "Transport"); + attr_set_getter_func(attribute, attribute_getter_msg_transport); g_ptr_array_add(attributes, attribute); //! Owner call message count diff --git a/src/packet/packet.h b/src/packet/packet.h index f06884f..a31ec7c 100644 --- a/src/packet/packet.h +++ b/src/packet/packet.h @@ -116,6 +116,9 @@ packet_src_address(const Packet *packet); Address packet_dst_address(const Packet *packet); +const char * +packet_transport(Packet *packet); + /** * @brief Get The timestamp for a packet. */