VoIPGRID / VialerSIPLib

An Objective-c wrapper for PJSIP
GNU General Public License v3.0
133 stars 69 forks source link

Incoming call error: Error initializing media channel: Not Acceptable Here [status=170488] #219

Closed carolyn-dev closed 4 years ago

carolyn-dev commented 4 years ago

Version

Both 3.7.1 and 3.5.6

File / Feature

Inbound Calls from an asterisk Server

Expected behavior

Call notification should be received and enter the incomingCall code blocks by the application

Actual behavior

Incoming Call gets the error: ❗ ERROR 14:08:30.271 [VSLEndpoint void logCallBack(int, const char *, int):558] pjsua_call.c ..Error initializing media channel: Not Acceptable Here [status=170488]

Before it even hits the incoming call blocks.

I'm likely missing something fairly simple here but this is happening in both the example projects and my own implementations with both the current pod version and the 3.5.6 version. I've confirmed the right codecs are enabled for the sip invite and set as higher priority.

The error seems to be a pjsip error and the research done on it indicates it's either the srtp handling or the codecs. The srtp handling in the project seems to be set to handle whatever indicator it gets from the sip invite.

Stacktrace / Error message

πŸ’š DEBUG 10:25:35.986 [VSLEndpoint void logCallBack(int, const char *, int):567] pjsua_core.c .RX 1814 bytes Request msg INVITE/cseq=102 (rdata0x154152828) from UDP 216.46.7.117:5060: INVITE sip:EXCE02_11710_05@192.168.2.33:63534;ob SIP/2.0

Record-Route: <sip:216.46.7.117;r2=on;lr;did=5f6.fb3>

Record-Route: <sip:216.46.7.117:5080;r2=on;lr;did=5f6.fb3>

Via: SIP/2.0/UDP 216.46.7.117;branch=z9hG4bK6c54.f552d00243dc18723bffcc0cb57f29cb.0

Via: SIP/2.0/UDP 216.46.7.120:5060;received=216.46.7.120;branch=z9hG4bK3b4e4e9e;rport=5060

Max-Forwards: 69

From: "5149540486" sip:5149540486@216.46.7.117;tag=as213b519d

To: sip:EXCE02_11710_05@216.46.7.117:5080

Contact: sip:5149540486@216.46.7.120:5060

Call-ID: 7a1a0df47c889c774640068845110c49@216.46.7.117

CSeq: 102 INVITE

User-Agent: Excendia

Date: Thu, 11 Jun 2020 14:25:35 GMT

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE

Supported: replaces, timer

Excendia-To-UserId: 11710

P-Asserted-Identity: "5149540486" sip:5149540486@216.46.7.117

Content-Type: application/sdp

Content-Length: 892

v=0

o=root 507212447 507212447 IN IP4 216.46.7.120

s=Asterisk PBX certified/13.8-cert2

c=IN IP4 216.46.7.120

t=0 0

m=audio 17484 RTP/SAVPF 0 8 3 101

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:3 GSM/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=ptime:20

a=maxptime:150

a=ice-ufrag:10b6c83d5a0eea0f69b6ca04721f9250

a=ice-pwd:387d4d023847eae800672a882e340b24

a=candidate:Hd82e0778 1 UDP 2130706431 216.46.7.120 17484 typ host

a=candidate:Sd82e0778 1 UDP 1694498815 216.46.7.120 17484 typ srflx raddr 216.46.7.120 rport 17484

a=candidate:Hd82e0778 2 UDP 2130706430 216.46.7.120 17485 typ host

a=candidate:Sd82e0778 2 UDP 1694498814 216.46.7.120 17485 typ srflx raddr 216.46.7.120 rport 17485

a=connection:new

a=setup:actpass

a=fingerprint:SHA-256 A6:05:D3:95:94:80:EA:EF:3B:CB:F0:02:A8:E5:44:14:75:F8:11:86:7F:61:1D:0E:97:9A:8D:AC:A7:89:2A:32

a=sendrecv

--end msg-- πŸ’š DEBUG 10:25:36.152 [VSLEndpoint void logCallBack(int, const char , int):567] pjsua_call.c .Incoming Request msg INVITE/cseq=102 (rdata0x154152828) πŸ’š DEBUG 10:25:36.153 [VSLEndpoint void logCallBack(int, const char , int):567] pjsua_media.c ..Call 1: initializing media.. ❗ ERROR 10:25:36.154 [VSLEndpoint void logCallBack(int, const char , int):558] pjsua_call.c ..Error initializing media channel: Not Acceptable Here [status=170488] πŸ’š DEBUG 10:25:36.155 [VSLEndpoint void logCallBack(int, const char , int):567] pjsua_core.c ....TX 585 bytes Response msg 488/INVITE/cseq=102 (tdta0x1548bb0a8) to UDP 216.46.7.117:5060: SIP/2.0 488 Not Acceptable Here

Via: SIP/2.0/UDP 216.46.7.117;received=216.46.7.117;branch=z9hG4bK6c54.f552d00243dc18723bffcc0cb57f29cb.0

Via: SIP/2.0/UDP 216.46.7.120:5060;rport=5060;received=216.46.7.120;branch=z9hG4bK3b4e4e9e

Record-Route: <sip:216.46.7.117;lr;r2=on;did=5f6.fb3>

Record-Route: <sip:216.46.7.117:5080;lr;r2=on;did=5f6.fb3>

Call-ID: 7a1a0df47c889c774640068845110c49@216.46.7.117

From: "5149540486" sip:5149540486@216.46.7.117;tag=as213b519d

To: sip:EXCE02_11710_05@216.46.7.117;tag=gdtQ0qHtLUuuIlkueoA9Lg0YasqUoqNE

CSeq: 102 INVITE

Content-Length: 0

--end msg-- πŸ’š DEBUG 10:25:36.196 [VSLEndpoint void logCallBack(int, const char *, int):567] pjsua_core.c .RX 392 bytes Request msg ACK/cseq=102 (rdata0x154152828) from UDP 216.46.7.117:5060: ACK sip:EXCE02_11710_05@192.168.2.33:63534;ob SIP/2.0

Via: SIP/2.0/UDP 216.46.7.117;branch=z9hG4bK6c54.f552d00243dc18723bffcc0cb57f29cb.0

Max-Forwards: 69

From: "5149540486" sip:5149540486@216.46.7.117;tag=as213b519d

To: sip:EXCE02_11710_05@216.46.7.117;tag=gdtQ0qHtLUuuIlkueoA9Lg0YasqUoqNE

Call-ID: 7a1a0df47c889c774640068845110c49@216.46.7.117

CSeq: 102 ACK

Content-Length: 0

--end msg--

Other info

I understand the example project is out of date, and not working in the current version, does anyone know when the last working version with inbound calling was? I'm assuming before pushkit was implemented.

Please note i'm a junior developer fresh out of school and it is highly likely I'm missing something pretty obvious but as I don't have any seniors to ask, I'm hoping someone here has run into this issue previously and can shed some light on it. I've been trying to solve it online for several days now.

Thank-you in advance for any assistance you can provide.

Regards, Carolyn Pearson

carolyn-dev commented 4 years ago

So the answer to this question was related to the back end technology stack requiring webrtc for the phone type. Once it was switched to sip it worked correctly.