o Tom van der Geer [04/23/09 20:53]:
Hi Stefan & Juha,

I did some research and found that response codes 180 until 183 may include an SDP for early media. Although it's rare in the case of 181 and 182.

I think it's safe to check if there's a body in the reply and the response code is between 180 and 183 to relay the invite.
hm, I found the original patch a little too complicated (why not do the reinviteCaller where it is done for 200 reply? and probably also only if !sip_relay_only). What do you think about the attached one?

Stefan

--
Stefan Sayer
VoIP Services

[email protected]
www.iptego.com

IPTEGO GmbH
Wittenbergplatz 1
10789 Berlin
Germany

Amtsgericht Charlottenburg, HRB 101010
Geschaeftsfuehrer: Alexander Hoffmann
Index: AmB2BSession.h
===================================================================
--- AmB2BSession.h      (revision 1354)
+++ AmB2BSession.h      (working copy)
@@ -191,6 +191,12 @@
   virtual void createCalleeSession();
   void relayEvent(AmEvent* ev);
 
+  /** Tell if the session should
+   *  relay early media SDPs to
+   *  caller leg
+   */
+  bool sip_relay_early_media_sdp;
+
  public:
   AmB2BCallerSession();
   virtual ~AmB2BCallerSession();
@@ -215,6 +221,7 @@
 
   AmSipRequest* getInviteReq() { return &invite_req; }
 
+  void set_sip_relay_early_media_sdp(bool r);
 };
 
 /** \brief Callee leg of a B2B session */
Index: AmB2BSession.cpp
===================================================================
--- AmB2BSession.cpp    (revision 1354)
+++ AmB2BSession.cpp    (working copy)
@@ -236,7 +236,7 @@
 
 AmB2BCallerSession::AmB2BCallerSession()
   : AmB2BSession(),
-    callee_status(None)
+    callee_status(None), sip_relay_early_media_sdp(false)
 {
 }
 
@@ -244,6 +244,11 @@
 {
 }
 
+void AmB2BCallerSession::set_sip_relay_early_media_sdp(bool r)
+{
+  sip_relay_early_media_sdp = r; 
+}
+
 void AmB2BCallerSession::terminateLeg()
 {
   AmB2BSession::terminateLeg();
@@ -275,6 +280,10 @@
     case Ringing:
        
       if(reply.code < 200){
+       if ((!sip_relay_only) && sip_relay_early_media_sdp && 
+           reply.code>=180 && reply.code<=183 && (!reply.body.empty())) {
+         reinviteCaller(reply);
+       }
          
        callee_status = Ringing;
       }
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems

Reply via email to