Commit d55430f3 authored by smorlat's avatar smorlat

work in progress, bugfixes, enrich OPTIONS responses.



git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@296 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent 88c9e7e7
......@@ -36,7 +36,7 @@ linphonecsh_LDADD = $(ORTP_LIBS)
endif
AM_CFLAGS=$(STRICT_OPTIONS) -DENABLE_TRACE -D_ORTP_SOURCE $(VIDEO_CFLAGS) $(READLINE_CFLAGS) $(OSIP_CFLAGS)
AM_CFLAGS=$(STRICT_OPTIONS) -DIN_LINPHONE -DENABLE_TRACE -D_ORTP_SOURCE $(VIDEO_CFLAGS) $(READLINE_CFLAGS) $(OSIP_CFLAGS)
......@@ -35,7 +35,7 @@ liblinphone_la_LIBADD= \
$(top_builddir)/mediastreamer2/src/libmediastreamer.la
AM_CFLAGS=$(STRICT_OPTIONS) \
AM_CFLAGS=$(STRICT_OPTIONS) -DIN_LINPHONE \
$(OSIP_CFLAGS) \
$(EXOSIP_CFLAGS) \
$(ORTP_CFLAGS) \
......
......@@ -964,7 +964,15 @@ static void linphone_other_request(LinphoneCore *lc, eXosip_event_t *ev){
linphone_core_text_received(lc,ev);
eXosip_message_send_answer(ev->tid,200,NULL);
}else if (strcmp(ev->request->sip_method,"OPTIONS")==0){
eXosip_options_send_answer(ev->tid,200,NULL);
#if 1
osip_message_t *options=NULL;
eXosip_options_build_answer(ev->tid,200,&options);
osip_message_set_allow(options,"INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, SUBSCRIBE, NOTIFY, INFO");
osip_message_set_accept(options,"application/sdp");
eXosip_options_send_answer(ev->tid,200,options);
#else
ms_warning("Not answering to this options request.");
#endif
}else if (strcmp(ev->request->sip_method,"WAKEUP")==0
&& comes_from_local_if(ev->request)) {
eXosip_message_send_answer(ev->tid,200,NULL);
......@@ -972,7 +980,13 @@ static void linphone_other_request(LinphoneCore *lc, eXosip_event_t *ev){
if (lc->vtable.show)
lc->vtable.show(lc);
}else {
ms_message("Unsupported request received.");
char *tmp=NULL;
size_t msglen=0;
osip_message_to_str(ev->request,&tmp,&msglen);
if (tmp){
ms_message("Unsupported request received:\n%s",tmp);
osip_free(tmp);
}
/*answer with a 501 Not implemented*/
eXosip_message_send_answer(ev->tid,501,NULL);
}
......
......@@ -2314,6 +2314,7 @@ void sound_config_uninit(LinphoneCore *lc)
if (config->local_ring) ms_free(config->local_ring);
if (config->remote_ring) ms_free(config->remote_ring);
ms_snd_card_manager_destroy();
}
void video_config_uninit(LinphoneCore *lc)
......
......@@ -25,7 +25,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "ortp/payloadtype.h"
#include "mediastreamer2/mscommon.h"
#include "mediastreamer2/msvideo.h"
#ifdef IN_LINPHONE
#include "sipsetup.h"
#else
#include "linphone/sipsetup.h"
#endif
#define LINPHONE_IPADDR_SIZE 64
#define LINPHONE_HOSTNAME_SIZE 128
......
......@@ -43,6 +43,30 @@ typedef struct _SipSetupContext SipSetupContext;
#define SIP_SETUP_CAP_BUDDY_LOOKUP (1<<3)
#define SIP_SETUP_CAP_ACCOUNT_MANAGER (1<<4)
typedef enum _BuddyLookupStatus{
BuddyLookupNone,
BuddyLookupConnecting,
BuddyLookupConnected,
BuddyLookupReceivingResponse,
BuddyLookupDone,
BuddyLookupFailure
}BuddyLookupStatus;
typedef struct _BuddyAddress{
char street[64];
char zip[64];
char town[64];
char country[64];
} BuddyAddress;
typedef struct _BuddyInfo{
char firstname[64];
char lastname[64];
char displayname[64];
char sip_uri[128];
BuddyAddress address;
}BuddyInfo;
struct _SipSetup{
char *name;
......@@ -55,7 +79,7 @@ struct _SipSetup{
int (*get_stun_servers)(SipSetupContext *ctx, char *stun1, char *stun2, size_t size);
int (*get_relay)(SipSetupContext *ctx, char *relay, size_t size);
int (*lookup_buddy)(SipSetupContext *ctx, const char *key);
int (*get_buddy_lookup_status)(SipSetupContext *ctx);
BuddyLookupStatus (*get_buddy_lookup_status)(SipSetupContext *ctx);
int (*get_buddy_lookup_results)(SipSetupContext *ctx, MSList **results);
void (*exit)(void);
bool_t initialized;
......@@ -63,29 +87,10 @@ struct _SipSetup{
typedef struct _SipSetup SipSetup;
typedef struct _BuddyAddress{
char street[64];
char zip[64];
char town[64];
char country[64];
} BuddyAddress;
typedef struct _BuddyInfo{
char firstname[64];
char lastname[64];
char displayname[64];
char sip_uri[128];
BuddyAddress address;
}BuddyInfo;
typedef enum _BuddyLookupStatus{
BuddyLookupNone,
BuddyLookupConnecting,
BuddyLookupConnected,
BuddyLookupReceivingResponse,
BuddyLookupDone,
BuddyLookupFailure
}BuddyLookupStatus;
#ifdef __cplusplus
extern "C"{
#endif
void sip_setup_register(SipSetup *ss);
void sip_setup_register_all(void);
......@@ -104,6 +109,11 @@ BuddyLookupStatus sip_setup_context_get_buddy_lookup_status(SipSetupContext *ctx
int sip_setup_context_get_buddy_lookup_results(SipSetupContext *ctx, MSList **results /*of BuddyInfo */);
void sip_setup_context_free_results(MSList *results);
void sip_setup_context_free(SipSetupContext *ctx);
#ifdef __cplusplus
}
#endif
#endif
......@@ -53,7 +53,7 @@ glade_DATA=$(GLADE_FILES) $(PIXMAPS)
endif
AM_CFLAGS= -I$(top_srcdir)/coreapi/ \
AM_CFLAGS= -DIN_LINPHONE -I$(top_srcdir)/coreapi/ \
-I$(top_srcdir)/mediastreamer2/include/ \
$(LIBGLADE_CFLAGS) $(STRICT_OPTIONS) $(LIBGTK_CFLAGS) $(IPV6_CFLAGS) \
$(ORTP_CFLAGS) $(OSIP_CFLAGS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment