static void auth_requested(SalOp *h, const char *realm, const char *username){
LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(h));
LinphoneAuthInfo *ai=(LinphoneAuthInfo*)linphone_core_find_auth_info(lc,realm,username);
+ LinphoneCall *call=is_a_linphone_call(sal_op_get_user_pointer(h));
+
+ if (call && call->ping_op==h){
+ /*don't request authentication for ping requests. Their purpose is just to get any
+ * answer to get the Via's received and rport parameters.
+ */
+ ms_message("auth_requested(): ignored for ping request.");
+ return;
+ }
+
ms_message("auth_requested() for realm=%s, username=%s",realm,username);
if (ai && ai->works==FALSE && ai->usecount>=3){
}
}
+LinphoneCall * is_a_linphone_call(void *user_pointer){
+ LinphoneCall *call=(LinphoneCall*)user_pointer;
+ if (call==NULL) return NULL;
+ return call->magic==linphone_call_magic ? call : NULL;
+}
+
+LinphoneProxyConfig * is_a_linphone_proxy_config(void *user_pointer){
+ LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)user_pointer;
+ if (cfg==NULL) return NULL;
+ return cfg->magic==linphone_proxy_config_magic ? cfg : NULL;
+}
+
+
#ifdef HAVE_GETIFADDRS
#include <ifaddrs.h>
};
+static const int linphone_call_magic=0x3343;
+
struct _LinphoneCall
{
+ int magic; /*used to distinguish from proxy config*/
struct _LinphoneCore *core;
SalMediaDescription *localdesc;
SalMediaDescription *resultdesc;
void linphone_proxy_config_set_error(LinphoneProxyConfig *cfg, LinphoneReason error);
bool_t linphone_core_rtcp_enabled(const LinphoneCore *lc);
+LinphoneCall * is_a_linphone_call(void *user_pointer);
+LinphoneProxyConfig * is_a_linphone_proxy_config(void *user_pointer);
+
+static const int linphone_proxy_config_magic=0x7979;
struct _LinphoneProxyConfig
{
+ int magic;
struct _LinphoneCore *lc;
char *reg_proxy;
char *reg_identity;