soap_wsdd_mode wsdd_event_Probe(struct soap *soap, const char *MessageID, const char *ReplyTo, const char *Types, const char *Scopes, const char *MatchBy, struct wsdd__ProbeMatchesType *matches) { printf("wsdd_event_Probe id=%s replyTo=%s types=%s scopes=%s\n", MessageID, ReplyTo, Types, Scopes); soap_wsdd_init_ProbeMatches(soap,matches); soap_wsdd_add_ProbeMatch(soap, matches, "soap.udp://239.255.255.250:3702", _type, NULL, NULL, _xaddr, _metadataVersion); soap_wsdd_ProbeMatches(soap, "soap.udp://239.255.255.250:3702", soap_wsa_rand_uuid(soap) , MessageID, ReplyTo, matches); return SOAP_WSDD_ADHOC; }
soap_wsdd_mode wsdd_event_Probe(struct soap *soap, const char *MessageID, const char *ReplyTo, const char *Types, const char *Scopes, const char *MatchBy, struct wsdd__ProbeMatchesType *matches) { printf("%s,%d\n",__FUNCTION__, __LINE__); printf("MessageID:%s\n", MessageID); printf("ReplyTo:%s\n",ReplyTo); printf("Types:%s\n",Types); printf("Scopes:%s\n",Scopes); printf("MatchBy:%s\n",MatchBy); //测试代码 soap_wsdd_init_ProbeMatches(soap,matches); soap_wsdd_add_ProbeMatch(soap,matches, "urn:uuid:464A4854-4656-5242-4530-313035394100", "ns1:NetworkVideoTransmitter", "onvif://www.onvif.org/type/video_encoder onvif://www.onvif.org/type/audio_encoder onvif://www.onvif.org/hardware/IPC-model onvif://www.onvif.org/name/IPC-model", NULL, "http://192.168.0.243/onvif/device_service",10); return 0; }
soap_wsdd_mode wsdd_event_Probe(struct soap *soap, const char *MessageID, const char *ReplyTo, const char *Types, const char *Scopes, const char *MatchBy, struct wsdd__ProbeMatchesType *matches) { printf("%s,%d\n", __FUNCTION__, __LINE__); printf("MessageID:%s\n", MessageID); printf("ReplyTo:%s\n", ReplyTo); printf("Types:%s\n", Types); printf("Scopes:%s\n", Scopes); printf("MatchBy:%s\n", MatchBy); printf("\n"); soap->header->wsa__RelatesTo = (struct wsa__Relationship*) soap_malloc( soap, sizeof(struct wsa__Relationship)); if (soap->header->wsa__ReplyTo) { soap->header->wsa__To = soap->header->wsa__ReplyTo->Address; } else { soap->header->wsa__To = NULL; } soap->header->wsa__RelatesTo->__item = soap->header->wsa__MessageID; soap->header->wsa__RelatesTo->RelationshipType = NULL; soap->header->wsa__RelatesTo->__anyAttribute = NULL; soap->header->wsa__Action = "http://schemas.xmlsoap.org/ws/2005/04/discovery/ProbeMatches"; soap->header->wsa__ReplyTo = NULL; soap_wsdd_init_ProbeMatches(soap, matches); soap_wsdd_add_ProbeMatch(soap, matches, "urn:uuid:464A4854-4656-5242-4530-313035394100", "tdn:NetworkVideoTransmitter", g_scopes, NULL, "http://192.168.1.2:8080/onvif/device_service", 10); return SOAP_WSDD_MANAGED; }
soap_wsdd_mode wsdd_event_Probe(struct soap *soap, const char *MessageID, const char *ReplyTo, const char *Types, const char *Scopes, const char *MatchBy, struct wsdd__ProbeMatchesType *matches) { IpcamIOnvifDiscovery *ionvif_discovery = IPCAM_IONVIF_DISCOVERY(soap->user); struct NetworkParameters param; char *xaddrs = NULL; char *ep_ref = NULL; g_assert(IPCAM_IS_IONVIF_DISCOVERY(ionvif_discovery)); #if 0 DBG_PRINT("%s,%d\n", __FUNCTION__, __LINE__); DBG_PRINT("MessageID:%s\n", MessageID); DBG_PRINT("ReplyTo:%s\n", ReplyTo); DBG_PRINT("Types:%s\n", Types); DBG_PRINT("Scopes:%s\n", Scopes); DBG_PRINT("MatchBy:%s\n", MatchBy); DBG_PRINT("\n"); #endif soap->header->wsa__RelatesTo = (struct wsa__Relationship*) soap_malloc( soap, sizeof(struct wsa__Relationship)); soap->header->wsa__To = soap_strdup(soap, ReplyTo); soap->header->wsa__RelatesTo->__item = soap_strdup(soap, MessageID); soap->header->wsa__RelatesTo->RelationshipType = NULL; soap->header->wsa__RelatesTo->__anyAttribute = NULL; soap->header->wsa__Action = "http://schemas.xmlsoap.org/ws/2005/04/discovery/ProbeMatches"; soap->header->wsa__ReplyTo = NULL; soap_wsdd_init_ProbeMatches(soap, matches); param.http_port = 80; inet_aton("127.0.0.1", ¶m.ipaddr); memset(param.mac_addr, 0, sizeof(param.mac_addr)); if (!get_network_parameters(ionvif_discovery, ¶m)) g_warning("Get network parameter failed.\n"); if (param.http_port == 80) { asprintf(&xaddrs, "http://%s/onvif/device_service", inet_ntoa(param.ipaddr)); } else { asprintf(&xaddrs, "http://%s:%d/onvif/device_service", inet_ntoa(param.ipaddr), param.http_port); } ep_ref = g_malloc0(64); g_snprintf(ep_ref, 64, "urn:uuid:464A4854-4656-5242-4530-%02X%02X%02X%02X%02X%02X", param.mac_addr[0], param.mac_addr[1], param.mac_addr[2], param.mac_addr[3], param.mac_addr[4], param.mac_addr[5]); soap_wsdd_add_ProbeMatch(soap, matches, soap_strdup(soap, ep_ref), "tdn:NetworkVideoTransmitter", g_scopes, NULL, soap_strdup(soap, xaddrs), 10); free(xaddrs); g_free(ep_ref); return SOAP_WSDD_MANAGED; }