Howdy All,

I'm working on trying to output the channel related to an rtp stream. I found this line in ast_rtp_read()/res_rtp_asterisk.c and this pointed me to a starting position:

ast_verb(4, "%p -- Probation passed - setting RTP source address to %s\n", rtp, ast_sockaddr_stringify(&addr))

I figured to tried this:
{
  struct ast_channel *chan = ast_rtp_instance_get_chan(instance);
ast_verb(4, "<%s> %p -- Probation passed - setting RTP source address to %s\n", chan ? ast_channel_name(chan) : "NoChannel", rtp, ast_sockaddr_stringify(&addr));
}

Sometimes this works, and sometimes this doesn't and I'm not sure why.

If media is setup "slowly", i'll get this:
> [2015-10-30 10:58:04.855] > [C-00000000] <NoChannel> 0xb4a94618 -- Probation passed - setting RTP source address to 192.168.5.125:2222

It appears that if the media is setup "fast" I'll get this output:
> [2015-10-30 10:28:54.846] > [C-0000000a] <SIP/6850-00000013> 0x89ffda8 -- Probation passed - setting RTP source address to 192.168.5.123:2224 > [2015-10-30 10:28:54.846] > [C-0000000a] <SIP/6860-00000015> 0x89ec480 -- Probation passed - setting RTP source address to 192.168.5.129:2250

How can I reliably get the channel name here (or pick a better spot to get the channel name related to rtp ports)?


--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to