[Freeswitch-trunk] [commit] r12347 - freeswitch/trunk/src/mod/endpoints/mod_opal

FreeSWITCH SVN robertj at freeswitch.org
Sun Mar 1 19:19:57 PST 2009


Author: robertj
Date: Sun Mar  1 21:19:57 2009
New Revision: 12347

Log:
Added "jitter-size" to config file to set jitter buffer size.

Fixed transmission of Q.931 Calling-Party-Number, and DisplayName on H.323 Setup. Was previously being set on the wrong connection.

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp
   freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.h

Modified: freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp	Sun Mar  1 21:19:57 2009
@@ -323,8 +323,6 @@
     m_FreeSwitch->io_routines = &opalfs_io_routines;
     m_FreeSwitch->state_handler = &opalfs_event_handlers;
 
-    SetAudioJitterDelay(800, 3000); // should be config option
-
     silenceDetectParams.m_mode = OpalSilenceDetector::NoSilenceDetection;
 
     if (m_listeners.empty()) {
@@ -411,6 +409,15 @@
                     set_global_dialplan(val);
                 } else if (!strcasecmp(var, "codec-prefs")) {
                     set_global_codec_string(val);
+                } else if (!strcasecmp(var, "jitter-size")) {
+                    char * next;
+                    unsigned minJitter = strtoul(val, &next, 10);
+                    if (minJitter >= 10) {
+                        unsigned maxJitter = minJitter;
+                        if (*next == ',')
+                          maxJitter = atoi(next+1);
+                        SetAudioJitterDelay(minJitter, maxJitter); // In milliseconds
+                    }
                 }
             }
         }
@@ -455,6 +462,12 @@
 }
 
 
+OpalCall * FSManager::CreateCall(void * /*userData*/)
+{
+  return new FSCall(*this);
+}
+
+
 ///////////////////////////////////////////////////////////////////////
 
 FSEndPoint::FSEndPoint(FSManager & manager)
@@ -478,6 +491,32 @@
 
 ///////////////////////////////////////////////////////////////////////
 
+FSCall::FSCall(OpalManager & manager)
+  : OpalCall(manager)
+{
+}
+
+
+PBoolean FSCall::OnSetUp(OpalConnection & connection)
+{
+  // Transfer FS caller_id_number & caller_id_name from the FSConnection
+  // to the protocol connectionm (e.g. H.323) so gets sent correctly
+  // in outgoing packets
+  PSafePtr<FSConnection> local = GetConnectionAs<FSConnection>();
+  if (local != NULL) {
+    PSafePtr<OpalConnection> proto = local->GetOtherPartyConnection();
+    if (proto != NULL) {
+      proto->SetLocalPartyName(local->GetLocalPartyName());
+      proto->SetDisplayName(local->GetDisplayName());
+    }
+  }
+
+  return OpalCall::OnSetUp(connection);
+}
+
+
+///////////////////////////////////////////////////////////////////////
+
 
 FSConnection::FSConnection(OpalCall & call, FSEndPoint & endpoint, switch_caller_profile_t *outbound_profile)
   : OpalLocalConnection(call, endpoint, NULL)

Modified: freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.h
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.h	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.h	Sun Mar  1 21:19:57 2009
@@ -82,6 +82,14 @@
 };
 
 
+class FSCall : public OpalCall {
+    PCLASSINFO(FSCall, OpalCall);
+  public:
+    FSCall(OpalManager & manager);
+    virtual PBoolean OnSetUp(OpalConnection & connection);
+};
+
+
 class FSManager : public OpalManager {
     PCLASSINFO(FSManager, OpalManager);
 
@@ -96,6 +104,8 @@
         return m_FreeSwitch;
     }
 
+    virtual OpalCall * CreateCall(void * userData);
+
   private:
     switch_endpoint_interface_t *m_FreeSwitch;
 
@@ -106,6 +116,7 @@
     list < FSListener > m_listeners;
 };
 
+
 class FSConnection;
 typedef struct {
     switch_timer_t read_timer;



More information about the Freeswitch-trunk mailing list