voiceip / tinyphone

Minimalist Windows / OSx / Linux SIP Softphone with API Control
GNU General Public License v3.0
117 stars 36 forks source link

Dial JSON body ignored/not parsed #34

Closed matko238 closed 3 years ago

matko238 commented 3 years ago

Hi,

when you try to POST to /dial following JSON

{
"uri":"sip:100@192.168.4.193",
"account":"101@192.168.4.193"
}

input isn't parsed and following error occurs:

(2021-02-06 21:51:41) [INFO    ] Request: 127.0.0.1:45210 01732580 HTTP/1.1 POST /dial
(2021-02-06 21:51:41) [INFO    ] Dial Request to {"uri":"sip:100@192.168.4.193","account":"101@192.168.4.193"}
(2021-02-06 21:51:41) [ERROR   ] Exception catched : Invalid Request URI (PJSIP_EINVALIDREQURI)
(2021-02-06 21:51:41) [INFO    ] Response: 01732580 /dial 500 0

It attempts to dial wrong:

2021-02-06 21:51:41.397   pjsua_call.c !Making call with acc #1 to {"uri":"sip:100@192.168.4.193","account":"101@192.168.4.193"};transport=tcp

but when you post only sip:100@192.168.4.193 to /dial, it works.

kingster commented 3 years ago

It seems that you are running an old version which didn't have this feature. What is the version that you are running? Can you try with the latest version from the ci builds? https://ci.appveyor.com/project/kingster/tinyphone/build/artifacts

matko238 commented 3 years ago

Issue solved with 36.0.0.80 version, thank you!