From 74844e0448889d4a5a4cc06de26f8895a78e8ea3 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 27 May 2013 12:24:16 +0200 Subject: [PATCH] add alias parameter in via for Registers add declarations for new SUBSCRIBE/NOTIFY/PUBLISH api --- coreapi/bellesip_sal/sal_op_impl.c | 6 ++ coreapi/event.h | 125 +++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 coreapi/event.h diff --git a/coreapi/bellesip_sal/sal_op_impl.c b/coreapi/bellesip_sal/sal_op_impl.c index 7e24389fb..78957f2af 100644 --- a/coreapi/bellesip_sal/sal_op_impl.c +++ b/coreapi/bellesip_sal/sal_op_impl.c @@ -207,6 +207,12 @@ static int _sal_op_send_request_with_contact(SalOp* op, belle_sip_request_t* req } belle_sip_uri_fix(next_hop_uri); } + if (strcmp(belle_sip_request_get_method(request),"REGISTER")==0 && transport && + (strcasecmp(transport,"TCP")==0 || strcasecmp(transport,"TLS")==0)){ + /*RFC 5923: add 'alias' parameter to tell the server that we want it to keep the connection for future requests*/ + belle_sip_header_via_t *via=belle_sip_message_get_header_by_type(BELLE_SIP_MESSAGE(request),belle_sip_header_via_t); + belle_sip_parameters_set_parameter(BELLE_SIP_PARAMETERS(via),"alias",NULL); + } } client_transaction = belle_sip_provider_create_client_transaction(prov,request); diff --git a/coreapi/event.h b/coreapi/event.h new file mode 100644 index 000000000..68417a846 --- /dev/null +++ b/coreapi/event.h @@ -0,0 +1,125 @@ +/* +linphone +Copyright (C) 2000 - 2010 Simon MORLAT (simon.morlat@linphone.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#ifndef LINPHONEEVENT_H +#define LINPHONEEVENT_H + +struct _LinphoneEvent; + +typedef struct _LinphoneEvent LinphoneEvent; + +/** + * Enum for subscription direction (incoming or outgoing). +**/ +enum _LinphoneSubscriptionDir{ + LinphoneSubscriptionIncoming, + LinphoneSubscriptionOutgoing +}; + +/** + * Typedef alias for _LinphoneSubscriptionDir +**/ +typedef _LinphoneSubscriptionDir LinphoneSubscriptionDir; + +/** + * Enum for subscription states. +**/ +enum _LinphoneSubscriptionState{ + LinphoneSubscriptionNone, /**< Initial state, should not be used.**/ + LinphoneSubscriptionOutoingInit, /**