mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-18 09:32:34 +00:00
printers do not route to the internet, in fact, all printers do is kill trees, killers are evil and as such should be ignored
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16601 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
df9632f263
commit
4f97df4625
@ -83,7 +83,8 @@ static switch_status_t get_upnp_pubaddr(char *pub_addr)
|
|||||||
static int init_upnp(void)
|
static int init_upnp(void)
|
||||||
{
|
{
|
||||||
struct UPNPDev *devlist;
|
struct UPNPDev *devlist;
|
||||||
struct UPNPDev *dev;
|
struct UPNPDev *dev = NULL;
|
||||||
|
struct UPNPDev *trydev = NULL;
|
||||||
char *descXML;
|
char *descXML;
|
||||||
int descXMLsize = 0;
|
int descXMLsize = 0;
|
||||||
const char *multicastif = 0;
|
const char *multicastif = 0;
|
||||||
@ -99,13 +100,23 @@ static int init_upnp(void)
|
|||||||
if (strstr(dev->st, "InternetGatewayDevice")) {
|
if (strstr(dev->st, "InternetGatewayDevice")) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (!trydev && !switch_stristr("printer", dev->descURL)) {
|
||||||
|
trydev = dev;
|
||||||
|
}
|
||||||
|
|
||||||
dev = dev->pNext;
|
dev = dev->pNext;
|
||||||
}
|
}
|
||||||
if (!dev) {
|
|
||||||
dev = devlist; /* defaulting to first device */
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No InternetGatewayDevice, using first entry as default (%s).\n", dev->descURL);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!dev && trydev) {
|
||||||
|
dev = trydev; /* defaulting to first device */
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No InternetGatewayDevice, using first entry as default (%s).\n", dev->descURL);
|
||||||
|
} else if (devlist && !dev && !trydev) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No InternetGatewayDevice found and I am NOT going to try your printer because printers should not route to the internet, that would be DAFT\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dev) {
|
||||||
descXML = miniwget(dev->descURL, &descXMLsize);
|
descXML = miniwget(dev->descURL, &descXMLsize);
|
||||||
|
|
||||||
nat_globals.descURL = strdup(dev->descURL);
|
nat_globals.descURL = strdup(dev->descURL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user