Skip to content

Commit fd75152

Browse files
committed
Adjust to match latest restructuring in the RTP client code.
1 parent 3b17c50 commit fd75152

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

rtp_cluster.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import (
3838
"github.com/sippy/go-b2bua/sippy/cli"
3939
"github.com/sippy/go-b2bua/sippy/log"
4040
"github.com/sippy/go-b2bua/sippy/net"
41+
"github.com/sippy/go-b2bua/sippy/rtp_proxy"
4142
"github.com/sippy/go-b2bua/sippy/time"
4243
"github.com/sippy/go-b2bua/sippy/utils"
4344
)
@@ -52,11 +53,11 @@ type broadcaster struct {
5253
nparts int64
5354
results []string
5455
clim sippy_cli.CLIManagerIface
55-
cmd *sippy.Rtp_proxy_cmd
56-
sobj *sippy.Rtpp_stats
56+
cmd *rtp_proxy.Rtp_proxy_cmd
57+
sobj *rtp_proxy.Rtpp_stats
5758
}
5859

59-
func newBroadcaster(bcount int64, clim sippy_cli.CLIManagerIface, cmd *sippy.Rtp_proxy_cmd) *broadcaster {
60+
func newBroadcaster(bcount int64, clim sippy_cli.CLIManagerIface, cmd *rtp_proxy.Rtp_proxy_cmd) *broadcaster {
6061
return &broadcaster{
6162
results : make([]string, 1000),
6263
bcount : bcount,
@@ -356,7 +357,7 @@ func (self *rtp_cluster) up_command_udp(data []byte, address *sippy_net.HostPort
356357

357358
func (self *rtp_cluster) up_command(clim sippy_cli.CLIManagerIface, orig_cmd string) {
358359
var rtpp *rtp_cluster_member
359-
cmd, err := sippy.NewRtp_proxy_cmd(orig_cmd)
360+
cmd, err := rtp_proxy.NewRtp_proxy_cmd(orig_cmd)
360361
if err != nil {
361362
self.logger.Debugf("Rtp_cluster.up_command(): error parsing cmd '%s': %s", orig_cmd, err.Error())
362363
return
@@ -453,7 +454,7 @@ func (self *rtp_cluster) up_command(clim sippy_cli.CLIManagerIface, orig_cmd str
453454
for _, rtpp = range active {
454455
out_cmd_s := orig_cmd
455456
if (cmd.Type == 'U' || cmd.Type == 'L') && rtpp.lan_address != "" {
456-
out_cmd, err := sippy.NewRtp_proxy_cmd(orig_cmd)
457+
out_cmd, err := rtp_proxy.NewRtp_proxy_cmd(orig_cmd)
457458
if err != nil {
458459
self.logger.Errorf("Error parsing cmd '%s': %s: ", orig_cmd, err.Error())
459460
return
@@ -499,7 +500,7 @@ func (self *rtp_cluster) up_command(clim sippy_cli.CLIManagerIface, orig_cmd str
499500
}
500501
}
501502
br := newBroadcaster(int64(len(active)), clim, cmd)
502-
br.sobj = sippy.NewRtpp_stats(strings.Fields(cmd.Args))
503+
br.sobj = rtp_proxy.NewRtpp_stats(strings.Fields(cmd.Args))
503504
if cmd.CommandOpts != "" && strings.ToLower(cmd.CommandOpts) == "v" {
504505
cmd.CommandOpts = ""
505506
br.sobj.Verbose = true
@@ -516,7 +517,7 @@ func (self *rtp_cluster) up_command(clim sippy_cli.CLIManagerIface, orig_cmd str
516517
//print 'rtpp.send_command'
517518
var out_cmd string
518519
if (cmd.Type == 'U' || cmd.Type == 'L') && rtpp.lan_address != "" {
519-
cmd, err := sippy.NewRtp_proxy_cmd(orig_cmd)
520+
cmd, err := rtp_proxy.NewRtp_proxy_cmd(orig_cmd)
520521
if err != nil {
521522
self.logger.Errorf("Error parsing cmd '%s': %s: ", orig_cmd, err.Error())
522523
return
@@ -537,7 +538,7 @@ func (self *rtp_cluster) rCachePurge() {
537538
self.l1rcache = make(map[string]string)
538539
}
539540

540-
func (self *rtp_cluster) down_command(result string, clim sippy_cli.CLIManagerIface, cmd *sippy.Rtp_proxy_cmd, rtpp *rtp_cluster_member) {
541+
func (self *rtp_cluster) down_command(result string, clim sippy_cli.CLIManagerIface, cmd *rtp_proxy.Rtp_proxy_cmd, rtpp *rtp_cluster_member) {
541542
if udpclim, ok := clim.(*udpCLIM); ok {
542543
self.lock.Lock()
543544
if _, ok = self.commands_inflight[udpclim.cookie]; ok {
@@ -571,7 +572,7 @@ func (self *rtp_cluster) down_command(result string, clim sippy_cli.CLIManagerIf
571572
clim.Close()
572573
}
573574

574-
func (self *rtp_cluster) ignore_response(result string, clim sippy_cli.CLIManagerIface, cmd *sippy.Rtp_proxy_cmd, rtpp *rtp_cluster_member) {
575+
func (self *rtp_cluster) ignore_response(result string, clim sippy_cli.CLIManagerIface, cmd *rtp_proxy.Rtp_proxy_cmd, rtpp *rtp_cluster_member) {
575576
self.logger.Debugf("Got delayed response from node \"%s\" to already completed request, ignoring: \"%s\"", rtpp.name, result)
576577
}
577578

rtp_cluster_member.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import (
3636
"github.com/sippy/go-b2bua/sippy/log"
3737
"github.com/sippy/go-b2bua/sippy/math"
3838
"github.com/sippy/go-b2bua/sippy/net"
39+
"github.com/sippy/go-b2bua/sippy/rtp_proxy"
3940
)
4041

4142
type rtp_cluster_member_status int
@@ -71,7 +72,7 @@ func (self rtp_cluster_member_status) String() string {
7172
}
7273

7374
type rtp_cluster_member struct {
74-
sippy.Rtp_proxy_client_base
75+
rtp_proxy.Rtp_proxy_client_base
7576
name string
7677
status rtp_cluster_member_status
7778
capacity int
@@ -94,7 +95,7 @@ type rtp_cluster_member struct {
9495
func NewRtp_cluster_member(name string, global_config sippy_conf.Config, protocol, address string, cmd_out_address *sippy_net.HostPort) *rtp_cluster_member {
9596

9697
logger := global_config.ErrorLogger()
97-
opts, err := sippy.NewRtpProxyClientOpts(protocol + ":" + address, cmd_out_address, global_config, logger)
98+
opts, err := rtp_proxy.NewRtpProxyClientOpts(protocol + ":" + address, cmd_out_address, global_config, logger)
9899
if err != nil {
99100
println("Can't initialize rtpproxy client: " + err.Error())
100101
return nil
@@ -111,7 +112,7 @@ func NewRtp_cluster_member(name string, global_config sippy_conf.Config, protoco
111112
logger : logger,
112113
cmd_out_address : cmd_out_address,
113114
}
114-
super := sippy.NewRtp_proxy_client_base(self, opts)
115+
super := rtp_proxy.NewRtp_proxy_client_base(self, opts)
115116
self.Rtp_proxy_client_base = *super // this operation MUST be done before the call to Start()
116117
self.timer = sippy.NewInactiveTimeout(self.call_id_map_aging, /*sync.Locker*/nil, 600 * time.Second, -1, self.logger)
117118
self.timer.SpreadRuns(0.1)

0 commit comments

Comments
 (0)