diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-28 17:37:56 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-28 17:37:56 +0000 |
commit | 77be2d9b78060f758181a608029fba1b782fd44a (patch) | |
tree | 8d4c60d4b38470222d45faab0253b21508f6a10a /channels/chan_mgcp.c | |
parent | 320436acc4a3b4685570a96fc771979ebdc6c9d4 (diff) |
Merge in RTP-level packet bridging. Packet comes in, packet goes out - that's what RTP-level packet bridging is all about!
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41235 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_mgcp.c')
-rw-r--r-- | channels/chan_mgcp.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index 94cb20f02..c77b8a61e 100644 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -3876,13 +3876,19 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v) return (gw_reload ? NULL : gw); } -static struct ast_rtp *mgcp_get_rtp_peer(struct ast_channel *chan) +static enum ast_rtp_get_result mgcp_get_rtp_peer(struct ast_channel *chan, struct ast_rtp **rtp) { - struct mgcp_subchannel *sub; - sub = chan->tech_pvt; - if (sub && sub->rtp && sub->parent->canreinvite) - return sub->rtp; - return NULL; + struct mgcp_subchannel *sub = NULL; + + if (!(sub = chan->tech_pvt) || !(sub->rtp)) + return AST_RTP_GET_FAILED; + + *rtp = sub->rtp; + + if (sub->parent->canreinvite) + return AST_RTP_TRY_NATIVE; + else + return AST_RTP_TRY_PARTIAL; } static int mgcp_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs, int nat_active) |