|
|
@ -12931,21 +12931,25 @@ static struct ast_rtp *sip_get_vrtp_peer(struct ast_channel *chan)
|
|
|
|
static int sip_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs, int nat_active)
|
|
|
|
static int sip_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs, int nat_active)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct sip_pvt *p;
|
|
|
|
struct sip_pvt *p;
|
|
|
|
|
|
|
|
int changed = 0;
|
|
|
|
|
|
|
|
|
|
|
|
p = chan->tech_pvt;
|
|
|
|
p = chan->tech_pvt;
|
|
|
|
if (!p)
|
|
|
|
if (!p)
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
ast_mutex_lock(&p->lock);
|
|
|
|
ast_mutex_lock(&p->lock);
|
|
|
|
if (rtp)
|
|
|
|
if (rtp)
|
|
|
|
ast_rtp_get_peer(rtp, &p->redirip);
|
|
|
|
changed |= ast_rtp_get_peer(rtp, &p->redirip);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
memset(&p->redirip, 0, sizeof(p->redirip));
|
|
|
|
memset(&p->redirip, 0, sizeof(p->redirip));
|
|
|
|
if (vrtp)
|
|
|
|
if (vrtp)
|
|
|
|
ast_rtp_get_peer(vrtp, &p->vredirip);
|
|
|
|
changed |= ast_rtp_get_peer(vrtp, &p->vredirip);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
memset(&p->vredirip, 0, sizeof(p->vredirip));
|
|
|
|
memset(&p->vredirip, 0, sizeof(p->vredirip));
|
|
|
|
p->redircodecs = codecs;
|
|
|
|
if (codecs && (p->redircodecs != codecs)) {
|
|
|
|
if (codecs && !ast_test_flag(p, SIP_GOTREFER)) {
|
|
|
|
p->redircodecs = codecs;
|
|
|
|
|
|
|
|
changed = 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (changed && !ast_test_flag(p, SIP_GOTREFER)) {
|
|
|
|
if (!p->pendinginvite) {
|
|
|
|
if (!p->pendinginvite) {
|
|
|
|
if (option_debug > 2) {
|
|
|
|
if (option_debug > 2) {
|
|
|
|
char iabuf[INET_ADDRSTRLEN];
|
|
|
|
char iabuf[INET_ADDRSTRLEN];
|
|
|
|