Hi,

I noticed, that SEMS from the offer-answer branch does not currently
indicate support for the telephone-event payload type in SDP offers
or answers. The attached patch fixes this behaviour: the telephone-event
payload type is special-cased like in the pre-offer-answer versions of
SEMS. Can I apply this patch somewhere?

Regards,
Emil

-- 
Emil Kroymann
VoIP Services Engineer

Email: [email protected]
Tel: +49-30-203899885
Mobile: +49-176-38389303

ISACO GmbH
Kurfürstenstraße 79
10787 Berlin
Germany

Amtsgericht Charlottenburg, HRB 112464B
Geschäftsführer: Daniel Frommherz

diff --git a/core/AmRtpStream.cpp b/core/AmRtpStream.cpp
index a8c64e2..ee3587f 100644
--- a/core/AmRtpStream.cpp
+++ b/core/AmRtpStream.cpp
@@ -575,6 +575,11 @@ int AmRtpStream::init(AmPayloadProviderInterface* payload_provider,
 
     amci_payload_t* a_pl = payload_provider->payload(sdp_it->payload_type);
     if(a_pl == NULL){
+	  if (sdp_it->encoding_name=="telephone-event" && sdp_it->clock_rate==8000) {
+		payloads.resize(payloads.size()-1);
+		++sdp_it;
+		continue;
+	  }
       ERROR("No internal payload corresponding to type %i\n",
 	    sdp_it->payload_type);
       return -1;//TODO
diff --git a/core/AmSession.cpp b/core/AmSession.cpp
index c764e7c..2a87c46 100644
--- a/core/AmSession.cpp
+++ b/core/AmSession.cpp
@@ -944,6 +944,14 @@ bool AmSession::getSdpOffer(AmSdp& offer)
 
   getPayloadProvider()->getPayloads(offer_media.payloads);
 
+  int pt = 0;
+  for (vector<SdpPayload>::iterator it = offer_media.payloads.begin(); it != offer_media.payloads.end(); it++) {
+	if (pt < it->payload_type)
+	  pt = it->payload_type;
+  }
+  pt++;
+
+  offer_media.payloads.push_back(SdpPayload(pt,"telephone-event",8000,0));
   return true;
 }
 
@@ -977,8 +985,14 @@ bool AmSession::getSdpAnswer(const AmSdp& offer, AmSdp& answer)
 
   // Calculate the intersection with the offered set of payloads
 
+  std::auto_ptr<SdpPayload> tlepl(NULL);
+
   vector<SdpPayload>::const_iterator it = m_it->payloads.begin();
   for(; it!= m_it->payloads.end(); ++it) {
+	if (it->encoding_name == "telephone-event" && it->clock_rate == 8000) {
+	  tlepl.reset(new SdpPayload(it->payload_type, it->encoding_name, it->clock_rate, it->encoding_param));
+	}
+
     amci_payload_t* a_pl = NULL;
     if(it->payload_type < DYNAMIC_PAYLOAD_TYPE_START) {
       // try static payloads
@@ -1007,6 +1021,9 @@ bool AmSession::getSdpAnswer(const AmSdp& offer, AmSdp& answer)
     }
   }
 
+  if (tlepl.get() != NULL) {
+	answer_media.payloads.push_back(*tlepl);
+  }
   return true;
 }
 

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to