Stream RTSP stream from IP camera via Kurento Media Server over WebRTC - webrtc

I have to create a WebRTC solution where I have multiple IP camera in a private network and have to stream the feeds to a mobile application outside the network. I am using Kurento Media Server to help me generate a WebRTC stream from the RTSP stream from the camera. I have installed KMS(Kurento Media Server) in the private network as well.
I followed a similar setup to https://github.com/lulop-k/kurento-rtsp2webrtc except for the fact that I created a pipeline with a PlayerEndpoint with the camera stream URI and a WebRTCEndpoint connected to it as shown below.
function playCam(message){
console.log("Message:" + JSON.stringify(message));
var cam_url = message.cam_url;
var sdpOffer = message.sdpOffer;
getKurentoClient(function(error, kurentoClient) {
console.log("Kurento client created.");
kurentoClient.create('MediaPipeline', function(error, pipeline) {
if (error) {
console.log("Error: Creating Media Pipeline failed.");
stop(pipeline);
return;
}
console.log("Pipeline created.");
pipeline.create("PlayerEndpoint", {uri: cam_url}, function(error, player){
if(error) {
console.log("Error: Creating PlayerEndpoint failed.");
stop(pipeline);
return;
}
console.log("PlayerEndpoint created.");
pipeline.create("WebRtcEndpoint", function(error, webRtcEndpoint){
remoteWebRtcEndpoint = webRtcEndpoint;
console.log("WebRtcEndpoint created.");
webRtcEndpoint.processOffer(sdpOffer, function(error, sdpAnswer){
sendSdpAnswer(sdpAnswer);
for(var i = 0; i < remoteCandidates.length; i++){
addIceRemoteCandidate(remoteCandidates[i]);
}
webRtcEndpoint.gatherCandidates(function(error) {
console.log("Gathering Ice candidates created.");
});
});
player.connect(webRtcEndpoint, function(error){
console.log("PlayerEndpoint-->WebRtcEndpoint connection established");
player.play(function(error){
console.log("Player playing ...");
});
});
webRtcEndpoint.on('OnIceCandidate', function(event) {
console.log(JSON.stringify(event));
var candidate = kurento.getComplexType('IceCandidate')(event.candidate);
sendIceCandidate(candidate);
});
});
});
});
});
}
I used a web socket in the cloud to signal sdpOffer, sdpAnswer, iceCandidate messages.
At the client side I have the javascript implementation that uses a WebRTC Peer as shown below.
var ws = new WebSocket(ws.url);
var webRtcPeer;
ws.onmessage = function(message) {
var parsedMessage = JSON.parse(message.data);
switch (parsedMessage.id) {
case 'iceCandidate':
webRtcPeer.addIceCandidate(parsedMessage.candidate)
break;
case 'sdpAnswer':
webRtcPeer.processAnswer(parsedMessage.sdpAnswer);
break;
default:
onError('Unrecognized message', parsedMessage);
}
}
window.addEventListener('load', function(){
var videoOutput = document.getElementById('videoOutput');
var address = camera_rtsp_stream_url;
var pipeline;
function start() {
var options = {
remoteVideo : videoOutput,
configuration: {
iceServers:[
{ "url": turn_url,
"username": uname,
"credential": pass
}
]
}
};
webRtcPeer = kurentoUtils.WebRtcPeer.WebRtcPeerRecvonly(options,
function(error){
webRtcPeer.generateOffer(onOffer);
setIceCandidateCallbacks();
});
}
function onOffer(error, sdpOffer){
var message = {
id : 'sdpOffer',
name: 'peer',
cam_url: address,
sdpOffer : sdpOffer
};
sendMessage(message);
}
});
function sendMessage(message) {
var jsonMessage = JSON.stringify(message);
ws.send(jsonMessage);
}
function setIceCandidateCallbacks(){
webRtcPeer.on('icecandidate', function(candidate){
candidate = kurentoClient.register.complexTypes.IceCandidate(candidate);
var message = {
id : 'iceCandidate',
name: 'peer',
iceCandidate : candidate
};
sendMessage(message);
});
}
Still the feed is not working in page. However, the example in the git repo works perfect. Is there something I am missing.
Thanks in advance.
Edit:
This is my SDP Offer.
v=0
o=- 62767501284085133 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio video
a=msid-semantic: WMS
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:AoAe
a=ice-pwd:tp+DQSO/OTvBaDZYQOmb5Yxe
a=fingerprint:sha-256 14:03:6A:CB:9D:86:B5:57:09:30:97:D8:0A:0E:59:A2:0F:8D:5F:24:46:3E:14:C7:D3:23:B2:11:39:4C:61:33
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=recvonly
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: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:126 telephone-event/8000
m=video 9 UDP/TLS/RTP/SAVPF 100 101 107 116 117 96 97 99 98
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:AoAe
a=ice-pwd:tp+DQSO/OTvBaDZYQOmb5Yxe
a=fingerprint:sha-256 14:03:6A:CB:9D:86:B5:57:09:30:97:D8:0A:0E:59:A2:0F:8D:5F:24:46:3E:14:C7:D3:23:B2:11:39:4C:61:33
a=setup:actpass
a=mid:video
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:3gpp:video-orientation
a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 transport-cc
a=rtpmap:101 VP9/90000
a=rtcp-fb:101 ccm fir
a=rtcp-fb:101 nack
a=rtcp-fb:101 nack pli
a=rtcp-fb:101 goog-remb
a=rtcp-fb:101 transport-cc
a=rtpmap:107 H264/90000
a=rtcp-fb:107 ccm fir
a=rtcp-fb:107 nack
a=rtcp-fb:107 nack pli
a=rtcp-fb:107 goog-remb
a=rtcp-fb:107 transport-cc
a=fmtp:107 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:116 red/90000
a=rtpmap:117 ulpfec/90000
a=rtpmap:96 rtx/90000
a=fmtp:96 apt=100
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=101
a=rtpmap:99 rtx/90000
a=fmtp:99 apt=107
a=rtpmap:98 rtx/90000
a=fmtp:98 apt=116
SDP Answer is as shown below:
v=0
o=- 3687061549 3687061549 IN IP4 0.0.0.0
s=Kurento Media Server
c=IN IP4 0.0.0.0
t=0 0
a=msid-semantic: WMS
a=group:BUNDLE audio video
m=audio 1 UDP/TLS/RTP/SAVPF 111 0
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=mid:audio
a=rtcp:9 IN IP4 0.0.0.0
a=rtpmap:111 opus/48000/2
a=rtpmap:0 PCMU/8000
a=setup:active
a=sendonly
a=rtcp-mux
a=fmtp:111 minptime=10;useinbandfec=1
a=ssrc:174718429 cname:user1410268339#host-e518075a
a=ice-ufrag:Y1e8
a=ice-pwd:rLobIsorf9OWA8VkEvGbJN
a=fingerprint:sha-256 EF:8B:94:E4:CF:2A:82:BD:2D:07:F6:35:B8:2A:4C:4A:7F:A5:8D:FE:06:5F:38:6C:E7:F8:10:07:3C:11:E1:28
m=video 1 UDP/TLS/RTP/SAVPF 100
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=mid:video
a=rtcp:9 IN IP4 0.0.0.0
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=setup:active
a=sendonly
a=rtcp-mux
a=ssrc:3344771 cname:user1410268339#host-e518075a
a=ice-ufrag:Y1e8
a=ice-pwd:rLobIsorf9OWA8VkEvGbJN
a=fingerprint:sha-256 EF:8B:94:E4:CF:2A:82:BD:2D:07:F6:35:B8:2A:4C:4A:7F:A5:8D:FE:06:5F:38:6C:E7:F8:10:07:3C:11:E1:28

Related

Unable to make a call form JSSIP to my phone number and I have the CTI server credentials

