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})