Commit f8f8b3ba authored by Simon Morlat's avatar Simon Morlat
Browse files

fix bug in linphone_proxy_config_set_server_addr

fix compilation on some older version of eXosip2
parent b03d7d89
......@@ -90,6 +90,7 @@ bool_t linphone_proxy_config_is_registered(const LinphoneProxyConfig *obj){
**/
int linphone_proxy_config_set_server_addr(LinphoneProxyConfig *obj, const char *server_addr){
LinphoneAddress *addr;
char *try=NULL;
if (obj->reg_proxy!=NULL) ms_free(obj->reg_proxy);
obj->reg_proxy=NULL;
......@@ -99,13 +100,13 @@ int linphone_proxy_config_set_server_addr(LinphoneProxyConfig *obj, const char *
if (!addr){
/*try to prepend 'sip:' */
if (strstr(server_addr,"sip:")==NULL){
char *try=ms_strdup_printf("sip:%s",server_addr);
try=ms_strdup_printf("sip:%s",server_addr);
addr=linphone_address_new(try);
ms_free(try);
}
}
if (addr){
obj->reg_proxy=ms_strdup(server_addr);
obj->reg_proxy=linphone_address_as_string(addr);
linphone_address_destroy(addr);
}else{
ms_warning("Could not parse %s",server_addr);
......
......@@ -16,11 +16,15 @@ 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.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "sal_eXosip2.h"
#include "offeranswer.h"
/*this function is not declared in some versions of eXosip*/
extern void *eXosip_call_get_reference(int cid);
static void _osip_list_set_empty(osip_list_t *l, void (*freefunc)(void*)){
void *data;
......@@ -595,8 +599,13 @@ static void set_network_origin(SalOp *op, osip_message_t *req){
}
static SalOp *find_op(Sal *sal, eXosip_event_t *ev){
if (ev->cid>0)
return (SalOp*)eXosip_call_get_reference(ev->cid);;
if (ev->cid>0){
#ifdef HAVE_EXOSIP_GET_REF
return (SalOp*)eXosip_call_get_ref(ev->cid);
#else
return (SalOp*)eXosip_call_get_reference(ev->cid);
#endif
}
if (ev->rid>0){
return sal_find_register(sal,ev->rid);
}
......
......@@ -24,6 +24,10 @@ AC_CHECK_LIB([eXosip2],[eXosip_get_version],
[AC_DEFINE([HAVE_EXOSIP_GET_VERSION],[1],[Defined when eXosip_get_version is available])],
[],
[-losipparser2 -losip2 ])
AC_CHECK_LIB([eXosip2],[eXosip_call_get_reference],
[],
[AC_MSG_ERROR([Could not find eXosip_call_get_reference() in eXosip2 !])],
[-losipparser2 -losip2 ])
dnl AC_CHECK_LIB([eXosip2],[eXosip_get_naptr],
dnl [AC_DEFINE([HAVE_EXOSIP_NAPTR_SUPPORT],[1],[Defined when eXosip_get_naptr is available])],
dnl [],
......
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