[asterisk-dev] Correct IAX2 VNAK behavior (IAX2 draft discrepancy)

Mihai Balea mihai at hates.ms
Tue Apr 3 12:53:10 MST 2007


Hi all,

I'm trying to add proper VNAK support to iaxclient (http:// 
sourceforge.net/projects/iaxclient) and I am seeing conflicting  
information... on one hand, the latest iax2 draft states:

"On receipt of a VNAK, a peer MUST retransmit all frames with a  
higher sequence number than the VNAK message's iseqno." (draft-guy- 
iax-02.txt, paragraph 6.11.3)

On the other hand, the relevant chan_iax2.c code looks like this:

static void vnak_retransmit(int callno, int last)
{
	struct iax_frame *f;

	AST_LIST_LOCK(&iaxq.queue);
	AST_LIST_TRAVERSE(&iaxq.queue, f, list) {
		/* Send a copy immediately */
		if ((f->callno == callno) && iaxs[f->callno] &&
			(f->oseqno >= last)) {
			send_packet(f);
		}
	}
	AST_LIST_UNLOCK(&iaxq.queue);
}

... which basically means that frames higher OR EQUAL than iseqno are  
re-transmitted.

Can anybody shed some light on what is the correct behavior?

Also, I am not very familiar with chan_iax2.c, so maybe I'm missing  
something, but does this code take into account the possibility that  
sequence numbers are unsigned chars that wrap around? Doesn't seem so  
to me....

Thanks,
Mihai



More information about the asterisk-dev mailing list