VoIPGRID / VialerSIPLib

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

Incoming BYE request is not handled by the example project #217

Open agolikov88 opened 4 years ago

agolikov88 commented 4 years ago

Version

3.7.1

File / Feature

VSLEndpoint

Expected behavior

Incoming BYE request should be correctly processed and call state should be changed to VSLCallStateDisconnected

Actual behavior

BYE request is not handled, call state is not changed. After ending the call by the other party it still continues in example application

Stacktrace / Error message

💚 DEBUG 17:16:04.007 [VSLEndpoint void logCallBack(int, const char *, int):569] pjsua_core.c .RX 582 bytes Request msg BYE/cseq=19448 (rdata0x156867628) from UDP 72.53.172.16:5060: BYE sip:13567142@192.168.0.20:53385;ob SIP/2.0

Record-Route: <sip:72.53.172.16;lr=on>

Via: SIP/2.0/UDP 72.53.172.16;branch=z9hG4bK89b1.58620e224144d32a7d6a6ef68333f2ee.0

Via: SIP/2.0/UDP 72.53.172.16:1024;received=72.53.172.16;branch=z9hG4bKf060a15c;rport=1024

CSeq: 19448 BYE

Call-ID: ORKv1qs-0Nm3ILHp1oDqtrdH0TshPRl5

From: sip:104@hpbx030.telecomsvc.com;tag=78b1519f

To: sip:13567142@hpbx030.telecomsvc.com;tag=wOjMDZN12uHxPu03jGOe8RzKkxiLsvqZ

Content-Length: 0

Max-Forwards: 69

Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,REGISTER

Contact: sip:104@72.53.172.16:5060

--end msg-- 💚 DEBUG 17:16:04.044 [VSLEndpoint void logCallBack(int, const char *, int):569] sip_endpoint.c .Request msg BYE/cseq=19448 (rdata0x156867628) from 72.53.172.16:5060 was dropped/unhandled by any modules

Other info

If the call is ended from example app BYE message is processed correctly by the other party of the call

agolikov88 commented 4 years ago

It seems like we've found the issue: due to the wrapper forms TO and FROM fields of the INVITE message without adding corner brackets to it such parameters are treated by the server as the whole uri without separate tag parameters which in turn leading to pjsip being unable to parse incoming messages such as BYE.