Revision
14900
Author
robertj
Date
2009-09-17 08:48:38 -0500 (Thu, 17 Sep 2009)

Log Message

Added setting of outgoing number and display name from extension number so H.323/Q.931 fields are set correctly in ALERTING and CONNECT messages sent for incoming calls.

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp (14899 => 14900)


--- freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp	2009-09-17 11:23:29 UTC (rev 14899)
+++ freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp	2009-09-17 13:48:38 UTC (rev 14900)
@@ -983,6 +983,25 @@
     case SWITCH_MESSAGE_INDICATE_AUDIO_SYNC:
         switch_channel_set_private_flag(channel, CF_NEED_FLUSH);
         break;
+
+    case SWITCH_MESSAGE_INDICATE_RINGING:
+    case SWITCH_MESSAGE_INDICATE_PROGRESS:
+    case SWITCH_MESSAGE_INDICATE_ANSWER:
+        {
+            switch_caller_profile_t * profile = switch_channel_get_caller_profile(channel);
+            if (profile != NULL && profile->caller_extension != NULL)
+            {
+                PSafePtr<OpalConnection> other = GetOtherPartyConnection();
+                if (other != NULL) {
+                    other->SetLocalPartyName(profile->caller_extension->extension_number);
+                    other->SetDisplayName(profile->caller_extension->extension_name);
+                }
+                SetLocalPartyName(profile->caller_extension->extension_number);
+                SetDisplayName(profile->caller_extension->extension_name);
+            }
+        }
+        break;
+
     default:
         break;
     }