]> sjero.net Git - linphone/blobdiff - coreapi/linphonecore.c
Merge remote-tracking branch 'origin/master' into dev_videoios
[linphone] / coreapi / linphonecore.c
index 401158d49bff9c76fac93a48585da9b4a0a68d1c..12f985c2fbfad2ece7964defc977917bedee4f8e 100644 (file)
@@ -982,6 +982,7 @@ static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vta
        linphone_core_assign_payload_type(lc,&payload_type_speex_wb,111,"vbr=on");
        linphone_core_assign_payload_type(lc,&payload_type_speex_uwb,112,"vbr=on");
        linphone_core_assign_payload_type(lc,&payload_type_telephone_event,101,"0-11");
+       linphone_core_assign_payload_type(lc,&payload_type_g722,9,NULL);
 
 #if defined(ANDROID) || defined (__IPHONE_OS_VERSION_MIN_REQUIRED)
        /*shorten the DNS lookup time and send more retransmissions on mobiles:
@@ -3161,6 +3162,8 @@ const char *linphone_core_get_nat_address_resolved(LinphoneCore *lc)
        int error;
        char ipstring [INET6_ADDRSTRLEN];
 
+       if (lc->net_conf.nat_address==NULL) return NULL;
+       
        if (parse_hostname_to_addr (lc->net_conf.nat_address, &ss, &ss_len)<0) {
                return lc->net_conf.nat_address;
        }
@@ -4330,3 +4333,22 @@ void linphone_core_set_zrtp_secrets_file(LinphoneCore *lc, const char* file){
        }
        lc->zrtp_secrets_cache=file ? ms_strdup(file) : NULL;
 }
+
+//                             if (stringUri.equals(call.getRemoteAddress().asStringUriOnly())) {
+const LinphoneCall* linphone_core_find_call_from_uri(LinphoneCore *lc, const char *uri) {
+       if (uri == NULL) return NULL;
+       MSList *calls=lc->calls;
+       while(calls) {
+               const LinphoneCall *c=(LinphoneCall*)calls->data;
+               calls=calls->next;
+               const LinphoneAddress *address = linphone_call_get_remote_address(c);
+               char *current_uri=linphone_address_as_string_uri_only(address);
+               if (strcmp(uri,current_uri)==0) {
+                       ms_free(current_uri);
+                       return c;
+               } else {
+                       ms_free(current_uri);
+               }
+       }
+       return NULL;
+}