Mon May 19 11:31:45 EDT 2008 Pekka.Pessi@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.



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8467 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2008-05-19 16:56:40 +00:00
parent c3c9a27413
commit 5e7e1b999d
2 changed files with 18 additions and 3 deletions

View File

@ -1 +1 @@
Mon May 19 12:55:48 EDT 2008
Mon May 19 12:56:22 EDT 2008

View File

@ -2541,8 +2541,9 @@ int nua_client_request_sendmsg(nua_client_request_t *cr, msg_t *msg, sip_t *sip)
/**
* 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 @@ int nua_client_request_sendmsg(nua_client_request_t *cr, msg_t *msg, sip_t *sip)
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