]> sjero.net Git - linphone/blobdiff - coreapi/presence.c
Merge branch 'master' of git.savannah.nongnu.org:/srv/git/linphone
[linphone] / coreapi / presence.c
index 30c9c7e6a026854f20012f5d25491bb85603b01f..d97f4ed9419548bb0d34a95e1e2ed872d4f36ba8 100644 (file)
@@ -57,11 +57,24 @@ void linphone_subscription_new(LinphoneCore *lc, SalOp *op, const char *from){
        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;