I am working on CTI project I want to create cti phone for my company that can work fine with the company requirement, currently I am using following code for making call.
const JsSIP = require('jssip');
const NodeWebSocket = require('jssip-node-websocket');
const {execSync} = require('child_process');
JsSIP.debug.enable('JsSIP:*');
JsSIP.debug.enable('*');
function getAudioElement(id: string): HTMLAudioElement {
const el = document.getElementById(id);
if (!(el instanceof HTMLAudioElement)) {
throw new Error(`Element "${id}" not found or not an audio element.`);
}
return el;
}
async function wait(ms: number): Promise<void> {
return new Promise((resolve) => {
setTimeout(resolve, ms);
});
}
function main() {
var socket = new JsSIP.WebSocketInterface('wss://PBX_server');
var configuration = {
sockets : [ socket ],
uri : 'sip:user#realm',
password : 'pass'
hack_ip_in_contact: true
};
var ua = new JsSIP.UA(configuration);
var currentSession;
ua.on('newRTCSession', function(e) {
console.log("New Webrtc session created!");
currentSession = e.session;
});
ua.start();
var eventHandlers = {
'progress': function(e) {
console.log('call is in progress');
},
'failed': function(e) {
console.log('call failed with cause: '+ e.cause);
},
'ended': function(e) {
console.log('call ended with cause: '+ e.cause);
},
'confirmed': function(e) {
console.log('call confirmed');
}
};
var options = {
'eventHandlers' : eventHandlers,
'mediaConstraints' : { 'audio': true, 'video': true }
};
var session = ua.call('sip:+923235037548#realm', options);
}
main();
after the call method I get following logs.
common.js:113 JsSIP:WebSocketInterface new() [url:"wss://sips_erver"] +0ms
common.js:113 JsSIP:UA new() [configuration:Object] +0ms
common.js:113 JsSIP:Transport new() +0ms
common.js:113 JsSIP:UA configuration parameters after validation: +5ms
common.js:113 JsSIP:UA - authorization_user: "user" +0ms
common.js:113 JsSIP:UA - password: NOT SHOWN +0ms
common.js:113 JsSIP:UA - realm: null +0ms
common.js:113 JsSIP:UA - ha1: NOT SHOWN +1ms
common.js:113 JsSIP:UA - authorization_jwt: NOT SHOWN +0ms
common.js:113 JsSIP:UA - display_name: null +0ms
common.js:113 JsSIP:UA - uri: sip:user#realm +0ms
common.js:113 JsSIP:UA - contact_uri: {"_parameters":{"transport":"ws"},"_headers":{},"_scheme":"sip","_user":"kph8or3c","_host":"aic3ao0nhgpg.invalid","_port":null} +0ms
common.js:113 JsSIP:UA - instance_id: "2508be13-bf62-43eb-a096-1f2f6a5c7de6" +0ms
common.js:113 JsSIP:UA - use_preloaded_route: true +0ms
common.js:113 JsSIP:UA - session_timers: true +0ms
common.js:113 JsSIP:UA - session_timers_refresh_method: "UPDATE" +0ms
common.js:113 JsSIP:UA - session_timers_force_refresher: false +1ms
common.js:113 JsSIP:UA - no_answer_timeout: 60000 +0ms
common.js:113 JsSIP:UA - register: true +0ms
common.js:113 JsSIP:UA - register_expires: 600 +0ms
common.js:113 JsSIP:UA - registrar_server: sip:realm +0ms
common.js:113 JsSIP:UA - connection_recovery_max_interval: 30 +0ms
common.js:113 JsSIP:UA - connection_recovery_min_interval: 2 +0ms
common.js:113 JsSIP:UA - via_host: "aic3ao0nhgpg.invalid" +0ms
common.js:113 JsSIP:UA start() +1ms
common.js:113 JsSIP:Transport connect() +5ms
common.js:113 JsSIP:WebSocketInterface connect() +12ms
common.js:113 JsSIP:WebSocketInterface connecting to WebSocket wss://sips_erver +0ms
common.js:113 JsSIP:UA call() +2ms
common.js:113 JsSIP:RTCSession new +0ms
common.js:113 JsSIP:RTCSession connect() +1ms
common.js:113 JsSIP:RTCSession emit "peerconnection" +12ms
common.js:113 JsSIP:RTCSession newRTCSession() +0ms
index.ts:76 New Webrtc session created!
contentScript.bundle.js:2 Uncaught (in promise) Object
common.js:113 JsSIP:WebSocketInterface WebSocket wss://sips_erver connected +4s
common.js:113 JsSIP:Transport send() +4s
common.js:113 JsSIP:Transport sending message:REGISTER sip:realm SIP/2.0
Route: <sip:sips_erver;transport=ws;lr>
Via: SIP/2.0/WSS aic3ao0nhgpg.invalid;branch=z9hG4bK9003902
Max-Forwards: 69
To: <sip:user#realm>
From: <sip:user#realm>;tag=bueer4e9s2
Call-ID: iaevuq10ujqmtlkgv46rgu
CSeq: 1 REGISTER
Contact: <sip:kph8or3c#aic3ao0nhgpg.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:2508be13-bf62-43eb-a096-1f2f6a5c7de6>";expires=600
Expires: 600
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
Supported: path,gruu,outbound
User-Agent: JsSIP 3.9.1
Content-Length: 0
+1ms
common.js:113 JsSIP:WebSocketInterface send() +3ms
common.js:113 JsSIP:WebSocketInterface received WebSocket message +195ms
common.js:113 JsSIP:Transport received text message:SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/WSS aic3ao0nhgpg.invalid;branch=z9hG4bK9003902
Proxy-Authenticate: Digest realm="realm",algorithm=MD5,nonce="1662070943:2bc3d57c75de600f76480a7e570a82cd",opaque="6465766963652e613233393935373531",qop="auth"
To: <sip:user#realm>;tag=3_uTW3IPsEY.
From: <sip:user#realm>;tag=bueer4e9s2
Call-ID: iaevuq10ujqmtlkgv46rgu
CSeq: 1 REGISTER
Content-Length: 0
+195ms
common.js:113 JsSIP:DigestAuthentication authenticate() | using qop=auth [a2:"REGISTER:sip:realm"] +0ms
common.js:113 JsSIP:DigestAuthentication authenticate() | response generated +2ms
common.js:113 JsSIP:Transport send() +28ms
common.js:113 JsSIP:Transport sending message:REGISTER sip:realm SIP/2.0
Route: <sip:sips_erver;transport=ws;lr>
Via: SIP/2.0/WSS aic3ao0nhgpg.invalid;branch=z9hG4bK6872321
Max-Forwards: 69
To: <sip:user#realm>
From: <sip:user#realm>;tag=bueer4e9s2
Call-ID: iaevuq10ujqmtlkgv46rgu
CSeq: 2 REGISTER
Proxy-Authorization: Digest algorithm=MD5, username="user", realm="realm", nonce="1662070943:2bc3d57c75de600f76480a7e570a82cd", uri="sip:realm", response="5df9943ccb8a5aed183f472c61d9c50a", opaque="6465766963652e613233393935373531", qop=auth, cnonce="i1u09jm547vs", nc=00000001
Contact: <sip:kph8or3c#aic3ao0nhgpg.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:2508be13-bf62-43eb-a096-1f2f6a5c7de6>";expires=600
Expires: 600
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
Supported: path,gruu,outbound
User-Agent: JsSIP 3.9.1
Content-Length: 0
+0ms
common.js:113 JsSIP:WebSocketInterface send() +28ms
common.js:113 JsSIP:WebSocketInterface received WebSocket message +279ms
common.js:113 JsSIP:Transport received text message:SIP/2.0 200 OK
Via: SIP/2.0/WSS aic3ao0nhgpg.invalid;branch=z9hG4bK6872321
Require: outbound
Contact: <sip:kph8or3c#aic3ao0nhgpg.invalid;transport=ws>;expires=600;reg-id=1;+sip.instance="<urn:uuid:2508be13-bf62-43eb-a096-1f2f6a5c7de6>";pub-gruu="sip:user#realm;gr=oburn:uuid:2508be13-bf62-43eb-a096-1f2f6a5c7de6";temp-gruu="sip:user#realm;gr=oburn:uuid:2508be13-bf62-43eb-a096-1f2f6a5c7de6";+sip.ice;flow-id=1;gruu="sip:user#realm;gr=oburn:uuid:2508be13-bf62-43eb-a096-1f2f6a5c7de6"
Contact: <sip:user#135.181.57.98:59771;ob;transport=TLS>;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-0000-0000-00002116c300>";expires=210;flow-id=1
To: <sip:user#realm>;tag=7CQtXkDLVbIhAA..
From: <sip:user#realm>;tag=bueer4e9s2
Call-ID: iaevuq10ujqmtlkgv46rgu
CSeq: 2 REGISTER
Flow-Timer: 30
Content-Length: 0
+279ms
common.js:113 JsSIP:RTCSession session connecting +5s
common.js:113 JsSIP:RTCSession emit "connecting" +0ms
common.js:113 JsSIP:RTCSession createLocalDescription() +0ms
common.js:113 JsSIP:RTCSession emit "sdp" +132ms
common.js:113 JsSIP:RTCSession emit "sending" [request:InitialOutgoingInviteRequest] +0ms
common.js:113 JsSIP:Transport send() +996ms
common.js:113 JsSIP:Transport sending message:INVITE sip:+923235037548#realm SIP/2.0
Route: <sip:sips_erver;transport=ws;lr>
Via: SIP/2.0/WSS aic3ao0nhgpg.invalid;branch=z9hG4bK6354034
Max-Forwards: 69
To: <sip:+923235037548#realm>
From: <sip:user#realm>;tag=d5p8tdji4d
Call-ID: 7ilh4875rfrqdq30k0f5
CSeq: 1468 INVITE
Contact: <sip:kph8or3c#aic3ao0nhgpg.invalid;transport=ws;ob>
Content-Type: application/sdp
Session-Expires: 90
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
Supported: timer,gruu,ice,replaces,outbound
User-Agent: JsSIP 3.9.1
Content-Length: 6666
v=0
o=- 3179881977689588009 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=extmap-allow-mixed
a=msid-semantic: WMS rFgyXrRpaRkNUFrMwEEmuA6k551YE3si8400
m=audio 49400 UDP/TLS/RTP/SAVPF 111 63 103 104 9 0 8 106 105 13 110 112 113 126
c=IN IP4 192.168.224.1
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:2868209204 1 udp 2122260223 192.168.224.1 49400 typ host generation 0 network-id 1
a=candidate:4200540781 1 udp 2122194687 192.168.18.28 49401 typ host generation 0 network-id 2 network-cost 10
a=candidate:3832978116 1 tcp 1518280447 192.168.224.1 9 typ host tcptype active generation 0 network-id 1
a=candidate:3034371741 1 tcp 1518214911 192.168.18.28 9 typ host tcptype active generation 0 network-id 2 network-cost 10
a=ice-ufrag:uM69
a=ice-pwd:Lv0QIGDWNe6ivMv8kAJMJ5VM
a=ice-options:trickle
a=fingerprint:sha-256 A1:EA:2E:13:DB:9C:61:EA:11:DB:4E:21:EE:28:C3:B3:B6:CC:E0:E3:0B:8C:FD:F1:A2:50:0A:CA:F0:FF:4E:A0
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:rFgyXrRpaRkNUFrMwEEmuA6k551YE3si8400 4a36b04b-b141-4ac9-bf5e-bc901782d124
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:2855336486 cname:PU+8Yc7wb7+U9BBI
a=ssrc:2855336486 msid:rFgyXrRpaRkNUFrMwEEmuA6k551YE3si8400 4a36b04b-b141-4ac9-bf5e-bc901782d124
m=video 49402 UDP/TLS/RTP/SAVPF 96 97 127 121 125 107 108 109 124 120 123 119 35 36 41 42 98 99 100 101 114 115 116 117 118
c=IN IP4 192.168.224.1
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:2868209204 1 udp 2122260223 192.168.224.1 49402 typ host generation 0 network-id 1
a=candidate:4200540781 1 udp 2122194687 192.168.18.28 49403 typ host generation 0 network-id 2 network-cost 10
a=candidate:3832978116 1 tcp 1518280447 192.168.224.1 9 typ host tcptype active generation 0 network-id 1
a=candidate:3034371741 1 tcp 1518214911 192.168.18.28 9 typ host tcptype active generation 0 network-id 2 network-cost 10
a=ice-ufrag:uM69
a=ice-pwd:Lv0QIGDWNe6ivMv8kAJMJ5VM
a=ice-options:trickle
a=fingerprint:sha-256 A1:EA:2E:13:DB:9C:61:EA:11:DB:4E:21:EE:28:C3:B3:B6:CC:E0:E3:0B:8C:FD:F1:A2:50:0A:CA:F0:FF:4E:A0
a=setup:actpass
a=mid:1
a=extmap:14 urn:ietf:params:rtp-hdrext:toffset
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:13 urn:3gpp:video-orientation
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=sendrecv
a=msid:rFgyXrRpaRkNUFrMwEEmuA6k551YE3si8400 0bbe7300-5c36-459f-b66d-65a069ba7dcf
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 transport-cc
a=rtcp-fb:96 ccm fir
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
a=rtpmap:127 H264/90000
a=rtcp-fb:127 goog-remb
a=rtcp-fb:127 transport-cc
a=rtcp-fb:127 ccm fir
a=rtcp-fb:127 nack
a=rtcp-fb:127 nack pli
a=fmtp:127 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f
a=rtpmap:121 rtx/90000
a=fmtp:121 apt=127
a=rtpmap:125 H264/90000
a=rtcp-fb:125 goog-remb
a=rtcp-fb:125 transport-cc
a=rtcp-fb:125 ccm fir
a=rtcp-fb:125 nack
a=rtcp-fb:125 nack pli
a=fmtp:125 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f
a=rtpmap:107 rtx/90000
a=fmtp:107 apt=125
a=rtpmap:108 H264/90000
a=rtcp-fb:108 goog-remb
a=rtcp-fb:108 transport-cc
a=rtcp-fb:108 ccm fir
a=rtcp-fb:108 nack
a=rtcp-fb:108 nack pli
a=fmtp:108 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:109 rtx/90000
a=fmtp:109 apt=108
a=rtpmap:124 H264/90000
a=rtcp-fb:124 goog-remb
a=rtcp-fb:124 transport-cc
a=rtcp-fb:124 ccm fir
a=rtcp-fb:124 nack
a=rtcp-fb:124 nack pli
a=fmtp:124 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f
a=rtpmap:120 rtx/90000
a=fmtp:120 apt=124
a=rtpmap:123 H264/90000
a=rtcp-fb:123 goog-remb
a=rtcp-fb:123 transport-cc
a=rtcp-fb:123 ccm fir
a=rtcp-fb:123 nack
a=rtcp-fb:123 nack pli
a=fmtp:123 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d001f
a=rtpmap:119 rtx/90000
a=fmtp:119 apt=123
a=rtpmap:35 H264/90000
a=rtcp-fb:35 goog-remb
a=rtcp-fb:35 transport-cc
a=rtcp-fb:35 ccm fir
a=rtcp-fb:35 nack
a=rtcp-fb:35 nack pli
a=fmtp:35 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=4d001f
a=rtpmap:36 rtx/90000
a=fmtp:36 apt=35
a=rtpmap:41 AV1/90000
a=rtcp-fb:41 goog-remb
a=rtcp-fb:41 transport-cc
a=rtcp-fb:41 ccm fir
a=rtcp-fb:41 nack
a=rtcp-fb:41 nack pli
a=rtpmap:42 rtx/90000
a=fmtp:42 apt=41
a=rtpmap:98 VP9/90000
a=rtcp-fb:98 goog-remb
a=rtcp-fb:98 transport-cc
a=rtcp-fb:98 ccm fir
a=rtcp-fb:98 nack
a=rtcp-fb:98 nack pli
a=fmtp:98 profile-id=0
a=rtpmap:99 rtx/90000
a=fmtp:99 apt=98
a=rtpmap:100 VP9/90000
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 transport-cc
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=fmtp:100 profile-id=2
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=100
a=rtpmap:114 H264/90000
a=rtcp-fb:114 goog-remb
a=rtcp-fb:114 transport-cc
a=rtcp-fb:114 ccm fir
a=rtcp-fb:114 nack
a=rtcp-fb:114 nack pli
a=fmtp:114 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=64001f
a=rtpmap:115 rtx/90000
a=fmtp:115 apt=114
a=rtpmap:116 red/90000
a=rtpmap:117 rtx/90000
a=fmtp:117 apt=116
a=rtpmap:118 ulpfec/90000
a=ssrc-group:FID 3849983765 2848192372
a=ssrc:3849983765 cname:PU+8Yc7wb7+U9BBI
a=ssrc:3849983765 msid:rFgyXrRpaRkNUFrMwEEmuA6k551YE3si8400 0bbe7300-5c36-459f-b66d-65a069ba7dcf
a=ssrc:2848192372 cname:PU+8Yc7wb7+U9BBI
a=ssrc:2848192372 msid:rFgyXrRpaRkNUFrMwEEmuA6k551YE3si8400 0bbe7300-5c36-459f-b66d-65a069ba7dcf
+1ms
common.js:113 JsSIP:WebSocketInterface send() +997ms
common.js:113 JsSIP:WebSocketInterface received WebSocket message +233ms
common.js:113 JsSIP:Transport received text message:SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/WSS aic3ao0nhgpg.invalid;branch=z9hG4bK6354034
Proxy-Authenticate: Digest realm="realm",algorithm=MD5,nonce="1662070945:efa19eeed9ddfb207d74ef8ec19efc90",opaque="6465766963652e613233393935373531",qop="auth"
To: <sip:+923235037548#realm>;tag=q57zNvS6vkY.
From: <sip:user#realm>;tag=d5p8tdji4d
Call-ID: 7ilh4875rfrqdq30k0f5
CSeq: 1468 INVITE
Content-Length: 0
+233ms
common.js:113 JsSIP:Transport send() +2ms
common.js:113 JsSIP:Transport sending message:ACK sip:+923235037548#realm SIP/2.0
Route: <sip:sips_erver;transport=ws;lr>
Via: SIP/2.0/WSS aic3ao0nhgpg.invalid;branch=z9hG4bK6354034
Max-Forwards: 69
To: <sip:+923235037548#realm>;tag=q57zNvS6vkY.
From: <sip:user#realm>;tag=d5p8tdji4d
Call-ID: 7ilh4875rfrqdq30k0f5
CSeq: 1468 ACK
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
Supported: outbound
User-Agent: JsSIP 3.9.1
Content-Length: 0
+0ms
common.js:113 JsSIP:WebSocketInterface send() +2ms
common.js:113 JsSIP:DigestAuthentication authenticate() | using qop=auth [a2:"INVITE:sip:+923235037548#realm"] +2s
common.js:113 JsSIP:DigestAuthentication authenticate() | response generated +1ms
common.js:113 JsSIP:Transport send() +1ms
common.js:113 JsSIP:Transport sending message:INVITE sip:+923235037548#realm SIP/2.0
Route: <sip:sips_erver;transport=ws;lr>
Via: SIP/2.0/WSS aic3ao0nhgpg.invalid;branch=z9hG4bK5475645
Max-Forwards: 69
To: <sip:+923235037548#realm>
From: <sip:user#realm>;tag=d5p8tdji4d
Call-ID: 7ilh4875rfrqdq30k0f5
CSeq: 1469 INVITE
Proxy-Authorization: Digest algorithm=MD5, username="user", realm="realm", nonce="1662070945:efa19eeed9ddfb207d74ef8ec19efc90", uri="sip:+923235037548#realm", response="b0c42fb27c55b2de69f64a2168f6a24b", opaque="6465766963652e613233393935373531", qop=auth, cnonce="cokk9v6ljlal", nc=00000001
Contact: <sip:kph8or3c#aic3ao0nhgpg.invalid;transport=ws;ob>
Content-Type: application/sdp
Session-Expires: 90
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
Supported: timer,gruu,ice,replaces,outbound
User-Agent: JsSIP 3.9.1
Content-Length: 6666
v=0
o=- 3179881977689588009 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=extmap-allow-mixed
a=msid-semantic: WMS rFgyXrRpaRkNUFrMwEEmuA6k551YE3si8400
m=audio 49400 UDP/TLS/RTP/SAVPF 111 63 103 104 9 0 8 106 105 13 110 112 113 126
c=IN IP4 192.168.224.1
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:2868209204 1 udp 2122260223 192.168.224.1 49400 typ host generation 0 network-id 1
a=candidate:4200540781 1 udp 2122194687 192.168.18.28 49401 typ host generation 0 network-id 2 network-cost 10
a=candidate:3832978116 1 tcp 1518280447 192.168.224.1 9 typ host tcptype active generation 0 network-id 1
a=candidate:3034371741 1 tcp 1518214911 192.168.18.28 9 typ host tcptype active generation 0 network-id 2 network-cost 10
a=ice-ufrag:uM69
a=ice-pwd:Lv0QIGDWNe6ivMv8kAJMJ5VM
a=ice-options:trickle
a=fingerprint:sha-256 A1:EA:2E:13:DB:9C:61:EA:11:DB:4E:21:EE:28:C3:B3:B6:CC:E0:E3:0B:8C:FD:F1:A2:50:0A:CA:F0:FF:4E:A0
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:rFgyXrRpaRkNUFrMwEEmuA6k551YE3si8400 4a36b04b-b141-4ac9-bf5e-bc901782d124
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:2855336486 cname:PU+8Yc7wb7+U9BBI
a=ssrc:2855336486 msid:rFgyXrRpaRkNUFrMwEEmuA6k551YE3si8400 4a36b04b-b141-4ac9-bf5e-bc901782d124
m=video 49402 UDP/TLS/RTP/SAVPF 96 97 127 121 125 107 108 109 124 120 123 119 35 36 41 42 98 99 100 101 114 115 116 117 118
c=IN IP4 192.168.224.1
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:2868209204 1 udp 2122260223 192.168.224.1 49402 typ host generation 0 network-id 1
a=candidate:4200540781 1 udp 2122194687 192.168.18.28 49403 typ host generation 0 network-id 2 network-cost 10
a=candidate:3832978116 1 tcp 1518280447 192.168.224.1 9 typ host tcptype active generation 0 network-id 1
a=candidate:3034371741 1 tcp 1518214911 192.168.18.28 9 typ host tcptype active generation 0 network-id 2 network-cost 10
a=ice-ufrag:uM69
a=ice-pwd:Lv0QIGDWNe6ivMv8kAJMJ5VM
a=ice-options:trickle
a=fingerprint:sha-256 A1:EA:2E:13:DB:9C:61:EA:11:DB:4E:21:EE:28:C3:B3:B6:CC:E0:E3:0B:8C:FD:F1:A2:50:0A:CA:F0:FF:4E:A0
a=setup:actpass
a=mid:1
a=extmap:14 urn:ietf:params:rtp-hdrext:toffset
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:13 urn:3gpp:video-orientation
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=sendrecv
a=msid:rFgyXrRpaRkNUFrMwEEmuA6k551YE3si8400 0bbe7300-5c36-459f-b66d-65a069ba7dcf
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 transport-cc
a=rtcp-fb:96 ccm fir
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
a=rtpmap:127 H264/90000
a=rtcp-fb:127 goog-remb
a=rtcp-fb:127 transport-cc
a=rtcp-fb:127 ccm fir
a=rtcp-fb:127 nack
a=rtcp-fb:127 nack pli
a=fmtp:127 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f
a=rtpmap:121 rtx/90000
a=fmtp:121 apt=127
a=rtpmap:125 H264/90000
a=rtcp-fb:125 goog-remb
a=rtcp-fb:125 transport-cc
a=rtcp-fb:125 ccm fir
a=rtcp-fb:125 nack
a=rtcp-fb:125 nack pli
a=fmtp:125 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f
a=rtpmap:107 rtx/90000
a=fmtp:107 apt=125
a=rtpmap:108 H264/90000
a=rtcp-fb:108 goog-remb
a=rtcp-fb:108 transport-cc
a=rtcp-fb:108 ccm fir
a=rtcp-fb:108 nack
a=rtcp-fb:108 nack pli
a=fmtp:108 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:109 rtx/90000
a=fmtp:109 apt=108
a=rtpmap:124 H264/90000
a=rtcp-fb:124 goog-remb
a=rtcp-fb:124 transport-cc
a=rtcp-fb:124 ccm fir
a=rtcp-fb:124 nack
a=rtcp-fb:124 nack pli
a=fmtp:124 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f
a=rtpmap:120 rtx/90000
a=fmtp:120 apt=124
a=rtpmap:123 H264/90000
a=rtcp-fb:123 goog-remb
a=rtcp-fb:123 transport-cc
a=rtcp-fb:123 ccm fir
a=rtcp-fb:123 nack
a=rtcp-fb:123 nack pli
a=fmtp:123 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d001f
a=rtpmap:119 rtx/90000
a=fmtp:119 apt=123
a=rtpmap:35 H264/90000
a=rtcp-fb:35 goog-remb
a=rtcp-fb:35 transport-cc
a=rtcp-fb:35 ccm fir
a=rtcp-fb:35 nack
a=rtcp-fb:35 nack pli
a=fmtp:35 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=4d001f
a=rtpmap:36 rtx/90000
a=fmtp:36 apt=35
a=rtpmap:41 AV1/90000
a=rtcp-fb:41 goog-remb
a=rtcp-fb:41 transport-cc
a=rtcp-fb:41 ccm fir
a=rtcp-fb:41 nack
a=rtcp-fb:41 nack pli
a=rtpmap:42 rtx/90000
a=fmtp:42 apt=41
a=rtpmap:98 VP9/90000
a=rtcp-fb:98 goog-remb
a=rtcp-fb:98 transport-cc
a=rtcp-fb:98 ccm fir
a=rtcp-fb:98 nack
a=rtcp-fb:98 nack pli
a=fmtp:98 profile-id=0
a=rtpmap:99 rtx/90000
a=fmtp:99 apt=98
a=rtpmap:100 VP9/90000
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 transport-cc
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=fmtp:100 profile-id=2
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=100
a=rtpmap:114 H264/90000
a=rtcp-fb:114 goog-remb
a=rtcp-fb:114 transport-cc
a=rtcp-fb:114 ccm fir
a=rtcp-fb:114 nack
a=rtcp-fb:114 nack pli
a=fmtp:114 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=64001f
a=rtpmap:115 rtx/90000
a=fmtp:115 apt=114
a=rtpmap:116 red/90000
a=rtpmap:117 rtx/90000
a=fmtp:117 apt=116
a=rtpmap:118 ulpfec/90000
a=ssrc-group:FID 3849983765 2848192372
a=ssrc:3849983765 cname:PU+8Yc7wb7+U9BBI
a=ssrc:3849983765 msid:rFgyXrRpaRkNUFrMwEEmuA6k551YE3si8400 0bbe7300-5c36-459f-b66d-65a069ba7dcf
a=ssrc:2848192372 cname:PU+8Yc7wb7+U9BBI
a=ssrc:2848192372 msid:rFgyXrRpaRkNUFrMwEEmuA6k551YE3si8400 0bbe7300-5c36-459f-b66d-65a069ba7dcf
+1ms
common.js:113 JsSIP:WebSocketInterface send() +2ms
common.js:113 JsSIP:InviteClientTransaction Timer D expired for transaction z9hG4bK6354034 +0ms
common.js:113 JsSIP:WebSocketInterface received WebSocket message +201ms
common.js:113 JsSIP:Transport received text message:SIP/2.0 100 Trying
Via: SIP/2.0/WSS aic3ao0nhgpg.invalid;branch=z9hG4bK5475645
To: <sip:+923235037548#realm>
From: <sip:user#realm>;tag=d5p8tdji4d
Call-ID: 7ilh4875rfrqdq30k0f5
CSeq: 1469 INVITE
Content-Length: 0
+201ms
common.js:113 JsSIP:RTCSession receiveInviteResponse() +441ms
common.js:113 JsSIP:WebSocketInterface received WebSocket message +56ms
common.js:113 JsSIP:Transport received text message:SIP/2.0 400 Bad Request
Via: SIP/2.0/WSS aic3ao0nhgpg.invalid;branch=z9hG4bK5475645
To: <sip:+923235037548#realm>;tag=ZTLYShPJ4bEhAA..
From: <sip:user#realm>;tag=d5p8tdji4d
Call-ID: 7ilh4875rfrqdq30k0f5
CSeq: 1469 INVITE
Allow: NOTIFY, REFER, INFO, ACK, BYE, INVITE, OPTIONS, CANCEL
Supported: recording
Reason: SIP;cause=400;text="Bad Request"
P-Asserted-Identity: <tel:00923235037548;phone-context=realm>
X-Telepo-CTI-Call-ID: b3621205-a822-4e3f-982a-b349dbe2b3f3
Content-Length: 0
+56ms
common.js:113 JsSIP:Transport send() +2ms
common.js:113 JsSIP:Transport sending message:ACK sip:+923235037548#realm SIP/2.0
Route: <sip:sips_erver;transport=ws;lr>
Via: SIP/2.0/WSS aic3ao0nhgpg.invalid;branch=z9hG4bK5475645
Max-Forwards: 69
To: <sip:+923235037548#realm>;tag=ZTLYShPJ4bEhAA..
From: <sip:user#realm>;tag=d5p8tdji4d
Call-ID: 7ilh4875rfrqdq30k0f5
CSeq: 1469 ACK
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
Supported: outbound
User-Agent: JsSIP 3.9.1
Content-Length: 0
+1ms
common.js:113 JsSIP:WebSocketInterface send() +3ms
common.js:113 JsSIP:RTCSession receiveInviteResponse() +58ms
common.js:113 JsSIP:RTCSession session failed +1ms
common.js:113 JsSIP:RTCSession emit "_failed" +0ms
common.js:113 JsSIP:RTCSession close() +0ms
common.js:113 JsSIP:RTCSession close() | closing local MediaStream +0ms
common.js:113 JsSIP:RTCSession emit "failed" +5ms
index.ts:87 call failed with cause: SIP Failure Code
common.js:113 JsSIP:InviteClientTransaction Timer D expired for transaction z9hG4bK5475645 +267ms
I don't have the sip-server access the only thing I have just credentials that is shared with, But there is another package sip.js that was giving me the same issue.
but got resolve with the parameter inveiteWithOutSdp=ture.
but I don't know how to do this JSSIP.
and keep in mind that I am dialing to my own Mobile Phone number that call is sip->GSM number not the SIP->SIP call.
thanks advance.
Regards,

