I tried your code and it works ok. The SipText is not shown or spoken, but I can live with that. Unfortunately not all of my phones show the callers name ("Doorbell") in the display, but that is ok as well.
But I wanted to use DHCP and I struggle to forward the LocalIP to the SIP.init() function:
const char *WiFiIP = "192.168.111.103"; // WiFi IP of the ESP
[...]
Sip aSip(acSipOut, sizeof(acSipOut));
[...]
void setup() {
[...]
aSip.Init(SipIP, SipPORT,WiFiIP, SipPORT, SipUSER, SipPW, 15);
}
This doesn't work... it looks as if WiFiIP does not contain the IP I got from DHCP. I'm not very good in C and pointers confuse me.. I guess it has something to do with trying to set a const char* within the setup()...
is there a trick I don't know? is it necessary to have the WiFiIP as a const char* ?
Ok, I figured it out... I need
const char* WiFiIP=strdup(WiFi.localIP().toString().c_str());
With this I can get the IP from DHCP and put it into the SIP Library
Hi,
I tried your code and it works ok. The SipText is not shown or spoken, but I can live with that. Unfortunately not all of my phones show the callers name ("Doorbell") in the display, but that is ok as well.
But I wanted to use DHCP and I struggle to forward the LocalIP to the SIP.init() function:
This works fine but
This doesn't work... it looks as if
WiFiIP
does not contain the IP I got fromDHCP
. I'm not very good in C and pointers confuse me.. I guess it has something to do with trying to set aconst char*
within thesetup()
...is there a trick I don't know? is it necessary to have the
WiFiIP
as aconst char*
?Schönen Gruß TOM