Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with Draytek routers #21

Closed
oviano opened this issue Aug 15, 2024 · 3 comments
Closed

Issues with Draytek routers #21

oviano opened this issue Aug 15, 2024 · 3 comments

Comments

@oviano
Copy link
Contributor

oviano commented Aug 15, 2024

Hey there

  1. WANIPConnection is not found in the response from three different Draytek routers (2866, 2862, 2927):

10 urn:schemas-upnp-org:device:InternetGatewayDevice:1 Vigor2866 Draytek http://www.draytek.com.tw Residential Gateway Internet Connection Sharing 1.0 http://www.draytek.com/ uuid:226bffca-bc03-47dc-9aa4-1449bc36d4e8 00000-00001 urn:schemas-microsoft-com:service:OSInfo:1 urn:microsoft-com:serviceId:OSInfo1/OSInfo1 /OSInfoEvent1 /upnp/OSInfo.xml urn:schemas-upnp-org:device:WANDevice:1 WANDeviceDraytek http://www.draytek.com/ Residential Gateway Internet Connection Sharing 1 http://www.draytek.com/ 0000001 uuid:8c9db0f1-db2e-4c2a-b4af-89b06f67c4f300000-00001 urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1 urn:upnp-org:serviceId:WANCommonIFC1/upnp?control=WANCommonIFC1 /upnp?event=WANCommonIFC1/upnp/WComIFC1.xml urn:schemas-upnp-org:device:WANConnectionDevice:1 WANConnectionDeviceDraytek http://www.draytek.com/Residential Gateway Internet Connection Sharing1http://www.draytek.com/ 0000001uuid:f3eab9db-ad42-4dc3-bc75-8c41679f65eb00000-00001 urn:schemas-upnp-org:service: WANDSLLinkConfig:1 urn:upnp-org:serviceId:WANDSLLinkC1/upnp?control=WANDSLLinkC1 /upnp?event=WANDSLLinkC1/upnp/WANDSL.xml urn:schemas-upnp-org:service:WANPPPConnection:1urn:upnp-org:serviceId:WANPPPConn1 /upnp?control=WANPPPConn1/upnp?event=WANPPPConn1 /upnp/WPPPCon1.xml http://192.168.2.1/

  1. Ok, so if I hack the code everywhere it says WANIPConnection to use WANPPPConnection then it starts to work. But then fails trying to extract ExternalIPAddress from the following response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><m:GetExternalIPAddressResponse xmlns:m="urn:schemas-upnp-org:service:WANPPPConnection:1">XX.XX.XXX.XXX</m:GetExternalIPAddressResponse></s:Body></s:Envelope>

This is caused by the presence of the datatype information immediately after NewExternalIPAddress. If I add further hacks to the code to take into account this string then it works and maps the port correctly.

@paullouisageneau
Copy link
Owner

It looks like the routers implement the WANPPPConnection service instead of WANIPConnection. The UPnP standard is such a mess...

I think the library be adapted to support both. If you already have working code, a PR would be welcome.

@oviano
Copy link
Contributor Author

oviano commented Aug 26, 2024

Great, I'll sort out a PR for this.

@oviano
Copy link
Contributor Author

oviano commented Aug 26, 2024

#26
#27

@oviano oviano closed this as completed Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants