From 3981cdd2646427468fbe549c02354542b61d51a4 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 23 May 2011 17:27:28 +0200 Subject: [PATCH] add use_101 option to disable 101 dialog established --- coreapi/linphonecore.c | 1 + coreapi/sal.h | 1 + coreapi/sal_eXosip2.c | 8 +++++++- coreapi/sal_eXosip2.h | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index d075517c..1b9647f3 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -464,6 +464,7 @@ static void sip_config_read(LinphoneCore *lc) } sal_use_rport(lc->sal,lp_config_get_int(lc->config,"sip","use_rport",1)); + sal_use_101(lc->sal,lp_config_get_int(lc->config,"sip","use_101",1)); tmp=lp_config_get_int(lc->config,"sip","use_rfc2833",0); linphone_core_set_use_rfc2833_for_dtmf(lc,tmp); diff --git a/coreapi/sal.h b/coreapi/sal.h index ecb140b7..a89b862c 100644 --- a/coreapi/sal.h +++ b/coreapi/sal.h @@ -263,6 +263,7 @@ void sal_use_session_timers(Sal *ctx, int expires); void sal_use_double_registrations(Sal *ctx, bool_t enabled); void sal_use_one_matching_codec_policy(Sal *ctx, bool_t one_matching_codec); void sal_use_rport(Sal *ctx, bool_t use_rports); +void sal_use_101(Sal *ctx, bool_t use_101); int sal_iterate(Sal *sal); MSList * sal_get_pending_auths(Sal *sal); diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c index 34cfd44f..a0622226 100644 --- a/coreapi/sal_eXosip2.c +++ b/coreapi/sal_eXosip2.c @@ -274,6 +274,7 @@ Sal * sal_init(){ sal->keepalive_period=30; sal->double_reg=TRUE; sal->use_rports=TRUE; + sal->use_101=TRUE; return sal; } @@ -369,6 +370,9 @@ int sal_listen_port(Sal *ctx, const char *addr, int port, SalTransport tr, int i /*see if it looks like an IPv6 address*/ int use_rports = ctx->use_rports; // Copy char to int to avoid bad alignment eXosip_set_option(EXOSIP_OPT_USE_RPORT,&use_rports); + int dont_use_101 = !ctx->use_101; // Copy char to int to avoid bad alignment + eXosip_set_option(EXOSIP_OPT_DONT_SEND_101,&dont_use_101); + ipv6=strchr(addr,':')!=NULL; eXosip_enable_ipv6(ipv6); @@ -417,7 +421,9 @@ void sal_use_double_registrations(Sal *ctx, bool_t enabled){ void sal_use_rport(Sal *ctx, bool_t use_rports){ ctx->use_rports=use_rports; } - +void sal_use_101(Sal *ctx, bool_t use_101){ + ctx->use_101=use_101; +} static int extract_received_rport(osip_message_t *msg, const char **received, int *rportval){ osip_via_t *via=NULL; osip_generic_param_t *param=NULL; diff --git a/coreapi/sal_eXosip2.h b/coreapi/sal_eXosip2.h index 1f83a85e..a050f513 100644 --- a/coreapi/sal_eXosip2.h +++ b/coreapi/sal_eXosip2.h @@ -43,6 +43,7 @@ struct Sal{ bool_t one_matching_codec; bool_t double_reg; bool_t use_rports; + bool_t use_101; }; struct SalOp{ -- 2.39.2