Webrtc <-> Asterisk <-> Cisco Call Manager waiting problem

Hi our scenario is, we connect asterisk via ws and we are using sipjs . The problem is
when we register & call from sip.js to asterisk,

  • the sipjs send register
    – asterisk send 401
  • the sipjs send register with auth
    – asterisk send OK
  • the sipjs send invite
    – asterisk send TRYING after 30-35 seconds
    after trying sipjs send sdp etc, then
    asterisk call the cisco provider ( like 3rd party trunk service )
    The call coming . however I cant understand that why it waits about 30-35 seconds after invite ?

The reverse scenario
the client call from mobile phone to cisco cucm

  • cisco cucm send call to the asterisk
    – asterisk rings about 3-4 times for connect

The system works like that
when client enter phone number from html page starting with 9
we register sipjs with 1060 in the config
and we call cisco_provider_1.

When client call from outside via mobile phone
the cisco send the call to the asterisk over 3000 extension
and in asterisk we handle the call and ask some password and redirect the client to the selected sip user

here is the config

######SIP CONF #################

[general]
videosupport=yes
udpbindaddr=0.0.0.0:5060
realm=17t.18.yy.xx
transport=udp,tls,ws,wss
nat=force_rport,comedia
srvlookup=yes

;;;;;;;;;;;;;;;;;;;;;;;;
;;WEBPHONE EXTENSIONS;;
;;;;;;;;;;;;;;;;;;;;;;;;
[1060]
type=friend
username=1060
host=dynamic
secret=5212bbg
encryption=yes
avpf=yes
icesupport=yes
context=default 
directmedia=no 
transport=udp,ws,wss 
force_avp=yes 
dtlsenable=yes 
dtlsverify=fingerprint 
dtlscertfile=/etc/asterisk/keys/asterisk.pem 
dtlssetup=actpass 
rtcp_mux=yes 
allow=vp8,ulaw,opus,alaw,gsm
webrtc=yes
dtmfmode=auto


;;;;;;;;;;;;;;;;;;;;;;;;
;;OUTSIDE EXTENSIONS;;
;;;;;;;;;;;;;;;;;;;;;;;;


[ciscoprovider_1]
host=105.116.14.11
fromuser=5123856875
username=5123856875
type=friend
context=ciscoprovider
insecure=port,invite
qualify=yes
nat=yes
disallow=all
allow=ulaw,opus,alaw,gsm
dtmfmode=auto

#######EXTENSION CONF##########

[default]
exten => 1000,1,Answer()
same => n,Playback(demo-congrats)
same => n,Hangup()
exten => _10X.,1,Dial(SIP/${EXTEN},30)
exten => _9X.,1,NoOp(For_Callme_Function)
exten => _9X.,2,Set(CALLERID(all)=Here Web Conferencing <5123856875>)
same => n,Goto(CiscoProviders,${EXTEN:1},1)

##OUTGOING CALL##
[CiscoProviders]
exten => _x.,1,NoOp(Dailed Number ${EXTEN})
same => n,Dial(SIP/ciscoprovider_1/0${EXTEN})
##OUTGOING CALL##


[ciscoprovider]


#####INCOMING CALL HANDLER########
exten => 3000,1,Answer()
same => n,NoOp(Incoming Call From UC Network )
same => n,Set(CallerIDString=${CALLERID(all)})
same => n,NoOp(Caller ID = ${CallerIDString})
same => n,Playback(welcome)
same => n,Playback(passwordrequest)
same  => n,Read(APCODE,beep,0)
same => n,NoOp(Pressed DTMF = ${APCODE})
same  => n,Set(Curl_Result=${CURL(http://52.18.128.33:1320/api/v1/sip?key=${APCODE}&phoneNumber=${CallerIDString:3:11})})
same  => n,GotoIf($[${Curl_Result}!="1"]?default,${Curl_Result:1:4},1:errorcontext,1000,1)
same => n,NoOp(Service Answer : ${Curl_Result})

That sort of delay at that sort of point in the call is usually the result of a DNS timeout.

The UAC should send SDP on the INVITE or on the ACK. It should not wait for the trying response.

Hİ David, thanks for the answer. I see similar answer somewhere that told the problem is dns, however
the very first step
the connection between sipjs and asterisk on same network, there is no firewall, before signalling asterisk <-> cisco, It wait on sipjs <-> asterisk side.

In my project, when I write the number and click the call button,
the sipjs sends the register & invite , and in 1-2 seconds process done, but trying message from asterisk not recieved less then 30-35 seconds ,
is it related any config for dns ? where can I control is it related with dns or not ? Note that : I directly give the ip address

Asterisk will reverse resolv the IP address in the request.

in resolv.conf
nameserver was default I think
127.0.0.53
I’ll try after changing this

No luck, with putting resolv.conf the real nameservers, it still waiting for 30-35 seconds
any idea ?

keep in mind that , in rtp conf if stun & turn address not reacable , it will wait 30 seconds

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.