The Asterisk 13.4.0 'Failed to set remote offer/answer' sdp

As a new-commer to the Asterisak 13.4.0 pbx,I have been working on a worst-so-far WEB RTC issue for too much longer than I’d actually expected; I am using WebRTComm for my sip client stack and chrome Version 44.0.2403.125 m on both of client boxes as userA and userB resp. I have deployed and set up asterisk for web RTC on a centos 7(x86_64) server runing at “192.168.1.2” with the following sip.conf,extensions.conf,http.conf,rtp.conf an manager.conf :

sip.conf :
[general]
context=guest
localnet=192.168.1.0/255.255.255.0
externrefresh=150
language=en
allowguest=yes
callcounter=yes
allowtransfer=yes
callevents=yes
udpbindaddr=0.0.0.0:5060
transport=udp,ws
limitonpeers=yes
realm=192.168.1.2
nat=force_rport,comedia ;eventhough I am runing everytyhing local.‘no’ had not effect change
rtcachefriends=yes
disallow=all
allow=alaw
allow=ulaw
allow=gsm
useragent=test-agent

[userA]
host=dynamic
secret=strong pass
context=IncomingRTCCxt
type=friend ;tried user and peer as well
insecure=invite ;helped me avoid 401 auth issue
avpf=yes
dtmf=auto
nat=force_rport,comedia ;again
qualify=yes
force_avp=yes
icesupport=yes
encryption=yes
transpport=ws,udp
directmedia=no
disallow=all
allow=alaw
allow=ulaw
allow=gsm
dtlsenable=yes
dtlsverify=no ;tried fingerprint as well
dtlscertfile=/etc/asterisk/keys/asterisk.pem
dtlscafile=/etc/asterisk/keys/ca.crt
dtlsprivatekey=/etc/asterisk/keys/asterisk.pem
dtlssetup=actpass
same for userB (though will be using template later) [userB] … ;as above

extensions.conf:
exten => userA,1,Dial(SIP/userA,40)
exten => userB,1,Dial(SIP/userB,40)
NOTE: even with:answer(),Playback(hello-world),i get failed to set remote answer sdp…this time answer sdp.but with dial application,it is ‘remote offer sdp…’

http.conf:
[general]
enable=yes
bindaddr=0.0.0.0
bindport=8088

rtp.conf:
[general]
rtpstart=10000
rtpend=65000 ;because I realised asterisk was using large ports in my sdp on REGISTER etc…
icesupport=yes ;tried ‘true’ as well
stunaddr:19302=stun.l.google.com
yet when I call userB from userA, userB rings with the rtp debug: --Executing [userA@IncomingRTCCxt:1] Dial(“SIP/userB 0000000”,“SIP/userA,40”) in new stack ==Using SIP/RTP CoS mark 5 ==Called SIP/userB ==SIP/userB-00000001 is ringing

As soon as userB picks,i get: ==SIP/userB-0000001 redirecting info has changed,passing it to to SIP/userA-00000000 ==SIP/userB-0000001 is busy and the message :

WebRTCommCall:onRtcPeerConnectionSetRemoteDescriptionErrorEvent():error=“Failed to set remote offer sdp: Called with SDP without ice-ufrag and ice-pwd.” here is the userB (callee) sip client output :

SIP message received: INVITE sip:userA@PfoKs7oHgVn4.invalid;transport=ws SIP/2.0
Via: SIP/2.0/WS 192.168.1.2:5060;branch=z9hG4bK6a0720be;rport;rport
Max-Forwards: 70
From: “userB” sip:userB@192.168.1.2;tag=as6e3a062b
To: sip:userA@PfoKs7oHgVn4.invalid;transport=ws
Contact: sip:userB@192.168.1.2:5060;transport=WS
Call-ID: 4a8571b50aeb1d246cf8af2557efd94d@192.168.1.2:5060
CSeq: 102 INVITE
User-Agent: Digital-Merge_UA
Date: Tue, 18 Aug 2015 17:59:52 GMT
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,SUBSCRIBE,NOTIFY,INFO,PUBLISH,MESSAGE
Supported: replaces,timer
Content-Type: application/sdp
Content-Length: 456

v=0
o=root 1706945857 1706945857 IN IP4 192.168.1.2
s=Asterisk PBX 13.4.0
c=IN IP4 192.168.1.2
t=0 0
m=audio 17180 RTP/SAVPF 8 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=maxptime:150
a=connection:new
a=setup:actpass
a=fingerprint:SHA-256 5E:1F:8F:04:AB:2E:E0:41:84:E4:7F:8F:DE:38:85:3F:07:81:B1:01:04:C8:9E:E2:33:8B:3A:A7:7B:52:EC:03
a=sendrecv

as you can see,no ice info is found meanwhile at the userA (caller) sdp is fully generated by the client and sent as:

SIP message sent: INVITE sip:userB@pbx.testdomain.com SIP/2.0
Call-ID: 1439921054041
CSeq: 1 INVITE
From: “userA” sip:userA@pbx.testdomain.com;tag=1439921054247
To: sip:userB@pbx.testdomain.com
Via: SIP/2.0/WS PfoKs7oHgVn4.invalid;branch=z9hG4bK-353139-0933c152f7c327fa0884da16ca7fa901;rport
Max-Forwards: 70
Content-Type: application/sdp
User-Agent: test-ua
Allow: INVITE,ACK,CANCEL,BYE
Contact: sip:userA@PfoKs7oHgVn4.invalid;transport=ws
Content-Length: 1268