SDP Offer WebRTC

I'm trying to execute the sdm.devices.commands.CameraLiveStream.GenerateWebRtcStream command on a Nest Battery Cam which only support WebRTC streams. The request should be as follows:
POST /enterprises/$project-id/devices/$device-id:executeCommand
{
"command" : "sdm.devices.commands.CameraLiveStream.GenerateWebRtcStream",
"params" : {
"offerSdp" : "$offerSdp"
}
}
According to another answered question the following code generates a correct SDP offer which is accepted by Google:
const myPeerConnection = new RTCPeerConnection
myPeerConnection.createDataChannel("dataSendChannel");
myPeerConnection.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0}).then(function(offer) {
return myPeerConnection.setLocalDescription(offer);
})
.then(function() {
console.log(myPeerConnection.localDescription.sdp + "\n");
})
.catch(function(reason) {
console.log("An error occurred, so handle the failure to connect");
});
Has anyone an idea how to "generate" from the last code the $offerSdp to be inserted in the first code?
I have used this online tool and got the offer in the console.
The following offer was generated:
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:120 VP8/90000
a=rtpmap:124 rtx/90000
a=rtpmap:121 VP9/90000
a=rtpmap:125 rtx/90000
a=rtpmap:126 H264/90000
a=rtpmap:127 rtx/90000
a=rtpmap:97 H264/90000
a=rtpmap:98 rtx/90000
a=setup:actpass
a=ssrc:3270553860 cname:{6d4a9509-da38-4be5-b6c0-e1b61b24de50}
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
c=IN IP4 0.0.0.0
a=sendrecv
a=ice-pwd:df7be166f74ae8480f36d9b634908922
a=ice-ufrag:da4e0cc3
a=mid:2
a=setup:actpass
a=sctp-port:5000
a=max-message-size:1073741823

