linphone_friend_set_inc_subscribe_policy(fl,LinphoneSPAccept);
fl->inc_subscribe_pending=TRUE;
lc->subscribers=ms_list_append(lc->subscribers,(void *)fl);
- if (lc->vtable.new_unknown_subscriber!=NULL) {
+ if (lc->vtable.new_subscription_request!=NULL) {
char *tmp=linphone_address_as_string(fl->uri);
- lc->vtable.new_unknown_subscriber(lc,fl,tmp);
+ lc->vtable.new_subscription_request(lc,fl,tmp);
ms_free(tmp);
}
}
LinphoneFriend *lf=NULL;
char *tmp;
LinphoneAddress *uri;
+ LinphoneProxyConfig *cfg;
+ const char *fixed_contact;
uri=linphone_address_new(from);
linphone_address_clean(uri);
tmp=linphone_address_as_string(uri);
ms_message("Receiving new subscription from %s.",from);
+
+ cfg=linphone_core_lookup_known_proxy(lc,uri);
+ if (cfg!=NULL){
+ if (cfg->op){
+ fixed_contact=sal_op_get_contact(cfg->op);
+ if (fixed_contact) {
+ sal_op_set_contact (op,fixed_contact);
+ ms_message("Contact for next subscribe answer has been fixed using proxy to %s",fixed_contact);
+ }
+ }
+ }
/* check if we answer to this subscription */
if (linphone_find_friend(lc->friends,uri,&lf)!=NULL){
lf->insub=op;
ms_free(tmp);
}
-void linphone_notify_recv(LinphoneCore *lc, SalOp *op, SalSubscribeState ss, SalPresenceStatus sal_status){
+void linphone_notify_recv(LinphoneCore *lc, SalOp *op, SalSubscribeStatus ss, SalPresenceStatus sal_status){
char *tmp;
LinphoneFriend *lf;
LinphoneAddress *friend=NULL;
- LinphoneOnlineStatus estatus=LINPHONE_STATUS_OFFLINE;
+ LinphoneOnlineStatus estatus=LinphoneStatusOffline;
switch(sal_status){
case SalPresenceOffline:
- estatus=LINPHONE_STATUS_OFFLINE;
+ estatus=LinphoneStatusOffline;
break;
case SalPresenceOnline:
- estatus=LINPHONE_STATUS_ONLINE;
+ estatus=LinphoneStatusOnline;
break;
case SalPresenceBusy:
- estatus=LINPHONE_STATUS_BUSY;
+ estatus=LinphoneStatusBusy;
break;
case SalPresenceBerightback:
- estatus=LINPHONE_STATUS_AWAY;
+ estatus=LinphoneStatusBeRightBack;
break;
case SalPresenceAway:
- estatus=LINPHONE_STATUS_AWAY;
+ estatus=LinphoneStatusAway;
break;
case SalPresenceOnthephone:
- estatus=LINPHONE_STATUS_ONTHEPHONE;
+ estatus=LinphoneStatusOnThePhone;
break;
case SalPresenceOuttolunch:
- estatus=LINPHONE_STATUS_OUTTOLUNCH;
+ estatus=LinphoneStatusOutToLunch;
break;
case SalPresenceDonotdisturb:
- estatus=LINPHONE_STATUS_BUSY;
+ estatus=LinphoneStatusDoNotDisturb;
break;
case SalPresenceMoved:
case SalPresenceAltService:
- estatus=LINPHONE_STATUS_AWAY;
+ estatus=LinphoneStatusMoved;
break;
}
lf=linphone_find_friend_by_out_subscribe(lc->friends,op);