Closed beatific-angel closed 2 years ago
[2022-07-21 02:40:14] ERROR[13295]: res_pjsip_session.c:937 handle_incoming_sdp: 2022207: Couldn't negotiate stream 0:audio-0:audio:sendrecv (nothing)
The “488: not acceptable here” is often related to audio codec. Make sure you have ULAW ALAW and Opus as allowed codec in the Endpoint config of Asterisk.
What method did you use for installing asterisk? Is there any way you can re-install as 18. I have not used 16 quite some time now.
I am using asterisk 18
I missed opus codec. so i checked and restarted again and I tested again
but same result
<--- Received SIP request (3126 bytes) from WSS:66.154.105.4:48850 ---> INVITE sip:102030@rus.za SIP/2.0 Via: SIP/2.0/WSS 192.0.2.156;branch=z9hG4bK592141 To: sip:102030@rus.za From: "2022207" sip:2022207@rus.za;tag=is7hkf84go CSeq: 1 INVITE Call-ID: kv232rr38bfn1ao1ci0t Max-Forwards: 70 Contact: sip:guh9cpna@192.0.2.156;transport=wss;ob Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER Supported: outbound User-Agent: Browser Phone 0.3.8 (SIPJS - 0.20.0) Content-Type: application/sdp Content-Length: 2627
v=0 o=- 2536834504739136753 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE 0 a=extmap-allow-mixed a=msid-semantic: WMS 1d74525e-9558-48f3-894c-06229a8be1b7 m=audio 56692 UDP/TLS/RTP/SAVPF 111 63 103 104 9 0 8 106 105 13 110 112 113 126 c=IN IP4 198.18.21.196 a=rtcp:9 IN IP4 0.0.0.0 a=candidate:2078000290 1 udp 2122260223 198.18.21.196 56692 typ host generation 0 network-id 1 network-cost 50 a=candidate:2877176657 1 udp 2122197247 2408:8234:9c13:3d0:7846:3761:9e7d:78e7 56693 typ host generation 0 network-id 4 a=candidate:3123987641 1 udp 2122131711 2408:8234:9c13:3d0:fc57:4322:3eb5:d239 56694 typ host generation 0 network-id 5 a=candidate:3885784340 1 udp 2122063615 170.170.0.51 56695 typ host generation 0 network-id 2 a=candidate:2150709124 1 udp 2121998079 192.168.0.155 56696 typ host generation 0 network-id 3 a=candidate:894974034 1 tcp 1518280447 198.18.21.196 9 typ host tcptype active generation 0 network-id 1 network-cost 50 a=candidate:3858614177 1 tcp 1518217471 2408:8234:9c13:3d0:7846:3761:9e7d:78e7 9 typ host tcptype active generation 0 network-id 4 a=candidate:4105680969 1 tcp 1518151935 2408:8234:9c13:3d0:fc57:4322:3eb5:d239 9 typ host tcptype active generation 0 network-id 5 a=candidate:2837422564 1 tcp 1518083839 170.170.0.51 9 typ host tcptype active generation 0 network-id 2 a=candidate:3467823988 1 tcp 1518018303 192.168.0.155 9 typ host tcptype active generation 0 network-id 3 a=ice-ufrag:/Q+k a=ice-pwd:oh5SA023AWrtgVxJBDCvPhfC a=ice-options:trickle a=fingerprint:sha-256 22:E6:28:86:78:F6:BF:4A:30:8F:90:05:F1:D1:1F:28:D6:0C:A0:7E:8B:FC:3F:BA:AA:3F:FD:90:F7:48:C7:6B a=setup:actpass a=mid:0 a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid a=sendrecv a=msid:1d74525e-9558-48f3-894c-06229a8be1b7 473b8282-9553-486c-a80d-3e662b5ddab8 a=rtcp-mux a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10;useinbandfec=1 a=rtpmap:63 red/48000/2 a=fmtp:63 111/111 a=rtpmap:103 ISAC/16000 a=rtpmap:104 ISAC/32000 a=rtpmap:9 G722/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:106 CN/32000 a=rtpmap:105 CN/16000 a=rtpmap:13 CN/8000 a=rtpmap:110 telephone-event/48000 a=rtpmap:112 telephone-event/32000 a=rtpmap:113 telephone-event/16000 a=rtpmap:126 telephone-event/8000 a=ssrc:4162458639 cname:1SJrrVBlfFdq3iRg a=ssrc:4162458639 msid:1d74525e-9558-48f3-894c-06229a8be1b7 473b8282-9553-486c-a80d-3e662b5ddab8
<--- Transmitting SIP response (473 bytes) to WSS:66.154.105.4:48850 ---> SIP/2.0 401 Unauthorized Via: SIP/2.0/WSS 192.0.2.156;rport=48850;received=66.154.105.4;branch=z9hG4bK592141 Call-ID: kv232rr38bfn1ao1ci0t From: "2022207" sip:2022207@rus.za;tag=is7hkf84go To: sip:102030@rus.za;tag=z9hG4bK592141 CSeq: 1 INVITE WWW-Authenticate: Digest realm="asterisk",nonce="1658480429/31c773f0b8d64c603d88af11acb683b8",opaque="388a97e6046e2f06",algorithm=md5,qop="auth" Server: FPBX-16.0.21.3(16.25.0) Content-Length: 0
<--- Received SIP request (725 bytes) from UDP:185.108.106.149:56626 ---> REGISTER sip:31.42.177.246:5060 SIP/2.0 To: sip:408@31.42.177.246 From: sip:408@31.42.177.246;tag=e5f4a346719e4f7a Via: SIP/2.0/UDP 10.10.10.6:56626;branch=z9hG4bK-d87543-1224290344-1--d87543-;rport Call-ID: e5f4a34671937e4f7a CSeq: 2 REGISTER Contact: sip:408@10.10.10.6:56626 Expires: 3600 Max-Forwards: 70 Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO User-Agent: PolycomSoundPointIP SPIP_550 UA 3.3.2.0413 Authorization: Digest username="408",realm="asterisk",nonce="1658480429/5f617f7ff3650a946637006be6e4487b",uri="sip:31.42.177.246:5060",response="b137b567a1a255bc5d66b6633d174a17",cnonce="167b4efc43363768",nc=00000001,qop=auth,algorithm=MD5 Content-Length: 0
[2022-07-22 09:00:29] NOTICE[6206]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from 'sip:408@31.42.177.246' failed for '185.108.106.149:56626' (callid: e5f4a34671937e4f7a) - Failed to authenticate <--- Transmitting SIP response (512 bytes) to UDP:185.108.106.149:56626 ---> SIP/2.0 401 Unauthorized Via: SIP/2.0/UDP 10.10.10.6:56626;rport=56626;received=185.108.106.149;branch=z9hG4bK-d87543-1224290344-1--d87543- Call-ID: e5f4a34671937e4f7a From: sip:408@31.42.177.246;tag=e5f4a346719e4f7a To: sip:408@31.42.177.246;tag=z9hG4bK-d87543-1224290344-1--d87543- CSeq: 2 REGISTER WWW-Authenticate: Digest realm="asterisk",nonce="1658480429/5f617f7ff3650a946637006be6e4487b",opaque="7de598ce10c1d258",algorithm=md5,qop="auth" Server: FPBX-16.0.21.3(16.25.0) Content-Length: 0
<--- Received SIP request (725 bytes) from UDP:185.108.106.149:56626 ---> REGISTER sip:31.42.177.246:5060 SIP/2.0 To: sip:408@31.42.177.246 From: sip:408@31.42.177.246;tag=e5f4a346719e4f7a Via: SIP/2.0/UDP 10.10.10.6:56626;branch=z9hG4bK-d87543-1224290345-1--d87543-;rport Call-ID: e5f4a34671937e4f7a CSeq: 3 REGISTER Contact: sip:408@10.10.10.6:56626 Expires: 3600 Max-Forwards: 70 Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO User-Agent: PolycomSoundPointIP SPIP_550 UA 3.3.2.0413 Authorization: Digest username="408",realm="asterisk",nonce="1658480429/5f617f7ff3650a946637006be6e4487b",uri="sip:31.42.177.246:5060",response="141220b573ab6c95b483571ad8bb93c5",cnonce="167b4efc46358000",nc=00000001,qop=auth,algorithm=MD5 Content-Length: 0
[2022-07-22 09:00:29] NOTICE[6206]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from 'sip:408@31.42.177.246' failed for '185.108.106.149:56626' (callid: e5f4a34671937e4f7a) - Failed to authenticate <--- Transmitting SIP response (512 bytes) to UDP:185.108.106.149:56626 ---> SIP/2.0 401 Unauthorized Via: SIP/2.0/UDP 10.10.10.6:56626;rport=56626;received=185.108.106.149;branch=z9hG4bK-d87543-1224290345-1--d87543- Call-ID: e5f4a34671937e4f7a From: sip:408@31.42.177.246;tag=e5f4a346719e4f7a To: sip:408@31.42.177.246;tag=z9hG4bK-d87543-1224290345-1--d87543- CSeq: 3 REGISTER WWW-Authenticate: Digest realm="asterisk",nonce="1658480429/5f617f7ff3650a946637006be6e4487b",opaque="3fd456f73a1a7c01",algorithm=md5,qop="auth" Server: FPBX-16.0.21.3(16.25.0) Content-Length: 0
<--- Received SIP request (288 bytes) from WSS:66.154.105.4:48850 ---> ACK sip:102030@rus.za SIP/2.0 Via: SIP/2.0/WSS 192.0.2.156;branch=z9hG4bK592141 To: sip:102030@rus.za;tag=z9hG4bK592141 From: "2022207" sip:2022207@rus.za;tag=is7hkf84go Call-ID: kv232rr38bfn1ao1ci0t CSeq: 1 ACK Max-Forwards: 70 Content-Length: 0
<--- Received SIP request (3407 bytes) from WSS:66.154.105.4:48850 ---> INVITE sip:102030@rus.za SIP/2.0 Via: SIP/2.0/WSS 192.0.2.156;branch=z9hG4bK8473724 To: sip:102030@rus.za From: "2022207" sip:2022207@rus.za;tag=is7hkf84go CSeq: 2 INVITE Call-ID: kv232rr38bfn1ao1ci0t Max-Forwards: 70 Authorization: Digest algorithm=MD5, username="2022207", realm="asterisk", nonce="1658480429/31c773f0b8d64c603d88af11acb683b8", uri="sip:102030@rus.za", response="eccf52e413835bb116be862be3514d7f", opaque="388a97e6046e2f06", qop=auth, cnonce="386sk9gu3rae", nc=00000001 Contact: sip:guh9cpna@192.0.2.156;transport=wss;ob Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER Supported: outbound User-Agent: Browser Phone 0.3.8 (SIPJS - 0.20.0) Content-Type: application/sdp Content-Length: 2627
v=0 o=- 2536834504739136753 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE 0 a=extmap-allow-mixed a=msid-semantic: WMS 1d74525e-9558-48f3-894c-06229a8be1b7 m=audio 56692 UDP/TLS/RTP/SAVPF 111 63 103 104 9 0 8 106 105 13 110 112 113 126 c=IN IP4 198.18.21.196 a=rtcp:9 IN IP4 0.0.0.0 a=candidate:2078000290 1 udp 2122260223 198.18.21.196 56692 typ host generation 0 network-id 1 network-cost 50 a=candidate:2877176657 1 udp 2122197247 2408:8234:9c13:3d0:7846:3761:9e7d:78e7 56693 typ host generation 0 network-id 4 a=candidate:3123987641 1 udp 2122131711 2408:8234:9c13:3d0:fc57:4322:3eb5:d239 56694 typ host generation 0 network-id 5 a=candidate:3885784340 1 udp 2122063615 170.170.0.51 56695 typ host generation 0 network-id 2 a=candidate:2150709124 1 udp 2121998079 192.168.0.155 56696 typ host generation 0 network-id 3 a=candidate:894974034 1 tcp 1518280447 198.18.21.196 9 typ host tcptype active generation 0 network-id 1 network-cost 50 a=candidate:3858614177 1 tcp 1518217471 2408:8234:9c13:3d0:7846:3761:9e7d:78e7 9 typ host tcptype active generation 0 network-id 4 a=candidate:4105680969 1 tcp 1518151935 2408:8234:9c13:3d0:fc57:4322:3eb5:d239 9 typ host tcptype active generation 0 network-id 5 a=candidate:2837422564 1 tcp 1518083839 170.170.0.51 9 typ host tcptype active generation 0 network-id 2 a=candidate:3467823988 1 tcp 1518018303 192.168.0.155 9 typ host tcptype active generation 0 network-id 3 a=ice-ufrag:/Q+k a=ice-pwd:oh5SA023AWrtgVxJBDCvPhfC a=ice-options:trickle a=fingerprint:sha-256 22:E6:28:86:78:F6:BF:4A:30:8F:90:05:F1:D1:1F:28:D6:0C:A0:7E:8B:FC:3F:BA:AA:3F:FD:90:F7:48:C7:6B a=setup:actpass a=mid:0 a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid a=sendrecv a=msid:1d74525e-9558-48f3-894c-06229a8be1b7 473b8282-9553-486c-a80d-3e662b5ddab8 a=rtcp-mux a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10;useinbandfec=1 a=rtpmap:63 red/48000/2 a=fmtp:63 111/111 a=rtpmap:103 ISAC/16000 a=rtpmap:104 ISAC/32000 a=rtpmap:9 G722/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:106 CN/32000 a=rtpmap:105 CN/16000 a=rtpmap:13 CN/8000 a=rtpmap:110 telephone-event/48000 a=rtpmap:112 telephone-event/32000 a=rtpmap:113 telephone-event/16000 a=rtpmap:126 telephone-event/8000 a=ssrc:4162458639 cname:1SJrrVBlfFdq3iRg a=ssrc:4162458639 msid:1d74525e-9558-48f3-894c-06229a8be1b7 473b8282-9553-486c-a80d-3e662b5ddab8
<--- Transmitting SIP response (304 bytes) to WSS:66.154.105.4:48850 ---> SIP/2.0 100 Trying Via: SIP/2.0/WSS 192.0.2.156;rport=48850;received=66.154.105.4;branch=z9hG4bK8473724 Call-ID: kv232rr38bfn1ao1ci0t From: "2022207" sip:2022207@rus.za;tag=is7hkf84go To: sip:102030@rus.za CSeq: 2 INVITE Server: FPBX-16.0.21.3(16.25.0) Content-Length: 0
[2022-07-22 09:00:29] ERROR[6206]: res_pjsip_session.c:937 handle_incoming_sdp: 2022207: Couldn't negotiate stream 0:audio-0:audio:sendrecv (nothing) <--- Transmitting SIP response (358 bytes) to WSS:66.154.105.4:48850 ---> SIP/2.0 488 Not Acceptable Here Via: SIP/2.0/WSS 192.0.2.156;rport=48850;received=66.154.105.4;branch=z9hG4bK8473724 Call-ID: kv232rr38bfn1ao1ci0t From: "2022207" sip:2022207@rus.za;tag=is7hkf84go To: sip:102030@rus.za;tag=67b7278b-9608-4438-a783-3a1bfd082988 CSeq: 2 INVITE Server: FPBX-16.0.21.3(16.25.0) Content-Length: 0
<--- Received SIP request (312 bytes) from WSS:66.154.105.4:48850 ---> ACK sip:102030@rus.za SIP/2.0 Via: SIP/2.0/WSS 192.0.2.156;branch=z9hG4bK8473724 To: sip:102030@rus.za;tag=67b7278b-9608-4438-a783-3a1bfd082988 From: "2022207" sip:2022207@rus.za;tag=is7hkf84go Call-ID: kv232rr38bfn1ao1ci0t CSeq: 2 ACK Max-Forwards: 70 Content-Length: 0
Server: FPBX-16.0.21.3(16.25.0)
me too : FreePBX 16.0.21.3
sorry asterisk versions is this
There may be a missing dependency.
If you stay on 16, or if you update to 18, I would making sure you include all dependency:
contrib/scripts/install_prereq install
# ./configure --with-pjproject-bundled
so I have to run this in terminal of server?
Did you install from source?
yes
Great then you should be familiar with the steps required.
You can use my guide if you like: https://www.innovateasterisk.com/s2e2-webrtc-in-the-cloud/
Some key points to highlight, you should do a system update before you start. You should also use the prerequisites installer to make sure you don’t have any missing or out of date prerequisites
contrib/scripts/install_prereq install
so I have to update my server? current my server is live status. and then my server works with other important features. do we have other solution without update server?
Probably best NOT to update a live server 🤣.
Your only real option then is to boot up a development instance, and get it working there. Then you can compare your dependencies and the methods you took etc.
If you seperate Browser phone with server(so if run Browser phone and asterisk on other servers), it will not affect to Browser phone working?
The html and JavaScript of this project can be hosted anywhere. But please be aware that typically websockets cannot connect to a non-secure server. Especially this project must connect to wss://
JavaScript has no problem connecting the websocket to any secure server, but the certificate must be valid.
so in browser phone, it being use cert ? otherwise while register and call, the broswer phone being use cert in asterisk?
First, the certificate is used as part of the JavaScript connection to the server. This must be valid. This is part of the web socket connection.
Then, at call setup, another set of certificates are used, but this can be self-generated, and by default are not validated. (It’s basically just used to encrypt the call). You can just opt for asterisk to enable this in the config.
Hmm so what you mean is Browser Phone should be located with asterisk? but currently I seperated browser phone part and asterisk+freepbx part. but registered successfully.
so what you mean is Browser Phone should be located with asterisk?
No, it’s easier from a certificate point of view. But if registration works, great!
Now you need to find out why the audio stream negotiation is not possible.
yes. but i dont know the reason. so I am asking the reason to you. plz see this image.
so what you mean is some files missed or wrong on my asterisk+freepbx server? right?
so what you mean is some files missed or wrong on my asterisk+freepbx server?
I believe so. I would do a sanity test by booting up a development instance. Even if you use AST16, if you follow the guide, you should have a working solution.
I see. I will try as you recommend.
If you believe the server is fine, and the problem lies In the browser phone code - please try: https://tryit.jssip.net/ it’s a completely different project (not by me) that uses a different jssip library.
how can i use this? all is disabled....
When grey dot goes green, it means you are registered. Otherwise you have probably not supplied the correct username password server etc
what information should be type in this field?
in here, registered successfully. but I can see this error too.
I am not an expert in JSSIP, but i see there is a warning about getUserMedia. This is point where the code captures you microphone and camera etc. I suggest making sure both a mic and web cam are available when testing.
thanks Conrad de Wet. as your guide in asterisk community, I added webrtc=yes in the endpoint file. it works.
hi one question. current I am trying to set callerID when call to another mobile phone. this is possible?
Caller ID is typically setup on the Asterisk side, especially as the call exits the PBX to the ISP/Carrier or even the other user (done with callerid=
setting in endpoint).
Please note when you trunk out, most ISPs will have a caller id policy. This is very important as your call may be blocked.
If you are planning:
Mobile (WebRTC) ---->(internet)---->[Asterisk PBX]---->[ISP]----->(GSM network)---->Mobile User
You will have problems if you want to present a mobile number to the "Mobile User". Even tho you are seen as the owner of the mobile number, there are some ISPs that will not know this at call setup. In other words, you may only be able to present a DID associated with the Trunk (from Asterisk PBX to ISP).
OR:
Mobile (WebRTC) ---->(internet)---->[Asterisk PBX]---->[ISP]---[another voip ISP] ----->(internet)---->Mobile User (WebRTC)
Same goes for this. Because the ISP only sees the Asterisk PBX to ISP part of the call, they are not aware of the details on either side, so often don't have any option but to block the call, unless you present the Caller ID associated with the trunk.
However:
Mobile (WebRTC) ---->(internet)---->[Asterisk PBX]---->(internet)---->Mobile User (WebRTC)
With two users on your own network you can present any Caller ID to the receiving party simply by setting the callerid=
in the endpoint.
thanks. will try.
one question in above case, how can connect call with webrtc phone with mobile phone number? my mean is dialplan. in this case, What is the best way to make a dial plan between webphone and mobile phone? I gonna use only UK numbers. about this, I am not sure.
In order to answer this, you need to understand a few things about telephone numbers. With you cellphone contract or prepaid simcard, you are given a telephone number as you know. Let's say this is Vodafone. In the voip space we call this a DID (Direct Inbound (or Inward) Dialling). But more importantly, one could say they are the property of the provider. This is important, because as much as you hand out your number to friends and family, you never really own this number to do with what you like. This is especially important when you consider that "pretending" to be this number on someone else's network is a big no-no. Another way to see it is that technically only vodafone should be terminating a vodafone DID. (Termination refers to the last leg of the call). Can you see that anywhere in the world if someone dials your number, only your SIM card should be ringing, and your SIM card was provided by Vodafone... therefor only Vodafone should be terminating your call.
Now, a "no-no" situation is that say you set your caller id on your own Asterisk voip server as your Vodafone cellphone number, and you make a call to a friend on say O2 network, now as you know from above, only O2 can terminate an O2 number, right? but when O2 receive the call from your Voip ISP, saying the call is coming from someone saying they are a Vodafone user, you can see that O2 may reject that call, because your Voip ISP is not Vodafone.
So now, let's say O2 allow the call, and your friend sees on his phone, that the person calling is you, as identified by the caller id... great, so he says hi, and all good, or he misses the call, and is able to easily call you back, no problems. (Let's just ignore the underlying revenue loss for now), But real potential problem now comes in, in that you as a PBX developer could easily "fake" the caller ID, and pretend to be anyone else, including the police or even just blank out the caller id, you can see how ISPs etc, really need to clamp down on this
Essentially what Im trying to say this that, you cannot put your mobile number onto the WebRTC endpoint as the caller id for the outbound leg of the call, you will have to present the DID that the Voip ISP gave you. The only way around this is to have both users on the same Asterisk PBX, this way you can present any DID you like, cellphone etc, but know that only through the app/web page are they going to receive the call.
in above case, how can connect call with webrtc phone with mobile phone number? my mean is dialplan.
You cannot, they are different things. You must use the DID that the Voip Provider gave you. Use callerid=
in the trunk settings, and trunk the call out.
What is the best way to make a dial plan between webphone and mobile phone?
There is no direct connection between them, you have to trunk out using a Voip ISP and flow over onto the GSM network. (They do this for you, as you are not a voip carrier.).
Try www.twillio.com They have a very good trunk with sample trunk settings for Asterisk/FreePBX. They do require you to authenticate your self with some sort of reverse DNS entry, so you must be in control of a domain that you own. They would then be your Voip ISP, and they provide you with a DID. (I think there is even a free limited option, or some testing period)
please see this image. I added caller ID to other sip webphone.
so you mean is when try call webphones (located on same freepbx), caller ID can show. but if i try to call from webphone to any UK number, can not show the caller ID. right?
but if i try to call from webphone to any UK number, can not show the caller ID.
Correct.
Typically PBX systems offer some sort of "internal" DID and an "external" DID. So calling a business on the number 4412345678 gets you to the reception, but then to speak to Bob, he is on extension 100. Obviously you can't just dial Bob on 100 from your mobile (using GSM network), but on their PBX, 100 will take you through to Bob.
Most PBX setups have some sort of dial-plan that recognises numbers that are supposed to go out or as they say "trunk out". If your PBX is setup with 4 digit internal numbers, then, it would be easy enough to just say anything dialled longer than 4 numbers must dial out via the trunk. Let's say that trunk is Twillio...
Now the call arrives at Twillio, you can see now that Twillio will need you to present a caller ID, and it cannot be "Bob" <100>
, because that only makes sense in the PBX, so another thing that the trunk needs is to set (or reset) is the caller ID to the companies caller ID... this has to be the DID that Twillio gave you.
Typical setup
pjsip.conf
[User1000]
...
callerid="Bob Smith" <1000>
...
[trunk-twillio]
...
callerid="My Awesome Company" <+4412345678>
...
extensions.conf
...
exten => 1000,n,Dial(PJSIP/User1000,60)
exten => _XXXX.,n,Dial(PJSIP/trunk-twillio,60)
...
If you are unfamiliar with Asterisk and dial-plan there are many more recourses better then this one.
All this is in an effort to prevent pretending you are someone you are not, SPAN, and Robo dialling. But as you can imagine there is always more two this story... Twillio also offer a way to validate numbers, that would then prove ownership, and then based on that they allow you to present this number as a caller ID.
You can also look into something called P-Asserted-Identity
. It's an extra SIP header that can be passed to Twillio, that give them the "real" identity, and the "presented" identity. So basically, you set your callerid=
to your cellphone number, and this is what will show on your friends screen when you call, but in the p-asserted-identity, you set the Trunk callerid, so that they can validate this number. I have never actually used this with Twillio, and it may only be used if you clear the caller id... but may be worth having a look
There is also "SHAKEN/STIR", but I have never tried this.
Personally, I think this may not be worth the pursuit. Consider this... let's say you make it work, now you call another friend who is also on Vodafone... so in this case, Twillio would have to hand that call over to Vodafone, right? (remember Vodafone are always the terminating leg of the call - no getting around that), but what Twillio are asking Vodafone to do is: "terminate this call on your network from me, oh and by the way this call comes from someone on your network" Oooops!! can you see that Vodafone may not like that too much.
I understand what you say. really it is impossible? I only need one direction way call --- from webphone to mobile phone. dont need return way call -- from mobile phone to webphone.
this is possible?
You can try it! But if it’s for a long term commercial solution, I wouldn’t build it into my business model. Have a dig around on Twillio. They are really a good trunking solution.
To do this, I have to modify your code?
I think if I change only asterisk side without your code, it is possible.
Nope, the phone stays as is. Remember the phone is only used to setup a call leg to the asterisks pbx. All this magic happens from the pbx to Twillio.
You need to:
Then in the browser phone create a contact with the a mobile number populated, and dial it.
How can I show dtmf code (for mobile phone ) in browser phone call screen?
https://github.com/InnovateAsterisk/Browser-Phone/blob/master/Screenshots/UI_Mobilr_Call_Light.jpg
Look for the keyboard icon if the call is established. (Look for the up arrow, if its not immediately visible.) Otherwise on an outgoing, but non-established call, there should also be a keyboard icon in the main screen area.
1: my mean is after established call, when send dtmf code from cell phone to web phone, have to show the dtmf code in web phone screen.
2: and then please see these images. about callerId part, why you processed like this? I dont understand. in first image, callerID mentioned. but in second image, appeared displayname instead of callerID.
I am waiting your reply... thanks again
my mean is after established call, when send dtmf code from cell phone to web phone, have to show the dtmf code in web phone screen.
Ah, I see, no there isn't such a function, only sending DTMF https://developer.mozilla.org/en-US/docs/Web/API/RTCDTMFSender
about callerId part, why you processed like this? It depends how its used, if you are calling someone but that buddy has not been created yet, then you can populate the caller id or display name while the buddy is being created.
If you want to programatically initiate a call, use DialByLine(type, buddy, numToDial, CallerID, extraHeaders)
type = 'audio' | 'video' <string> required (creates a audio or video call)
buddy = object <Buddy> optional (if provided no need to create a new buddy)
numToDial = '' <string> required (the number to dial)
CallerID = '' <string> optional (used to build buddy if not provided or number not matched to a buddy)
extraHeaders = [] array optional (array of extra headers to parse to the outbound call, added as sip headers. X-)
Ah, I see, no there isn't such a function, only sending DTMF https://developer.mozilla.org/en-US/docs/Web/API/RTCDTMFSender
if I try to receive the dtmf code, then that is possible with using your web phone?
Nope
current I am trying to call with your phone solution. I created two account and two registered. yet not solved this problem (one contact register in other computers).
anyway please see this problem too. both account registered. so I trying to call.
but I can see this error 488 error: not acceptable here
this is sip track log
<--- Received SIP request (3113 bytes) from WSS:204.44.96.131:17566 ---> INVITE sip:102030@rus.cz SIP/2.0 Via: SIP/2.0/WSS 192.0.2.154;branch=z9hG4bK7394738 To: <sip:102030@rus.cz> From: "2022207" sip:2022207@rus**.cz;tag=3gfrdlvq0a CSeq: 1 INVITE Call-ID: g6b3qfbnspnfutm0ourb Max-Forwards: 70 Contact: sip:v2n48i5t@192.0.2.154;transport=wss;ob Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER Supported: outbound User-Agent: Browser Phone 0.3.8 (SIPJS - 0.20.0) Content-Type: application/sdp Content-Length: 2613
v=0 o=- 2667082863342222819 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE 0 a=msid-semantic: WMS 820f49f4-7e18-4570-a9bd-eecfe385ebca m=audio 45439 UDP/TLS/RTP/SAVPF 111 103 9 0 8 105 13 110 113 126 c=IN IP4 204.44.96.131 a=rtcp:9 IN IP4 0.0.0.0 a=candidate:4078256983 1 udp 2122262783 2408:8234:9c13:3d0:e4bf:40c2:8c9c:3d53 53982 typ host generation 0 network-id 3 network-cost 10 a=candidate:3868393361 1 udp 2122194687 192.168.1.157 45439 typ host generation 0 network-id 2 network-cost 10 a=candidate:2762220737 1 udp 2122129151 198.18.58.215 41690 typ host generation 0 network-id 1 network-cost 50 a=candidate:3180773287 1 tcp 1518283007 2408:8234:9c13:3d0:e4bf:40c2:8c9c:3d53 9 typ host tcptype active generation 0 network-id 3 network-cost 10 a=candidate:2819687265 1 tcp 1518214911 192.168.1.157 9 typ host tcptype active generation 0 network-id 2 network-cost 10 a=candidate:3928479793 1 tcp 1518149375 198.18.58.215 9 typ host tcptype active generation 0 network-id 1 network-cost 50 a=candidate:1742403877 1 udp 1685987071 204.44.96.131 45439 typ srflx raddr 192.168.1.157 rport 45439 generation 0 network-id 2 network-cost 10 a=candidate:636232309 1 udp 1685921535 204.44.96.131 41690 typ srflx raddr 198.18.58.215 rport 41690 generation 0 network-id 1 network-cost 50 a=ice-ufrag:gzyw a=ice-pwd:f2SfVyTIG7bjEy0e51xgi0yo a=ice-options:trickle a=fingerprint:sha-256 33:B3:E0:AC:A6:53:61:4E:16:41:9C:6C:CD:87:26:4D:D7:83:A7:0B:84:B0:66:B1:6B:AB:08:1E:2E:DF:7B:89 a=setup:actpass a=mid:0 a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id a=sendrecv a=msid:820f49f4-7e18-4570-a9bd-eecfe385ebca a50fe8a8-5be9-40d5-8195-73738d491b22 a=rtcp-mux a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10;useinbandfec=1 a=rtpmap:103 ISAC/16000 a=rtpmap:9 G722/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:105 CN/16000 a=rtpmap:13 CN/8000 a=rtpmap:110 telephone-event/48000 a=rtpmap:113 telephone-event/16000 a=rtpmap:126 telephone-event/8000 a=ssrc:2126563126 cname:g6J6Y49/5yPjCW3i a=ssrc:2126563126 msid:820f49f4-7e18-4570-a9bd-eecfe385ebca a50fe8a8-5be9-40d5-8195-73738d491b22 a=ssrc:2126563126 mslabel:820f49f4-7e18-4570-a9bd-eecfe385ebca a=ssrc:2126563126 label:a50fe8a8-5be9-40d5-8195-73738d491b22
<--- Transmitting SIP response (476 bytes) to WSS:204.44.96.131:17566 ---> SIP/2.0 401 Unauthorized Via: SIP/2.0/WSS 192.0.2.154;rport=17566;received=204.44.96.131;branch=z9hG4bK7394738 Call-ID: g6b3qfbnspnfutm0ourb From: "2022207" sip:2022207@rus**.cz;tag=3gfrdlvq0a To: sip:102030@rus**.cz;tag=z9hG4bK7394738 CSeq: 1 INVITE WWW-Authenticate: Digest realm="asterisk",nonce="1658371213/1f35983509e52b3b65de72297d43af73",opaque="50f921b24d528899",algorithm=md5,qop="auth" Server: FPBX-16.0.21.3(16.25.0) Content-Length: 0
<--- Received SIP request (290 bytes) from WSS:204.44.96.131:17566 ---> ACK sip:102030@rus.cz SIP/2.0 Via: SIP/2.0/WSS 192.0.2.154;branch=z9hG4bK7394738 To: <sip:102030@rus.cz>;tag=z9hG4bK7394738 From: "2022207" sip:2022207@rus**.cz;tag=3gfrdlvq0a Call-ID: g6b3qfbnspnfutm0ourb CSeq: 1 ACK Max-Forwards: 70 Content-Length: 0
<--- Received SIP request (3393 bytes) from WSS:204.44.96.131:17566 ---> INVITE sip:102030@rus.cz SIP/2.0 Via: SIP/2.0/WSS 192.0.2.154;branch=z9hG4bK6711416 To: <sip:102030@rus.cz> From: "2022207" sip:2022207@rus**.cz;tag=3gfrdlvq0a CSeq: 2 INVITE Call-ID: g6b3qfbnspnfutm0ourb Max-Forwards: 70 Authorization: Digest algorithm=MD5, username="2022207", realm="asterisk", nonce="1658371213/1f35983509e52b3b65de72297d43af73", uri="sip:102030@rus**.cz", response="d82d05398520c81e2157ac09c99429e5", opaque="50f921b24d528899", qop=auth, cnonce="4662ikper2a2", nc=00000001 Contact: sip:v2n48i5t@192.0.2.154;transport=wss;ob Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER Supported: outbound User-Agent: Browser Phone 0.3.8 (SIPJS - 0.20.0) Content-Type: application/sdp Content-Length: 2613
v=0 o=- 2667082863342222819 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE 0 a=msid-semantic: WMS 820f49f4-7e18-4570-a9bd-eecfe385ebca m=audio 45439 UDP/TLS/RTP/SAVPF 111 103 9 0 8 105 13 110 113 126 c=IN IP4 204.44.96.131 a=rtcp:9 IN IP4 0.0.0.0 a=candidate:4078256983 1 udp 2122262783 2408:8234:9c13:3d0:e4bf:40c2:8c9c:3d53 53982 typ host generation 0 network-id 3 network-cost 10 a=candidate:3868393361 1 udp 2122194687 192.168.1.157 45439 typ host generation 0 network-id 2 network-cost 10 a=candidate:2762220737 1 udp 2122129151 198.18.58.215 41690 typ host generation 0 network-id 1 network-cost 50 a=candidate:3180773287 1 tcp 1518283007 2408:8234:9c13:3d0:e4bf:40c2:8c9c:3d53 9 typ host tcptype active generation 0 network-id 3 network-cost 10 a=candidate:2819687265 1 tcp 1518214911 192.168.1.157 9 typ host tcptype active generation 0 network-id 2 network-cost 10 a=candidate:3928479793 1 tcp 1518149375 198.18.58.215 9 typ host tcptype active generation 0 network-id 1 network-cost 50 a=candidate:1742403877 1 udp 1685987071 204.44.96.131 45439 typ srflx raddr 192.168.1.157 rport 45439 generation 0 network-id 2 network-cost 10 a=candidate:636232309 1 udp 1685921535 204.44.96.131 41690 typ srflx raddr 198.18.58.215 rport 41690 generation 0 network-id 1 network-cost 50 a=ice-ufrag:gzyw a=ice-pwd:f2SfVyTIG7bjEy0e51xgi0yo a=ice-options:trickle a=fingerprint:sha-256 33:B3:E0:AC:A6:53:61:4E:16:41:9C:6C:CD:87:26:4D:D7:83:A7:0B:84:B0:66:B1:6B:AB:08:1E:2E:DF:7B:89 a=setup:actpass a=mid:0 a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id a=sendrecv a=msid:820f49f4-7e18-4570-a9bd-eecfe385ebca a50fe8a8-5be9-40d5-8195-73738d491b22 a=rtcp-mux a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10;useinbandfec=1 a=rtpmap:103 ISAC/16000 a=rtpmap:9 G722/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:105 CN/16000 a=rtpmap:13 CN/8000 a=rtpmap:110 telephone-event/48000 a=rtpmap:113 telephone-event/16000 a=rtpmap:126 telephone-event/8000 a=ssrc:2126563126 cname:g6J6Y49/5yPjCW3i a=ssrc:2126563126 msid:820f49f4-7e18-4570-a9bd-eecfe385ebca a50fe8a8-5be9-40d5-8195-73738d491b22 a=ssrc:2126563126 mslabel:820f49f4-7e18-4570-a9bd-eecfe385ebca a=ssrc:2126563126 label:a50fe8a8-5be9-40d5-8195-73738d491b22
<--- Transmitting SIP response (305 bytes) to WSS:204.44.96.131:17566 ---> SIP/2.0 100 Trying Via: SIP/2.0/WSS 192.0.2.154;rport=17566;received=204.44.96.131;branch=z9hG4bK6711416 Call-ID: g6b3qfbnspnfutm0ourb From: "2022207" sip:2022207@rus**.cz;tag=3gfrdlvq0a To: sip:102030@rus**.cz CSeq: 2 INVITE Server: FPBX-16.0.21.3(16.25.0) Content-Length: 0
[2022-07-21 02:40:14] ERROR[13295]: res_pjsip_session.c:937 handle_incoming_sdp: 2022207: Couldn't negotiate stream 0:audio-0:audio:sendrecv (nothing) <--- Transmitting SIP response (359 bytes) to WSS:204.44.96.131:17566 ---> SIP/2.0 488 Not Acceptable Here Via: SIP/2.0/WSS 192.0.2.154;rport=17566;received=204.44.96.131;branch=z9hG4bK6711416 Call-ID: g6b3qfbnspnfutm0ourb From: "2022207" sip:2022207@rus**.cz;tag=3gfrdlvq0a To: sip:102030@rus**.cz;tag=52756495-fe6e-460a-9ff5-1b36a702a31c CSeq: 2 INVITE Server: FPBX-16.0.21.3(16.25.0) Content-Length: 0
<--- Received SIP request (312 bytes) from WSS:204.44.96.131:17566 ---> ACK sip:102030@rus.cz SIP/2.0 Via: SIP/2.0/WSS 192.0.2.154;branch=z9hG4bK6711416 To: <sip:102030@rus.cz>;tag=52756495-fe6e-460a-9ff5-1b36a702a31c From: "2022207" sip:2022207@rus**.cz;tag=3gfrdlvq0a Call-ID: g6b3qfbnspnfutm0ourb CSeq: 2 ACK Max-Forwards: 70 Content-Length: 0
<--- Transmitting SIP request (492 bytes) to WSS:204.44.96.131:17566 ---> OPTIONS sip:v2n48i5t@204.44.96.131:17566;transport=ws SIP/2.0 Via: SIP/2.0/WSS 31.42.177.246:8089;rport;branch=z9hG4bKPj9d444316-e774-4389-b6a9-5f8e7484b300;alias From: sip:2022207@freepbx.sangoma.local;tag=9d12c91b-6517-40c2-8d28-951ec7a603f7 To: sip:v2n48i5t@204.44.96.131 Contact: sip:2022207@freepbx.sangoma.local:5060;transport=ws Call-ID: 92dc9595-f8a6-45d1-9d86-e8248f07c12f CSeq: 50664 OPTIONS Max-Forwards: 70 User-Agent: FPBX-16.0.21.3(16.25.0) Content-Length: 0
<--- Received SIP response (548 bytes) from WSS:204.44.96.131:17566 ---> SIP/2.0 200 OK Via: SIP/2.0/WSS 31.42.177.246:8089;rport;branch=z9hG4bKPj9d444316-e774-4389-b6a9-5f8e7484b300;alias From: sip:2022207@freepbx.sangoma.local;tag=9d12c91b-6517-40c2-8d28-951ec7a603f7 To: sip:v2n48i5t@204.44.96.131;tag=3t7bjv3li4 CSeq: 50664 OPTIONS Call-ID: 92dc9595-f8a6-45d1-9d86-e8248f07c12f Supported: outbound User-Agent: Browser Phone 0.3.8 (SIPJS - 0.20.0) Allow: ACK,BYE,CANCEL,INFO,INVITE,MESSAGE,NOTIFY,OPTIONS,PRACK,REFER,REGISTER,SUBSCRIBE Accept: application/sdp,application/dtmf-relay Content-Length: 0