InnovateAsterisk / Browser-Phone

A fully featured browser based WebRTC SIP phone for Asterisk
https://www.innovateasterisk.com
GNU Affero General Public License v3.0
494 stars 243 forks source link

Registration failed: forbidden #319

Open prathibhacdac opened 2 years ago

prathibhacdac commented 2 years ago

Correct credentials provided. Then also the app is throwing forbidden error.

Failed to register, status code 403

InnovateAsterisk commented 2 years ago

You will need to show the resulting error on the CLI.

If Asterisk responds with an error of sorts, something will be shown on the CLI. You should also increase your verbosity and even the debug so you can gather enough information. You should also tap at least one side of the line to get the actual SIP messages, either on the browser WebSocket Messages or the Asterisk CLI with pjsip set logger on

prathibhacdac commented 1 year ago

Registration Failed when giving public IP but it is successful on private IP.

Console log:

*CLI> [2023-03-17 16:13:23] ERROR[25736]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:23] ERROR[25736]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '42.111.145.105:7544' [2023-03-17 16:13:23] ERROR[25736]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error == WebSocket connection from '42.111.145.105:7526' for protocol 'sip' accepted using version '13' [2023-03-17 16:13:45] ERROR[25750]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:45] ERROR[25750]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '42.111.145.105:7550' [2023-03-17 16:13:45] ERROR[25750]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error == WebSocket connection from '42.111.145.105:7526' closed [2023-03-17 16:13:46] ERROR[25752]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25752]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '42.111.145.105:7521' [2023-03-17 16:13:46] ERROR[25752]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25753]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25753]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '42.111.145.105:7546' [2023-03-17 16:13:46] ERROR[25753]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25755]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25755]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '42.111.145.105:7534' [2023-03-17 16:13:46] ERROR[25755]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25754]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25754]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '42.111.145.105:7548' [2023-03-17 16:13:46] ERROR[25754]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25756]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25756]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '42.111.145.105:7522' [2023-03-17 16:13:46] ERROR[25756]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25757]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25757]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '42.111.145.105:7523' [2023-03-17 16:13:46] ERROR[25757]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25758]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25758]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '42.111.145.105:7545' [2023-03-17 16:13:46] ERROR[25758]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25759]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25759]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '42.111.145.105:7500' [2023-03-17 16:13:46] ERROR[25759]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25760]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25760]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '42.111.145.105:7536' [2023-03-17 16:13:46] ERROR[25760]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25761]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25761]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '42.111.145.105:7549' [2023-03-17 16:13:46] ERROR[25761]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25763]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25763]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '42.111.145.105:7510' [2023-03-17 16:13:46] ERROR[25763]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25762]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:46] ERROR[25762]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '42.111.145.105:7516' [2023-03-17 16:13:46] ERROR[25762]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error == WebSocket connection from '42.111.145.105:7490' for protocol 'sip' accepted using version '13' [2023-03-17 16:13:47] ERROR[25765]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:47] ERROR[25765]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '42.111.145.105:7507' [2023-03-17 16:13:47] ERROR[25765]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:47] ERROR[25767]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:13:47] ERROR[25767]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '42.111.145.105:7496' [2023-03-17 16:13:47] ERROR[25767]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:14:19] ERROR[25764]: res_http_websocket.c:567 ws_safe_read: Error reading from web socket: Success [2023-03-17 16:14:19] ERROR[25764]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000005:lib(0):func(0):DH lib, Underlying BIO error: Broken pipe == WebSocket connection from '42.111.145.105:7490' closed [2023-03-17 16:14:22] ERROR[25776]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error [2023-03-17 16:14:22] ERROR[25776]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '42.111.145.105:7498' [2023-03-17 16:14:22] ERROR[25776]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error == WebSocket connection from '42.111.145.105:7506' for protocol 'sip' accepted using version '13'

prathibhacdac commented 1 year ago

pjsip log

REGISTER sip:bp.erss.in SIP/2.0 Via: SIP/2.0/WSS 192.0.2.243;branch=z9hG4bK6518940 To: sip:User1@bp.erss.in From: "User One" sip:User1@bp.erss.in;tag=12gn7q071h CSeq: 2 REGISTER Call-ID: u374j4na9nvpqsh92eqg Max-Forwards: 70 Contact: sip:9busqlh4@192.0.2.243;transport=wss;expires=300 Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER Supported: outbound, path, gruu User-Agent: Browser Phone 0.3.20 (SIPJS - 0.20.0) Mozilla/5.0 (Linux; Android 11; SM-A505F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Mobile Safari/537.36 Content-Length: 0

<--- Transmitting SIP response (316 bytes) to WSS:42.111.145.105:7510 ---> SIP/2.0 403 Forbidden Via: SIP/2.0/WSS 192.0.2.243;received=42.111.145.105;branch=z9hG4bK6518940 Call-ID: u374j4na9nvpqsh92eqg From: "User One" sip:User1@bp.erss.in;tag=12gn7q071h To: sip:User1@bp.erss.in;tag=z9hG4bK6518940 CSeq: 2 REGISTER Server: Asterisk PBX certified/18.9-cert4 Content-Length: 0

prathibhacdac commented 1 year ago

Now I've changed the port no to a non-standard port no.