What's missing in Answer SDP (From web browser to android device)

I've customized Apprtc project. i can call from an user and other user can answer call or reject call
When I call from android to web browser, I can't See video source of web browser in android device but I can see video source of android in web browser only.
Web browser version: Chrome 58 (Desktop version)
Android version: Marshmallow
Offer SDP: (From Android)
v=0
o=- 7916385280226465055 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio video
a=msid-semantic: WMS ARDAMS___
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 9 102 0 8 105 13 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:xKDP
a=ice-pwd:/hAtH4MAzGA/If6Fn+sT6Okj
a=ice-options:renomination
a=fingerprint:sha-256
35:5A:08:8D:FA:18:41:B9:A6:E2:B4:9A:A7:EE:1E:61:CA:38:BC:5B:98:9F:D1:3E:1F:51:79:C8:F3:63:00:F8
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=sendrecv
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:102 ILBC/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:126 telephone-event/8000
a=ssrc:1281015102 cname:wYjcft96aVDGkQzC
a=ssrc:1281015102 msid:ARDAMS___ ARDAMSa0
a=ssrc:1281015102 mslabel:ARDAMS___
a=ssrc:1281015102 label:ARDAMSa0
m=video 9 UDP/TLS/RTP/SAVPF 100 101 116 117 96 97 98
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:xKDP
a=ice-pwd:/hAtH4MAzGA/If6Fn+sT6Okj
a=ice-options:renomination
a=fingerprint:sha-256 35:5A:08:8D:FA:18:41:B9:A6:E2:B4:9A:A7:EE:1E:61:CA:38:BC:5B:98:9F:D1:3E:1F:51:79:C8:F3:63:00:F8
a=setup:actpass
a=mid:video
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:3gpp:video-orientation
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=sendrecv
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 transport-cc
a=rtpmap:101 VP9/90000
a=rtcp-fb:101 ccm fir
a=rtcp-fb:101 nack
a=rtcp-fb:101 nack pli
a=rtcp-fb:101 goog-remb
a=rtcp-fb:101 transport-cc
a=rtpmap:116 red/90000
a=rtpmap:117 ulpfec/90000
a=rtpmap:96 rtx/90000
a=fmtp:96 apt=100
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=101
a=rtpmap:98 rtx/90000
a=fmtp:98 apt=116
a=ssrc-group:FID 2034101263 3486873766
a=ssrc:2034101263 cname:wYjcft96aVDGkQzC
a=ssrc:2034101263 msid:ARDAMS___ ARDAMSv0
a=ssrc:2034101263 mslabel:ARDAMS___
a=ssrc:2034101263 label:ARDAMSv0
a=ssrc:3486873766 cname:wYjcft96aVDGkQzC
a=ssrc:3486873766 msid:ARDAMS___ ARDAMSv0
a=ssrc:3486873766 mslabel:ARDAMS___
a=ssrc:3486873766 label:ARDAMSv0
Answer SDP: (From Web Browser)
v=0
o=mozilla...THIS_IS_SDPARTA-52.0.2 6548308332703463210 0 IN IP4 0.0.0.0
s=-
t=0 0
a=fingerprint:sha-256 E6:0F:6A:A6:35:E0:B3:8E:7A:0E:2E:20:A9:AB:0B:CA:1C:6D:33:6C:B6:D1:E4:2D:39:87:1E:93:4E:ED:BB:CF
a=group:BUNDLE audio video
a=ice-options:trickle
a=msid-semantic:WMS *
m=audio 9 UDP/TLS/RTP/SAVPF 111 126
c=IN IP4 0.0.0.0
a=recvonly
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=fmtp:111 maxplaybackrate=48000;stereo=1;useinbandfec=1
a=fmtp:126 0-15
a=ice-pwd:8a4fad1c837809d3ee952922dbe2b927
a=ice-ufrag:ab799d79
a=mid:audio
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtpmap:126 telephone-event/8000/1
a=setup:active
a=ssrc:2269112214 cname:{b1e7d024-d327-4788-a5b1-a1b8291b5c8d}
m=video 9 UDP/TLS/RTP/SAVPF 100
c=IN IP4 0.0.0.0
a=recvonly
a=fmtp:100 max-fs=12288;max-fr=60
a=ice-pwd:8a4fad1c837809d3ee952922dbe2b927
a=ice-ufrag:ab799d79
a=mid:video
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 goog-remb
a=rtcp-mux
a=rtpmap:100 VP8/90000
a=setup:active
a=ssrc:1613714278 cname:{b1e7d024-d327-4788-a5b1-a1b8291b5c8d}
In peerconnection.cc current_tracks variable Not be filled:
void PeerConnection::UpdateRemoteStreamsList(
const cricket::StreamParamsVec& streams,
bool default_track_needed,
cricket::MediaType media_type,
StreamCollection* new_streams) {
TrackInfos* current_tracks = GetRemoteTracks(media_type);
// Find removed tracks. I.e., tracks where the track id or ssrc don't match
// the new StreamParam.
auto track_it = current_tracks->begin();
while (track_it != current_tracks->end()) {
Your browser SDP has a=recvonly attribute which means local stream is not added to your Peerconnection. If your browser is sending audio/video track to remote and wants to receive remote streams then it should have a=sendrec in AnswerSDP.
By looking into your answer SDP, it is not carrying any stream/track.
Suspected issue could be, you are not adding the stream before creating the answer in the browser.
You can check the PeerConnection API calls by opening chrome://webrtc-internals/
PeerConnection API calls should be as following in the browser/answered side
pc = new RTCPeerConnection({"iceServers": [{"urls": "stun:stun.l.google.com:19302"}]},
{"optional": [{"DtlsSrtpKeyAgreement": true}]
});
pc.setRemoteDescription(
new RTCSessionDescription(jsep),
function() {
console.log(' OFFER accepted ');
}, function(e) {
console.log(' OFFER Failed ', e);
});
pc.addStream(stream);
pc.createAnswer(function(answer) {
console.log('got answer', answer);
pc.setLocalDescription(answer,
function() {
console.log('set local description sucesses ');
}, function(e) {
console.log('set local description failed ', e);
});
// Send the answer to other user endpoint
}, function() {
console.log('Error: Unable to create answer');
}, {
'mandatory': {
'OfferToReceiveAudio': true,
'OfferToReceiveVideo': true,
}
});
}
So your Answer SDP should contain a=sendonly lines instead of a=recvonly.
Expanding on other answers: you should send your connect signal only after making sure your local stream has been fetched and added to your RTCPeerConnection.
navigator.mediaDevices.getUserMedia({
audio: false, // request access to local microphone
video: true // request access to local camera
}).then(function (local_stream) {
// display preview from the local camera & microphone using local <video> MediaElement
var media_element = document.getElementById('local_video');
media_element.srcObject = local_stream;
media_element.play();
// add local camera stream to peer_connection ready to be sent to the remote peer
peer_connection.addStream(local_stream);
signal_init();
}).catch(console.log);
Where signal_init is your signaling/connection callback.

Sip Servlet setAttribute mobicent

I'm facing on a problem with the set attribute of a Sip Servlet. I'm trying to send a 200 OK , when I receive another 200 OK from a different source. So I've thought to do in this way:
protected void doInvite(SipServletRequest req) throws ServletException, IOException {
//...
SipSession session = req.getSession();
SipServletResponse response = req.createResponse(200);
session.setAttribute("reqResponse", response);
/...
}
And so, when I receive the 200 ok from the other side:
protected void doSuccessResponse(SipServletResponse resp)
//...
throws ServletException, IOException {
SipServletResponse response = (SipServletResponse) session.getAttribute("reqResponse");
response.send();
//....
}
But when I try to do response.send() I have an error:
[0m[31m09:25:15,956 ERROR [org.mobicents.servlet.sip.core.dispatchers.DispatchTask] (Mobicents-SIP-Servlets-UDPMessageChannelThread-10) Unexpected exception while processing message SIP/2.0 200 Ok
Via: SIP/2.0/UDP localhost:5080;received=127.0.0.1;branch=z9hG4bKa76ae813-561c-40ec-90b3-0cb29839c16f_d9d5d8b1_b843c7c0-2c76-4a9a-87e2-3fd9959601ea
From: "x-lite" <sip:user2#127.0.0.1>;tag=15858376_d7e7552a_d9d5d8b1_a76ae813-561c-40ec-90b3-0cb29839c16f
To: <sip:user1#127.0.0.1:5061>;tag=qGnECUk
Call-ID: 31ad484919b40e2a20d2ef2d28468f8d#127.0.0.1
CSeq: 1 INVITE
User-Agent: Linphone/3.8.5 (belle-sip/1.4.1)
Supported: outbound
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,NOTIFY,MESSAGE,SUBSCRIBE,INFO,UPDATE
Contact: <sip:user1#127.0.0.1:5061>;+sip.instance="<urn:uuid:2fc1acc8-38e5-420e-981e-70d1c82d961f>"
Content-Type: application/sdp
Content-Length: 398
v=0
o=user1 3189 2578 IN IP4 10.1.2.214
s=Talk
c=IN IP4 10.1.2.214
t=0 0
m=audio 7078 RTP/AVPF 96 0
a=rtpmap:96 opus/48000/2
a=fmtp:96 useinbandfec=1; stereo=0; sprop-stereo=0
a=rtcp-fb:* trr-int 5000
m=video 9078 RTP/AVPF 102 103
a=rtpmap:102 VP8/90000
a=rtpmap:103 H264/90000
a=fmtp:103 profile-level-id=42801F
a=rtcp-fb:* trr-int 5000
a=rtcp-fb:102 ccm fir
a=rtcp-fb:103 ccm fir
: org.mobicents.servlet.sip.core.DispatcherException: Unexpected exception while processing response : SIP/2.0 200 Ok
Via: SIP/2.0/UDP localhost:5080;received=127.0.0.1;branch=z9hG4bKa76ae813-561c-40ec-90b3-0cb29839c16f_d9d5d8b1_b843c7c0-2c76-4a9a-87e2-3fd9959601ea
From: "x-lite" <sip:user2#127.0.0.1>;tag=15858376_d7e7552a_d9d5d8b1_a76ae813-561c-40ec-90b3-0cb29839c16f
To: <sip:user1#127.0.0.1:5061>;tag=qGnECUk
Call-ID: 31ad484919b40e2a20d2ef2d28468f8d#127.0.0.1
CSeq: 1 INVITE
User-Agent: Linphone/3.8.5 (belle-sip/1.4.1)
Supported: outbound
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,NOTIFY,MESSAGE,SUBSCRIBE,INFO,UPDATE
Contact: <sip:user1#127.0.0.1:5061>;+sip.instance="<urn:uuid:2fc1acc8-38e5-420e-981e-70d1c82d961f>"
Content-Type: application/sdp
Content-Length: 398
v=0
o=user1 3189 2578 IN IP4 10.1.2.214
s=Talk
c=IN IP4 10.1.2.214
t=0 0
m=audio 7078 RTP/AVPF 96 0
a=rtpmap:96 opus/48000/2
a=fmtp:96 useinbandfec=1; stereo=0; sprop-stereo=0
a=rtcp-fb:* trr-int 5000
m=video 9078 RTP/AVPF 102 103
a=rtpmap:102 VP8/90000
a=rtpmap:103 H264/90000
a=fmtp:103 profile-level-id=42801F
a=rtcp-fb:* trr-int 5000
a=rtcp-fb:102 ccm fir
a=rtcp-fb:103 ccm fir
at org.mobicents.servlet.sip.core.dispatchers.ResponseDispatcher$1.dispatch(ResponseDispatcher.java:491) [sip-servlets-impl-3.0.564.jar:3.0.564]
at org.mobicents.servlet.sip.core.dispatchers.DispatchTask.dispatchAndHandleExceptions(DispatchTask.java:61) [sip-servlets-impl-3.0.564.jar:3.0.564]
at org.mobicents.servlet.sip.core.dispatchers.ResponseDispatcher.dispatchMessage(ResponseDispatcher.java:512) [sip-servlets-impl-3.0.564.jar:3.0.564]
at org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl.processResponse(SipApplicationDispatcherImpl.java:1005) [sip-servlets-impl-3.0.564.jar:3.0.564]
at gov.nist.javax.sip.EventScanner.deliverEvent(EventScanner.java:296) [jain-sip-ri-1.2.228.jar:1.2.228]
at gov.nist.javax.sip.SipProviderImpl.handleEvent(SipProviderImpl.java:185) [jain-sip-ri-1.2.228.jar:1.2.228]
at gov.nist.javax.sip.DialogFilter.processResponse(DialogFilter.java:1501) [jain-sip-ri-1.2.228.jar:1.2.228]
at gov.nist.javax.sip.stack.SIPClientTransactionImpl.inviteClientTransaction(SIPClientTransactionImpl.java:896) [jain-sip-ri-1.2.228.jar:1.2.228]
at gov.nist.javax.sip.stack.SIPClientTransactionImpl.processResponse(SIPClientTransactionImpl.java:532) [jain-sip-ri-1.2.228.jar:1.2.228]
at gov.nist.javax.sip.stack.SIPClientTransactionImpl.processResponse(SIPClientTransactionImpl.java:1604) [jain-sip-ri-1.2.228.jar:1.2.228]
at gov.nist.javax.sip.stack.UDPMessageChannel.processMessage(UDPMessageChannel.java:603) [jain-sip-ri-1.2.228.jar:1.2.228]
at gov.nist.javax.sip.stack.UDPMessageChannel.processIncomingDataPacket(UDPMessageChannel.java:512) [jain-sip-ri-1.2.228.jar:1.2.228]
at gov.nist.javax.sip.stack.UDPMessageChannel.run(UDPMessageChannel.java:317) [jain-sip-ri-1.2.228.jar:1.2.228]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]
Caused by: java.lang.NullPointerException
at org.mobicents.servlet.sip.example.SimpleSipServlet.doSuccessResponse(SimpleSipServlet.java:151)
at javax.servlet.sip.SipServlet.doResponse(SipServlet.java:274) [sip-servlets-spec-3.0.564.jar:3.0.564]
at org.mobicents.servlet.sip.example.SimpleSipServlet.doResponse(SimpleSipServlet.java:195)
at javax.servlet.sip.SipServlet.service(SipServlet.java:334) [sip-servlets-spec-3.0.564.jar:3.0.564]
at org.mobicents.servlet.sip.core.dispatchers.MessageDispatcher.callServlet(MessageDispatcher.java:458) [sip-servlets-impl-3.0.564.jar:3.0.564]
at org.mobicents.servlet.sip.core.dispatchers.ResponseDispatcher$1.dispatch(ResponseDispatcher.java:479) [sip-servlets-impl-3.0.564.jar:3.0.564]
... 13 more
Can somebody help me to understand where is the error?
Note: I've tried to print in log the 200 ok message and seems there isn't errors, I got it correctly!
Thank you for your help!

Asterisk modify headers

I want to replace my SPA2102 for asterisk. How can I modify headers, like From, To and Contact?
I need to replace headers, like
From: "asterisk" <sip:XXXX174264#ip.ip.ip.6>;tag=as1ea48bca
To headers, like SPA2102.
My SPA2102 sends it like
"XXXX174264" <sip:XXXX174264#ip.ip.ip.6>
How
# tcpdump -nAieth0 port 5060 and net ip.ip.ip.0/24
10:47:55.801914 IP 10.37.93.21.5060 > ip.ip.ip.6.5060: SIP, length: 906
E....j..#...
%].............INVITE sip:474264#ip.ip.ip.6 SIP/2.0
Via: SIP/2.0/UDP 10.37.93.21:5060;branch=z9hG4bK20d7bc88
Max-Forwards: 70
From: "asterisk" <sip:XXXX174264#ip.ip.ip.6>;tag=as1ea48bca
To: <sip:474264#ip.ip.ip.6>
Contact: <sip:XXXX174264#10.37.93.21:5060>
Call-ID: 6b4c893e70628a626286cd0a748f93de#ip.ip.ip.6
CSeq: 102 INVITE
User-Agent: Linksys/SPA2102-5.2.5
Date: Wed, 16 Jan 2013 04:47:55 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 333
v=0
o=- 233070007 233070007 IN IP4 10.37.93.21
s=Asterisk PBX 11.2.0
c=IN IP4 10.37.93.21
t=0 0
m=audio 10004 RTP/AVP 0 8 3 111 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
10:47:55.822359 IP ip.ip.ip.6.5060 > 10.37.93.21.5060: SIP, length: 348
E..x..#.>.#.....
%]......d.CSIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.37.93.21:5060;branch=z9hG4bK20d7bc88
From: "asterisk" <sip:XXXX174264#ip.ip.ip.6>;tag=as1ea48bca
To: <sip:474264#ip.ip.ip.6>
Call-ID: 6b4c893e70628a626286cd0a748f93de#ip.ip.ip.6
CSeq: 102 INVITE
Contact: <sip:474264#ip.ip.ip.6:5060>
Server: MERA MVTS3G v.4.3.0-38t
Content-Length: 0
I try to make call using SPA and Asterisk. Both register succes. But Asterisk can't make call.
Here is tcpdump from SPA:
00:58:00.778565 IP 10.37.93.23.5060 > ip.ip.ip.6.5060: SIP, length: 892
Eh..........
%].............INVITE sip:474264#ip.ip.ip.6 SIP/2.0
Via: SIP/2.0/UDP 10.37.93.23:5060;branch=z9hG4bK-9b906813
From: XXXX174264 <sip:XXXX174264#ip.ip.ip.6>;tag=e9377d83dbc079fo0
To: <sip:474264#ip.ip.ip.6>
Remote-Party-ID: XXXX174264 <sip:XXXX174264#ip.ip.ip.6>;screen=yes;party=calling
Call-ID: 27e34e53-cdeded0f#10.37.93.23
CSeq: 101 INVITE
Max-Forwards: 70
Contact: XXXX174264 <sip:XXXX174264#10.37.93.23:5060>
Expires: 240
User-Agent: Linksys/SPA2102-5.2.5
Content-Length: 268
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER
Supported: x-sipura, replaces
Content-Type: application/sdp
v=0
o=- 93383 93383 IN IP4 10.37.93.23
s=-
c=IN IP4 10.37.93.23
t=0 0
m=audio 16186 RTP/AVP 8 0 18 4 100
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729a/8000
a=rtpmap:4 G723/8000
a=rtpmap:100 NSE/8000
a=fmtp:100 192-193
a=ptime:20
a=sendrecv
00:58:00.782580 IP ip.ip.ip.6.5060 > 10.37.93.23.5060: SIP, length: 342
....E..r..#.>.#.....
%]......^..SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.37.93.23:5060;branch=z9hG4bK-9b906813
From: "XXXX174264" <sip:XXXX174264#ip.ip.ip.6>;tag=e9377d83dbc079fo0
To: <sip:474264#ip.ip.ip.6>
Call-ID: 27e34e53-cdeded0f#10.37.93.23
CSeq: 101 INVITE
Contact: <sip:474264#ip.ip.ip.6:5060>
Server: MERA MVTS3G v.4.3.0-38t
Content-Length: 0
00:58:02.479539 IP ip.ip.ip.6.5060 > 10.37.93.23.5060: SIP, length: 683
....E.....#.>."p....
%].......<.SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 10.37.93.23:5060;branch=z9hG4bK-9b906813
From: "XXXX174264" <sip:XXXX174264#ip.ip.ip.6>;tag=e9377d83dbc079fo0
To: <sip:474264#ip.ip.ip.6>;tag=109877804-3792792162-4082950052-3026001148
Call-ID: 27e34e53-cdeded0f#10.37.93.23
CSeq: 101 INVITE
Contact: <sip:474264#ip.ip.ip.6:5060>
Content-Type: application/sdp
Server: MERA MVTS3G v.4.3.0-38t
Content-Length: 258
v=0
o=- 1358621882 1358621882 IN IP4 ip.ip.ip.5
s=-
c=IN IP4 ip.ip.ip.5
t=0 0
m=audio 39878 RTP/AVP 8 0 18
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=ptime:20
a=sendrecv
a=silenceSupp:off - - - -
00:58:30.832778 IP 10.37.93.23.5060 > ip.ip.ip.6.5060: SIP, length: 339
Eh.o........
%]..........[O.CANCEL sip:474264#ip.ip.ip.6 SIP/2.0
Via: SIP/2.0/UDP 10.37.93.23:5060;branch=z9hG4bK-9b906813
From: XXXX174264 <sip:XXXX174264#ip.ip.ip.6>;tag=e9377d83dbc079fo0
To: <sip:474264#ip.ip.ip.6>
Call-ID: 27e34e53-cdeded0f#10.37.93.23
CSeq: 101 CANCEL
Max-Forwards: 70
User-Agent: Linksys/SPA2102-5.2.5
Content-Length: 0
00:58:30.836782 IP ip.ip.ip.6.5060 > 10.37.93.23.5060: SIP, length: 385
....E.....#.>.#.....
%].......7.SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.37.93.23:5060;branch=z9hG4bK-9b906813
From: "XXXX174264" <sip:XXXX174264#ip.ip.ip.6>;tag=e9377d83dbc079fo0
To: <sip:474264#ip.ip.ip.6>;tag=109877804-3792792162-4082950052-3026001148
Call-ID: 27e34e53-cdeded0f#10.37.93.23
CSeq: 101 CANCEL
Contact: <sip:474264#ip.ip.ip.6:5060>
Server: MERA MVTS3G v.4.3.0-38t
Content-Length: 0
00:58:30.838775 IP ip.ip.ip.6.5060 > 10.37.93.23.5060: SIP, length: 450
....E.....#.>.#Y....
%].........SIP/2.0 487 Request Terminated
Via: SIP/2.0/UDP 10.37.93.23:5060;branch=z9hG4bK-9b906813
From: "XXXX174264" <sip:XXXX174264#ip.ip.ip.6>;tag=e9377d83dbc079fo0
To: <sip:474264#ip.ip.ip.6>;tag=109877804-3792792162-4082950052-3026001148
Call-ID: 27e34e53-cdeded0f#10.37.93.23
CSeq: 101 INVITE
Contact: <sip:474264#ip.ip.ip.6:5060>
Server: MERA MVTS3G v.4.3.0-38t
Reason: SIP;cause=487;text="Request Terminated"
Content-Length: 0
00:58:30.845777 IP 10.37.93.23.5060 > ip.ip.ip.6.5060: SIP, length: 437
Eh.........&
%].............ACK sip:474264#ip.ip.ip.6 SIP/2.0
Via: SIP/2.0/UDP 10.37.93.23:5060;branch=z9hG4bK-9b906813
From: XXXX174264 <sip:XXXX174264#ip.ip.ip.6>;tag=e9377d83dbc079fo0
To: <sip:474264#ip.ip.ip.6>;tag=109877804-3792792162-4082950052-3026001148
Call-ID: 27e34e53-cdeded0f#10.37.93.23
CSeq: 101 ACK
Max-Forwards: 70
Contact: XXXX174264 <sip:XXXX174264#10.37.93.23:5060>
User-Agent: Linksys/SPA2102-5.2.5
Content-Length: 0
And tcpdump from Asterisk:
E...W,..#. .
%].............INVITE sip:474264#ip.ip.ip.6 SIP/2.0
Via: SIP/2.0/UDP 10.37.93.21:5060;branch=z9hG4bK6422ee1e
Max-Forwards: 70
From: "asterisk" <sip:XXXX174264#ip.ip.ip.6>;tag=as43ada6c8
To: <sip:474264#ip.ip.ip.6>
Contact: <sip:XXXX174264#10.37.93.21:5060>
Call-ID: 6e8b22967d9c55ea349abb636c0e5263#ip.ip.ip.6
CSeq: 102 INVITE
User-Agent: Linksys/SPA2102-5.2.5
Date: Sat, 19 Jan 2013 18:49:27 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 333
v=0
o=- 413424664 413424664 IN IP4 10.37.93.21
s=Asterisk PBX 11.2.0
c=IN IP4 10.37.93.21
t=0 0
m=audio 10008 RTP/AVP 0 8 3 111 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
00:49:27.073977 IP ip.ip.ip.6.5060 > 10.37.93.21.5060: SIP, length: 348
E..x..#.>.#.....
%]......d..SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.37.93.21:5060;branch=z9hG4bK6422ee1e
From: "asterisk" <sip:XXXX174264#ip.ip.ip.6>;tag=as43ada6c8
To: <sip:474264#ip.ip.ip.6>
Call-ID: 6e8b22967d9c55ea349abb636c0e5263#ip.ip.ip.6
CSeq: 102 INVITE
Contact: <sip:474264#ip.ip.ip.6:5060>
Server: MERA MVTS3G v.4.3.0-38t
Content-Length: 0
00:49:27.100102 IP ip.ip.ip.6.5060 > 10.37.93.21.5060: SIP, length: 478
E.....#.>.#?....
%].........SIP/2.0 603 Subscriber account disabled
Via: SIP/2.0/UDP 10.37.93.21:5060;branch=z9hG4bK6422ee1e
From: "asterisk" <sip:XXXX174264#ip.ip.ip.6>;tag=as43ada6c8
To: <sip:474264#ip.ip.ip.6>;tag=179071226-3792791650-4082950052-3026001148
Call-ID: 6e8b22967d9c55ea349abb636c0e5263#ip.ip.ip.6
CSeq: 102 INVITE
Contact: <sip:474264#ip.ip.ip.6:5060>
Server: MERA MVTS3G v.4.3.0-38t
Reason: Centrex;cause=179;text="Subscriber account disabled"
Content-Length: 0
00:49:27.100295 IP 10.37.93.21.5060 > ip.ip.ip.6.5060: SIP, length: 433
E...W-..#.
.
%]...........#,ACK sip:474264#ip.ip.ip.6 SIP/2.0
Via: SIP/2.0/UDP 10.37.93.21:5060;branch=z9hG4bK6422ee1e
Max-Forwards: 70
From: "asterisk" <sip:XXXX174264#ip.ip.ip.6>;tag=as43ada6c8
To: <sip:474264#ip.ip.ip.6>;tag=179071226-3792791650-4082950052-3026001148
Contact: <sip:XXXX174264#10.37.93.21:5060>
Call-ID: 6e8b22967d9c55ea349abb636c0e5263#ip.ip.ip.6
CSeq: 102 ACK
User-Agent: Linksys/SPA2102-5.2.5
Content-Length: 0
Try change in sip.conf following:
[general]
realm=yourprovider-domain-here
useragent = Linksys/PAP2T-5.1.6(LS)
sdpsession= Linksys/PAP2T-5.1.6(LS)
you can use SipAddHeader in dialplan, like
SipAddHeader(P-Preferred-Identity: <sip:XXXXXX#10.0.10.10>
There are two places where you can change these headers.
In your PBX for calls in the sense PBX -> SPA you should modify your sip.conf file like that:
[general]
...
realm = my_realm.com ; This will substitute From: "asterisk"
In your SPA2102 for calls in the sense SPA -> PBX you have to enter the SPA configuration and change your subscriber information. This is step 5 of this guide: http://www.voipvoip.com/spa-2101/ where it says "Display Name"