diff --git a/daemon/main.c b/daemon/main.c index 898724fd9..1fe10c978 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -445,10 +445,10 @@ static void do_transcode_config(const char *name, charp_ht ht, struct transcode_ die("Failed to parse transform endpoint '%s' in transcode config '%s'", tfm, name); char *iface = t_hash_table_lookup(ht, "local-interface"); if (iface) - tc->local_interface = STR(iface); + tc->local_interface = str_dup_str(STR_PTR(iface)); iface = t_hash_table_lookup(ht, "remote-interface"); if (iface) - tc->remote_interface = STR(iface); + tc->remote_interface = str_dup_str(STR_PTR(iface)); return; } else diff --git a/t/auto-daemon-tests-transcode-config.pl b/t/auto-daemon-tests-transcode-config.pl index 56499c88d..89a5b3d66 100755 --- a/t/auto-daemon-tests-transcode-config.pl +++ b/t/auto-daemon-tests-transcode-config.pl @@ -167,7 +167,7 @@ SDP rcv_no($sock_sig); $NGCP::Rtpengine::req_cb = sub { - ($port_sig, $addr_sig, $cookie, $port_tc) = rcv($sock_sig, -1, qr/^(.{16}) d7:command9:transform5:mediald4:type5:audio5:codecld5:inputd5:codec4:PCMA12:payload typei8e10:clock ratei8000e8:channelsi1e6:format0:7:options0:e6:outputd5:codec4:PCMU12:payload typei0e10:clock ratei8000e8:channelsi1e6:format0:7:options0:eee11:destinationd6:family3:IP47:address11:203.0.113.14:porti(\d{5})eeee8:instance12:.{12}e$/); + ($port_sig, $addr_sig, $cookie, $port_tc) = rcv($sock_sig, -1, qr/^(.{16}) d7:command9:transform5:mediald4:type5:audio5:codecld5:inputd5:codec4:PCMA12:payload typei8e10:clock ratei8000e8:channelsi1e6:format0:7:options0:e6:outputd5:codec4:PCMU12:payload typei0e10:clock ratei8000e8:channelsi1e6:format0:7:options0:eee11:destinationd6:family3:IP47:address11:203.0.113.14:porti(\d{5})eeee9:interface7:default8:instance12:.{12}e$/); snd($sock_sig, $port_sig, $cookie . ' ' . Bencode::bencode( { result => 'ok', 'call-id' => 'foobar', @@ -249,7 +249,7 @@ $NGCP::Rtpengine::req_cb = undef; $NGCP::Rtpengine::req_cb = sub { - ($port_sig, $addr_sig, $cookie, $port_tc) = rcv($sock_sig, -1, qr/^(.{16}) d7:command9:transform5:mediald4:type5:audio5:codecld5:inputd5:codec4:PCMA12:payload typei8e10:clock ratei8000e8:channelsi1e6:format0:7:options0:e6:outputd5:codec4:PCMU12:payload typei0e10:clock ratei8000e8:channelsi1e6:format0:7:options0:eee11:destinationd6:family3:IP47:address11:203.0.113.14:porti(\d{5})eeee8:instance12:.{12}e$/); + ($port_sig, $addr_sig, $cookie, $port_tc) = rcv($sock_sig, -1, qr/^(.{16}) d7:command9:transform5:mediald4:type5:audio5:codecld5:inputd5:codec4:PCMA12:payload typei8e10:clock ratei8000e8:channelsi1e6:format0:7:options0:e6:outputd5:codec4:PCMU12:payload typei0e10:clock ratei8000e8:channelsi1e6:format0:7:options0:eee11:destinationd6:family3:IP47:address11:203.0.113.14:porti(\d{5})eeee9:interface7:default8:instance12:.{12}e$/); snd($sock_sig, $port_sig, $cookie . ' ' . Bencode::bencode( { result => 'ok', 'call-id' => 'foobar', diff --git a/t/test4.conf b/t/test4.conf index effeb527b..23710b312 100644 --- a/t/test4.conf +++ b/t/test4.conf @@ -27,8 +27,12 @@ address = 203.0.113.1 source = PCMA destination = PCMU transform = 203.0.113.42:3334 +local-interface = default +remote-interface = default [tc-PCMU-G722] source = PCMU destination = G722 transform = 203.0.113.42:3334 +local-interface = default +remote-interface = default