bbernhard / signal-cli-rest-api

Dockerized Signal Messenger REST API
https://bbernhard.github.io/signal-cli-rest-api/
MIT License
1.37k stars 160 forks source link

Unable to receive SMS #256

Closed yousaf465 closed 2 years ago

yousaf465 commented 2 years ago

The problem

@bbernhard I entered this command as this from SSH into HA.

curl -X POST -H "Content-Type:application/json" -d '{"captcha":"as87FAdfahjdfadf...................","use_voice": false}' 'http://127.0.0.1:8081/v1/register/+xxxxxxxxxxxxxxxxx

got no error but instead got this

quote>

still waiting for the SMS

The last message in the addon log was


[GIN] 2022/07/15 - 01:20:55 | 400 |  167.967435ms |     xx.xx.xx.xx (this is the external IP) | POST     "/v1/register/+xxxxxxxxxxx6"The last

### Are you using the latest released version?

- [X] Yes

### Have you read the troubleshooting page?

- [X] Yes

### What type of installation are you running?

Home Assistant Signal Addon

### In which mode are you using the docker container?

Native Mode

### What's the architecture of your host system?

arm64

### Additional information

How long does it take to receive a simple confirmation SMS? 
yousaf465 commented 2 years ago

SMS didn't come even after waiting for so long.

bbernhard commented 2 years ago

Have you tried to set use_voice to true to see whether you get a voice call?

yousaf465 commented 2 years ago

Yes, I did tried that too. But it didn't work.how can I confirm from add-on logs whether command is working or not?

On Sat, 16 Jul 2022, 12:04 PM Bernhard B., @.***> wrote:

Have you tried to set use_voice to true to see whether you get a voice call?

— Reply to this email directly, view it on GitHub https://github.com/bbernhard/signal-cli-rest-api/issues/256#issuecomment-1186104462, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT47TDFLGGNBG7HW3IDFW7LVUJNHLANCNFSM53TPVTMA . You are receiving this because you authored the thread.Message ID: @.***>

bbernhard commented 2 years ago

This line

[GIN] 2022/07/15 - 01:20:55 | 400 | 167.967435ms | xx.xx.xx.xx

indicates that something went wrong (as 400 is returned as HTTP status code). Please have a look at the log file for additional info.

yousaf465 commented 2 years ago

This line

[GIN] 2022/07/15 - 01:20:55 | 400 | 167.967435ms | xx.xx.xx.xx

indicates that something went wrong (as 400 is returned as HTTP status code). Please have a look at the log file for additional info.

+ set -e
+ [ -z /data ]
+ usermod -u 1000 signal-api
usermod: no changes
+ groupmod -g 1000 signal-api
+ chown 1000:1000 -R /data
+ cat
+ cap_prefix=-cap_
+ cat /proc/sys/kernel/cap_last_cap
+ seq -s ,-cap_ 0 40
+ caps=-cap_0,-cap_1,-cap_2,-cap_3,-cap_4,-cap_5,-cap_6,-cap_7,-cap_8,-cap_9,-cap_10,-cap_11,-cap_12,-cap_13,-cap_14,-cap_15,-cap_16,-cap_17,-cap_18,-cap_19,-cap_20,-cap_21,-cap_22,-cap_23,-cap_24,-cap_25,-cap_26,-cap_27,-cap_28,-cap_29,-cap_30,-cap_31,-cap_32,-cap_33,-cap_34,-cap_35,-cap_36,-cap_37,-cap_38,-cap_39,-cap_40
+ [ native = json-rpc ]
+ hostname -I
+ awk {print $1}
+ export HOST_IP=XXXXXXXXX (I am behind a CGNAT and this my internal ISP IP) 
+ exec setpriv --reuid=1000 --regid=1000 --init-groups --inh-caps=-cap_0,-cap_1,-cap_2,-cap_3,-cap_4,-cap_5,-cap_6,-cap_7,-cap_8,-cap_9,-cap_10,-cap_11,-cap_12,-cap_13,-cap_14,-cap_15,-cap_16,-cap_17,-cap_18,-cap_19,-cap_20,-cap_21,-cap_22,-cap_23,-cap_24,-cap_25,-cap_26,-cap_27,-cap_28,-cap_29,-cap_30,-cap_31,-cap_32,-cap_33,-cap_34,-cap_35,-cap_36,-cap_37,-cap_38,-cap_39,-cap_40 signal-cli-rest-api -signal-cli-config=/data
time="2022-07-16T19:15:12+05:00" level=info msg="Started Signal Messenger REST API"
time="2022-07-16T19:15:12+05:00" level=error msg="signal-cli-native is not support on this system...falling back to signal-cli"

Logs after starting the add-on

bbernhard commented 2 years ago

What do you get when you call the register endpoint?

Are you sure that you are using arm64 as host platform? According to the logs it looks more like armv7

yousaf465 commented 2 years ago

What do you get when you call the register endpoint?

Are you sure that you are using arm64 as host platform? According to the logs it looks more like armv7

it is a rpi4, running HAOS. and I am using the Signal Add-on https://github.com/haberda/signal-addon/tree/main

image

yousaf465 commented 2 years ago

I tried this command

➜  ~ curl -X POST -H "Content-Type: application/json" --data '{"use_voice": true}' 'http://127.0.0.1:8081/v1/register/+3754395734' 

but got this error

{"error":"This endpoint is not supported in JSON-RCP mode."}#
yousaf465 commented 2 years ago

Set mode to normal and this happens

➜  ~ curl -X POST -H "Content-Type: application/json" --data '{"use_voice": true}' 'http://127.0.0.1:8081/v1/register/+349534543834'

and this is the output

{"error":"Captcha required for verification, use --captcha CAPTCHA\nTo get the token, go to https://signalcaptchas.org/registration/generate.html\nCheck the developer tools (F12) console for a failed redirect to signalcaptcha://\nEverything after signalcaptcha:// is the captcha token.\n"}#   
yousaf465 commented 2 years ago

Finally got the number registered, after solving the captcha. for future readers, captcha starts with the following code

"signal-recaptcha-v2.6Lxxxxxxxxxxxxxxxxxxxxxxxxxxxx

The last two messages confirmed that I have registered

[GIN] 2022/07/16 - 20:22:20 | 201 | 17.890100662s |     xx.xxx.xx.xx| POST     "/v1/register/+49534954390543"
[GIN] 2022/07/16 - 20:24:19 | 201 |  22.77259334s |     xx.xxx.xx.xx | POST     "/v1/register/+49534954390543/verify/345343(it is a six-digit code sent by SMS or voice)"

How do I test whether it is working

yousaf465 commented 2 years ago

Test as working by sending a notification. using this method. https://www.home-assistant.io/integrations/signal_messenger/