fAuernigg / esp32-baresip-client

19 stars 6 forks source link

Failing to connect to sip:music@iptel.org #2

Open sosaucily opened 4 years ago

sosaucily commented 4 years ago

Hey guys,

I'm trying this code, I actually made a few tweaks so it would work with only c code, no arduino and no pub/sub for now. Using your esp32 branch of baresip though.

I can get it all to build, and the baresip sipphone task runs, but it prints the following when I try to use

ua_connect(uag_current(), NULL, NULL, "sip:sosaucily+2@sip.antisip.com", VIDMODE_OFF); in the task main loop.

Sometimes the errors show 'sipphone: call: sipsess_connect: Invalid argument'

other times they show 'sipphone: call: sipsess_connect: Unknown protocol'

Wondering if you have any ideas. Below are two sets of logs showing these. Thanks

call: alloc with params laddr=10.27.99.135, af=AF_INET, use_rtp=1
.[0;32mI (4498) sipphone: call: alloc with params laddr=10.27.99.135, af=AF_INET, use_rtp=1
.[0m
call: use_video=0
.[0;32mI (4518) sipphone: call: use_video=0
.[0m
call: connecting to 'sip:music@iptel.org'..
.[0;32mI (4518) sipphone: call: connecting to 'sip:music@iptel.org'..
.[0m
.[31mcall: sipsess_connect: Invalid argument
.[;m.[0;32mI (4538) sipphone: call: sipsess_connect: Invalid argument
.[0m
audio: destroyed (started=0)
.[0;32mI (4538) sipphone: audio: destroyed (started=0)
.[0m
call: alloc with params laddr=10.27.99.135, af=AF_INET, use_rtp=1
.[0;32mI (4558) sipphone: call: alloc with params laddr=10.27.99.135, af=AF_INET, use_rtp=1
.[0m
call: use_video=0
.[0;32mI (4578) sipphone: call: use_video=0
.[0m
call: connecting to 'sip:music@iptel.org'..
.[0;32mI (4578) sipphone: call: connecting to 'sip:music@iptel.org'..
.[0m
.[31mcall: sipsess_connect: Invalid argument
.[;m.[0;32mI (4598) sipphone: call: sipsess_connect: Invalid argument
.[0m
audio: destroyed (started=0)
.[0;32mI (4598) sipphone: audio: destroyed (started=0)
.[0m

And this

call: alloc with params laddr=0.0.0.0, af=AF_INET, use_rtp=1
.[0;32mI (4518) sipphone: call: alloc with params laddr=0.0.0.0, af=AF_INET, use_rtp=1
.[0m
call: use_video=0
.[0;32mI (4528) sipphone: call: use_video=0
.[0m
call: connecting to 'sip:sosaucily+2@sip.antisip.com'..
.[0;32mI (4528) sipphone: call: connecting to 'sip:testaccount+2@sip.antisip.com'..
.[0m
.[31mcall: sipsess_connect: Unknown protocol
.[;m.[0;32mI (4548) sipphone: call: sipsess_connect: Unknown protocol
.[0m
audio: destroyed (started=0)
.[0;32mI (4558) sipphone: audio: destroyed (started=0)
.[0m
call: alloc with params laddr=0.0.0.0, af=AF_INET, use_rtp=1
.[0;32mI (4558) sipphone: call: alloc with params laddr=0.0.0.0, af=AF_INET, use_rtp=1
.[0m
call: use_video=0
.[0;32mI (4578) sipphone: call: use_video=0
.[0m
cspiel1 commented 4 years ago

Dear Jesse,

this is the old project. We already started with https://github.com/mrxa13/esp-baresip.git

baresip, re, rem are submodules from mainline. Also patches are there. But the patches have to be applied during the build process. A script apply_patches.sh is there. I think this has to be invoked manually for now.

Your logs doesn't tell me anything. Seems to need some debugging. Or you try the new components repo above.

regards, chris

On Fri 06.12.19 10:09, Jesse Smith wrote:

Hey guys,

I'm trying this code, I actually made a few tweaks so it would work with only c code, no arduino and no pub/sub for now. Using your esp32 branch of baresip though.

I can get it all to build, and the baresip sipphone task runs, but it prints the following when I try to use

ua_connect(uag_current(), NULL, NULL, "sip:sosaucily+2@sip.antisip.com", VIDMODE_OFF); in the task main loop.

Sometimes the errors show 'sipphone: call: sipsess_connect: Invalid argument'

other times they show 'sipphone: call: sipsess_connect: Unknown protocol'

Wondering if you have any ideas. Below are two sets of logs showing these. Thanks

call: alloc with params laddr=10.27.99.135, af=AF_INET, use_rtp=1
.[0;32mI (4498) sipphone: call: alloc with params laddr=10.27.99.135, af=AF_INET, use_rtp=1
.[0m
call: use_video=0
.[0;32mI (4518) sipphone: call: use_video=0
.[0m
call: connecting to 'sip:music@iptel.org'..
.[0;32mI (4518) sipphone: call: connecting to 'sip:music@iptel.org'..
.[0m
.[31mcall: sipsess_connect: Invalid argument
.[;m.[0;32mI (4538) sipphone: call: sipsess_connect: Invalid argument
.[0m
audio: destroyed (started=0)
.[0;32mI (4538) sipphone: audio: destroyed (started=0)
.[0m
call: alloc with params laddr=10.27.99.135, af=AF_INET, use_rtp=1
.[0;32mI (4558) sipphone: call: alloc with params laddr=10.27.99.135, af=AF_INET, use_rtp=1
.[0m
call: use_video=0
.[0;32mI (4578) sipphone: call: use_video=0
.[0m
call: connecting to 'sip:music@iptel.org'..
.[0;32mI (4578) sipphone: call: connecting to 'sip:music@iptel.org'..
.[0m
.[31mcall: sipsess_connect: Invalid argument
.[;m.[0;32mI (4598) sipphone: call: sipsess_connect: Invalid argument
.[0m
audio: destroyed (started=0)
.[0;32mI (4598) sipphone: audio: destroyed (started=0)
.[0m

call: alloc with params laddr=0.0.0.0, af=AF_INET, use_rtp=1 .[0;32mI (4518) sipphone: call: alloc with params laddr=0.0.0.0, af=AF_INET, use_rtp=1 .[0m call: use_video=0 .[0;32mI (4528) sipphone: call: use_video=0 .[0m call: connecting to 'sip:sosaucily+2@sip.antisip.com'.. .[0;32mI (4528) sipphone: call: connecting to 'sip:testaccount+2@sip.antisip.com'.. .[0m .[31mcall: sipsess_connect: Unknown protocol .[;m.[0;32mI (4548) sipphone: call: sipsess_connect: Unknown protocol .[0m audio: destroyed (started=0) .[0;32mI (4558) sipphone: audio: destroyed (started=0) .[0m call: alloc with params laddr=0.0.0.0, af=AF_INET, use_rtp=1 .[0;32mI (4558) sipphone: call: alloc with params laddr=0.0.0.0, af=AF_INET, use_rtp=1 .[0m call: use_video=0 .[0;32mI (4578) sipphone: call: use_video=0 .[0m



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mrxa13/esp32-baresip-client/issues/2
fAuernigg commented 4 years ago

Hi Jesse

Please test with the new repo esp-baresip.git. It is also integrated in "esp32-baresip-client"

Following line in your log is interesting: "call: alloc with params laddr=0.0.0.0, af=AF_INET, use_rtp=1"

Could it be that you initialize baresip before you are connected to Wifi / Network?

The current implementation does not support update of the local ip (laddr) after baresip was initialized.

sosaucily commented 4 years ago

Hey guys,

@mrxa13, yes you were correct, with an ip addr of 0.0.0.0 the "Unknown protocol" error would occur, but making sure the IP was set first solved that.

When an IP address WAS set properly, I was getting the "Invalid argument" error. That error was happening because I was using a dns name for the SIP client/server. I'm trying a setup with the two clients trying to call each other using 'sip.antisip.com'. When I switched it to the IP address of that server instead of the DNS name, it worked better. It was an error with the dnsc DNS Client parameter being null in one of the calling functions. Is that not supported in this package?

I've gotten it a bit further now. My goal is to be able to call from the esp32 with a sip.antisip.com account to another baresip client also on sip.antisip.com, like the android client.

However, does this esp32 implementation work when making an outgoing call with ua_connect? What if the server this account uses is a hosted service like sip.antisip.com? The log prints "connecting to " the other sip client, but it doesn't ring, and no more messages print.

Is there a state machine that needs to be set up somewhere?

Anyway, thanks for your guys' help. I'll also try out the other repo tomorrow.

fAuernigg commented 4 years ago

Hi Jesse

I saw in your logs that you initiate a call to a domain. We tested only with (local) ip addresses.

I need to double check but I think resolving domains is not implemented yet for the esp32 platform in baresip. A patch inside libre or baresip is required for that.

Franz