[Asterisk-code-review] res rtp asterisk: Fix mapping of pjsip's ICE roles to ours (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Wed Jul 26 15:35:45 CDT 2017


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/6089 )

Change subject: res_rtp_asterisk: Fix mapping of pjsip's ICE roles to ours
......................................................................


Patch Set 6: Code-Review-1

(1 comment)

Just so you see the comment.

https://gerrit.asterisk.org/#/c/6089/6/res/res_rtp_asterisk.c
File res/res_rtp_asterisk.c:

https://gerrit.asterisk.org/#/c/6089/6/res/res_rtp_asterisk.c@702
PS6, Line 702: 	case PJ_ICE_SESS_ROLE_UNKNOWN:
             : 		/* Don't change anything */
             : 		return;
             : 	}
             : 
             : 	/* If we aren't explicitly handling something, it's a bug */
             : 	ast_assert(0);
The ast_assert should be in a default case.

Since the pj_role is a third-party (pjproject) defined enum, we'll get a compile error now if they add a new enum value.  However, if we fix that error by adding the new enum value then someone using an older version of the third-party library will get a compile error.

As an alternate, we could leave this as is and if a new enum value gets added we add the new enum value case in conditional code.  Conditional code can get messy if it happens too often.



-- 
To view, visit https://gerrit.asterisk.org/6089
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia578ede1a55b21014581793992a429441903278b
Gerrit-Change-Number: 6089
Gerrit-PatchSet: 6
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Wed, 26 Jul 2017 20:35:45 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170726/92935527/attachment.html>


More information about the asterisk-code-review mailing list