From 370d0ff8b0514d26951fde3ff12ab6e4df72be17 Mon Sep 17 00:00:00 2001
From: Simon Morlat <simon.morlat@linphone.org>
Date: Wed, 25 Aug 2010 14:26:23 +0200
Subject: [PATCH] workaround for stupid phone using "G729A" submime type.

---
 coreapi/offeranswer.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/coreapi/offeranswer.c b/coreapi/offeranswer.c
index efd44552de..22901242aa 100644
--- a/coreapi/offeranswer.c
+++ b/coreapi/offeranswer.c
@@ -29,7 +29,10 @@ static PayloadType * find_payload_type_best_match(const MSList *l, const Payload
 
 	for (elem=l;elem!=NULL;elem=elem->next){
 		pt=(PayloadType*)elem->data;
-		if (strcasecmp(pt->mime_type,refpt->mime_type)==0 && pt->clock_rate==refpt->clock_rate){
+		/* the compare between G729 and G729A is for some stupid uncompliant phone*/
+		if (strcasecmp(pt->mime_type,refpt->mime_type)==0  ||
+		    ((strcasecmp(pt->mime_type, "G729") == 0 && strcasecmp(refpt->mime_type, "G729A") == 0 ))
+			&& pt->clock_rate==refpt->clock_rate){
 			candidate=pt;
 			/*good candidate, check fmtp for H264 */
 			if (strcasecmp(pt->mime_type,"H264")==0){
-- 
GitLab