InnovateAsterisk / Browser-Phone

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

URGENT phone keeps disconnecting #393

Open edimondi opened 1 year ago

edimondi commented 1 year ago

hi there, i am having issue with phone keeps disconnecting i notice that the orig-host is not my ip, my local ip is 192.168.1.1 but if you see the message here it is 192.0.2.57 and that keeps changing very often not sure from where is that ip coming . If i use a softphone it shows my correct local ip but with browser phone it shows 192.0.2.57 which is not my local ip. Any idea what is this: Contact 1999/sip:98hk60bj@mypublicip:59841;transport=ws;x-ast-orig-host=192.0.2.57:0

InnovateAsterisk commented 1 year ago

The RFC states that with WebRTC, you are supposed to use .invalid as the IP address in the contact, because as you know, Chrome (or any browser) cannot get your IP address. So the problem with Asterisk, is that it freaks out a bit when you give it a contact address that it cannot solve, so putting the IP address seem to be better for Asterisk. You should just set Asterisk to re-write the contact (that im sure you have... as you have here: Contact 1999/sip:98hk60bj@mypublicip:59841;transport=ws;x-ast-orig-host=192.0.2.57:0).

To tighten up the connection, you can try qualify your endpoint more often, and also register expires shorter.

edimondi commented 1 year ago

before like 3 4 month ago it didnt show this x-ast-orig-host=192.0.2.57:0 but now i dont know what happened why is shows

edimondi commented 1 year ago

i had asterisk version 18.13 and didnt have issue but i think when i updated to latest version 18.15 i am having issue, the phones keeps disconnecting, i changed qualify and expiration to lower but same issue, so for now i am using a softphone until i will figure it out whats the problem

InnovateAsterisk commented 1 year ago

When you say the phone keeps disconnecting, do you mean the websocket connection? In that case you need to find out where, and why. How long does it take to disconnect? Normally there is something on the cli. Also check the browser console.

edimondi commented 1 year ago

it doesnt show any error on the console log but if i check the asterisk log there are some unreachable and reachable logs: [2022-12-20 22:06:20] VERBOSE[11929] res_http_websocket.c: WebSocket connection from 'mypublicip:62498' closed
334966 [2022-12-20 22:06:22] VERBOSE[101292] res_http_websocket.c: WebSocket connection from 'mypublicip:63090' for protocol 'sip' accepted using version '13' 334967 [2022-12-20 22:06:23] VERBOSE[124634] res_pjsip_registrar.c: Added contact 'sip:7b7udb23@mypublicip:63090;transport=ws;x-ast-orig-host=myprivateip:0' to AOR '314' with expiration of 300 seconds
334968 [2022-12-20 22:06:23] VERBOSE[2189] res_pjsip/pjsip_configuration.c: Endpoint 314 is now Reachable
334969 [2022-12-20 22:06:23] VERBOSE[2189] res_pjsip/pjsip_options.c: Contact 314/sip:7b7udb23@mypublicip:63090;transport=ws;x-ast-orig-host=myprivateip:0 is now Reachable. RTT: 172.741 msec

rpbx commented 1 year ago

There is an Asterisk bug that affects the version you mentioned.

Here is the patch. https://issues.asterisk.org/jira/browse/ASTERISK-30369