[Freeswitch-svn] [commit] r8467 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua

Freeswitch SVN mikej at freeswitch.org
Mon May 19 12:56:40 EDT 2008


Author: mikej
Date: Mon May 19 12:56:40 2008
New Revision: 8467

Modified:
   freeswitch/trunk/libs/sofia-sip/.update
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c

Log:
Mon May 19 11:31:45 EDT 2008  Pekka.Pessi at nokia.com
  * nua_stack.c: include Allow-Events in requests initiating dialog, too
    
  The Allow-Events header is now alwats included with NOTIFY requests, and
  initial INVITE, SUBSCRIBE, REFER, and OPTIONS requests.
  
  Thanks to Jerry Richards for pointing out the problem.



Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update	(original)
+++ freeswitch/trunk/libs/sofia-sip/.update	Mon May 19 12:56:40 2008
@@ -1 +1 @@
-Mon May 19 12:55:48 EDT 2008
+Mon May 19 12:56:22 EDT 2008

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c	Mon May 19 12:56:40 2008
@@ -2541,8 +2541,9 @@
 
   /**
    * Next, values previously set with nua_set_params() or nua_set_hparams()
-   * are used: @Allow, @Supported, @Organization, and @UserAgent headers are
-   * added to the request if they are not already set. 
+   * are used: @Allow, @Supported, @Organization, @UserAgent and
+   * @AllowEvents headers are added to the request if they are not already
+   * set.
    */
   if (!sip->sip_allow)
     sip_add_dup(msg, sip, (sip_header_t*)NH_PGET(nh, allow));
@@ -2561,6 +2562,20 @@
   if (!sip->sip_user_agent && NH_PGET(nh, user_agent))
     sip_add_make(msg, sip, sip_user_agent_class, NH_PGET(nh, user_agent));
 
+  /** Any node implementing one or more event packages SHOULD include an
+   * appropriate @AllowEvents header indicating all supported events in
+   * all methods which initiate dialogs and their responses (such as
+   * INVITE) and OPTIONS responses.
+   */
+  if (!sip->sip_allow_events &&
+      NH_PGET(nh, allow_events) &&
+      (method == sip_method_notify || /* Always in NOTIFY */
+       (!ds->ds_remote_tag &&	      /* And in initial requests */
+	(method == sip_method_subscribe || method == sip_method_refer ||
+	 method == sip_method_options ||
+	 method == sip_method_invite))))
+    sip_add_dup(msg, sip, (void *)NH_PGET(nh, allow_events));
+
   /**
    * Next, the stack generates a @Contact header for the request (unless
    * the application already gave a @Contact header or it does not want to



More information about the Freeswitch-svn mailing list