Hi Rafael,

attached is the same patch applied against master with
fixed indentation.

Regards,
Emil

Am Sun, 12 Jun 2011 08:33:07 +0200
schrieb Raphael Coeffic <[email protected]>:

> Thanks Emil for your patch! Unfortunately, it will take a little
> longer for me to review this patch thoroughly.
> I will commit the fix into the master branch ASAP.
> 
> Cheers
> Raphael.
> 
> On 08.06.11 13:40, Emil Kroymann wrote:
> > 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
> >
> >
> >
> > _______________________________________________
> > Semsdev mailing list
> > [email protected]
> > http://lists.iptel.org/mailman/listinfo/semsdev
> 



-- 
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 6707d7e..17621aa 100644
--- a/core/AmRtpStream.cpp
+++ b/core/AmRtpStream.cpp
@@ -578,6 +578,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 b42537c..81d0047 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