summaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmgcp/mgcp_osmux.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/libmgcp/mgcp_osmux.c')
-rw-r--r--openbsc/src/libmgcp/mgcp_osmux.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/openbsc/src/libmgcp/mgcp_osmux.c
index 69f1c66b5..0a4441c61 100644
--- a/openbsc/src/libmgcp/mgcp_osmux.c
+++ b/openbsc/src/libmgcp/mgcp_osmux.c
@@ -447,10 +447,6 @@ int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint
return -1;
}
- osmux_xfrm_output_init(&endp->osmux.out,
- (endp->osmux.cid * rtp_ssrc_winlen) +
- (random() % rtp_ssrc_winlen));
-
endp->osmux.in = osmux_handle_lookup(endp->cfg, addr, port);
if (!endp->osmux.in) {
LOGP(DMGCP, LOGL_ERROR, "Cannot allocate input osmux handle\n");
@@ -463,6 +459,10 @@ int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint
return -1;
}
+ osmux_xfrm_output_init(&endp->osmux.out,
+ (endp->osmux.cid * rtp_ssrc_winlen) +
+ (random() % rtp_ssrc_winlen));
+
switch (endp->cfg->role) {
case MGCP_BSC_NAT:
endp->type = MGCP_OSMUX_BSC_NAT;