Browser-Phone icon indicating copy to clipboard operation
Browser-Phone copied to clipboard

URGENT phone keeps disconnecting

Open edimondi opened this issue 2 years ago • 6 comments

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

edimondi avatar Dec 16 '22 18:12 edimondi

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.

InnovateAsterisk avatar Dec 16 '22 18:12 InnovateAsterisk

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 avatar Dec 16 '22 19:12 edimondi

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

edimondi avatar Dec 16 '22 21:12 edimondi

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.

InnovateAsterisk avatar Dec 17 '22 05:12 InnovateAsterisk

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

edimondi avatar Dec 20 '22 22:12 edimondi

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

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

rpbx avatar Apr 12 '23 08:04 rpbx