v=0
o=- 712764575873617987 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio
a=msid-semantic: WMS htItKFZedG8Su46RU93dhwTEYjJuvEG2ejVQ
m=audio 50113 RTP/SAVPF 8 0
c=IN IP4 192.168.1.10
a=rtcp:50114 IN IP4 192.168.1.10
a=candidate:4077567720 1 udp 2122260223 192.168.1.10 50113 typ host generation 0
a=candidate:4077567720 2 udp 2122260222 192.168.1.10 50114 typ host generation 0
a=candidate:3179889176 1 tcp 1518280447 192.168.1.10 0 typ host tcptype active generation 0
a=candidate:3179889176 2 tcp 1518280446 192.168.1.10 0 typ host tcptype active generation 0
a=ice-ufrag:cI2rB+zf3Z0nu5IY
a=ice-pwd:pW72fhckiizlLW4lP2Ctdgfr
a=fingerprint:sha-256 9A:C4:1B:8C:D6:EF:A2:79:4F:55:0A:23:99:63:25:27:70:0F:9F:DB:68:1A:C0:E6:01:08:E9:C8:AD:0E:88:94
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:3 webrtc.org/experiments/rtp-h … -send-time
a=sendrecv
a=rtcp-mux
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=maxptime:60
a=ssrc:2412920463 cname:Khb+ASO4msuaAsHx
a=ssrc:2412920463 msid:htItKFZedG8Su46RU93dhwTEYjJuvEG2ejVQ 4cd36caf-4fbf-469d-be49-52bf1dc5b99a
a=ssrc:2412920463 mslabel:htItKFZedG8Su46RU93dhwTEYjJuvEG2ejVQ
a=ssrc:2412920463 label:4cd36caf-4fbf-469d-be49-52bf1dc5b99a.
somewhat asterisk is faiiling to fully generate sdp with required ice details.

I notice the problem is a bit alarming on the web with many users like suffering form this;i have fully installed uuid,uiuid-devel ,libuuid andn libbuuid-devel plus a lot of other suspicious packages configured. I not my installation does not have res_http_post(with gmime,glib,libffi and their dependency hell I had to go through and left as soon as I was informed res_http_post i irrelevent) but i am told this can be left out and is not related to the issue. the whole project is stack due to this issue for more than months now.

trust me I have multi-check the modules loaded and the menuselect

what am I doing wrong. I really need a help now and I will appreciate your contribution very much.

Thanks a lot in advance !!

Hi,

Can someone be generous enough to help me with this please.It is urgent !!!
My latest bits include activating and configuring pjsip but still.
even with directmedia=yes will not let asterisk generate call leg 2 with the right sdp with required ice details.please someone help,kindly !!
Note: what does it mean: Sip/userX-0000001 redirecting info has changed,passing it to SIP/userY-0000001 ?
THANKS

Ok I have eventually found out the following in asterisk.conf :
Asterisk was pointing to my keys directory inside /var/lib/asterisk instead of /etc/asterisk/.putting it back to that default :/var/lib/asterisk ,now the call can be picked up without that error.
Nonetheless,a new issue (clearly related anyway) after picking up,STUN keeps sending messges in a long loop and the caller keeps playing the ringback tone meanwhile the caller stops ringing.apparently the call went through ( and I have checked to a port (192.168.1.11:63122 etc…) larger than set in rtp.conf (10000-20000).this forced me to increase my port range but with no effect.
After the long display of STUN messages,asterisk says:
chan_sip.c __setaddress_fromk_contact : invalid host name in contact (can’t resolve in dns) and at the callee,a pop-up says, ‘media stream has been lost’: which mean the session was actually estabished no voice is output.
my host is correct as detected vis “hostname” cmd ,eventhough I cannot ping it anyway from the client.I am using this hostname as my domain name at both server and client.
any idea.

with regards to the ‘answer sdp’,if I dial and playback(hello-world),everything is OK.it plays back ‘hello-world’.clearly the issue is related to the ip/hostname resolution of the peers.
any ideas? thanks.
By the way,this post is not only first asterisk forum participation but my very first time taking part in an online community at all,so what do I do to get quick responses ?at least one?
thanks

Sip/userX-0000001 has reported that a specific device has redirected the call to somewhere else. Asterisk is forwarding that information to SIP/userY-0000001 so that it also knows who redirected the call.

Hi david,Thank you indeed for coming in !

That msg is no longer coming up as the call can be picked up but with a second related issue as I explained above;endless ICE messages trying to connect to an ice server which is dsiabled at the client (WebRTCom) as null/undefined and at the asterisk side. since I am running all three boxes on my local net I set srvlookup=no,nat=no.I even set localnet=192.168.1.0/255.255.255.0.My realm is 192.168.1.2 defined on both sides (I had also disable stunaddr in rtp.conf too ).this is the latest error:
==chan_sip.c:…ast_sockaddr_resolve:getaddrinfo(“xABjhsnyHGS.invalid”,“null”,…):Name or service not known.
==chan_sip.c __setaddress_fromk_contact : invalid host name in contact (can’t resolve in dns)’.

The caller keeps ringing and as soon as I pick up,it goes through the ice connection and messages for a while and displays the above messages and the caller keeps calling/ringing and callee hungs up with:local media stream has been ended.both clients are the same WebRTCom instances deployed on the same local server.
Any ideas ?
thanks once again

I don’t use WebRTC and we are locked into a pre-ICE version.

Sorry I don’t understand.You mean you don’t use WebRTC/browser-to-browser websocket call (via a pbx or sip proxy ) ? what do you mean by ‘locked into a pre-ICE version’. Enlighten me please and where do you think I should post?

The organisation I work for does not use the WebRTC protocol to access Asterisk.

We are using a heavily modified version of Asterisk that is based on a version that did not implement the ICE protocol for negotiating ways round NAT, and does not have any of the other features introduced in order to support WebRTC…

On the other hand, we did back port the code that supports Redirecting, so I do understand what that message means, at least in general terms.

Ok then.thanks.
If you find out anything further,let me know with many thanks !!