Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Incorrect response when X-Dod-Number is missing for peer-to-pstn routing #276

Open
psanders opened this issue Jun 18, 2024 · 0 comments
Labels

Comments

@psanders
Copy link
Member

What happened?

When making peer-to-pstn routing, the X-Dod-Number number must be present, and the resource must exist. The system should respond with a "404 Not Found" if the number doesn't exist. And, if the X-Dod-Number is not present, then a "400 Bad Request."

Instead, the server responds with a "500 Internal Server Error."

"addr":"localhost:51903","postProcessor":true,"runPostProcessorMiddlewares":false}
2024-06-02 16:17:12.307 [verbose]: (dispatcher) /node_modules/@routr/dispatcher/dist/run_processor.js forwarding request to processor {"ref":"connect-processor"}
2024-06-02 16:17:12.308 [verbose]: (connect) /node_modules/@routr/connect/dist/service.js connect processor received new request {"ref":"ZciyO4tPU-ijq2G1xF.cmloIKmeX2-8L","method":"INVITE","type":"(request)","edgePort":"8c9965764120"}
2024-06-02 16:17:12.368 [verbose]: (connect) /node_modules/@routr/connect/dist/router.js routing request from: sip:[email protected], to: sip:[email protected] {"fromURI":"sip:[email protected]","requestURI":"sip:[email protected]","routingDirection":"peer-to-pstn"}
2024-06-02 16:17:12.370 [error]: (connect) /node_modules/@routr/connect/dist/handlers/request.js no Number found for tel: null {}
2024-06-02 16:17:12.371 [verbose]: (dispatcher) /node_modules/@routr/dispatcher/dist/run_middlewares.js sending request to middleware {"ref":"ZciyO4tPU-ijq2G1xF.cmloIKmeX2-8L","middlewareRef":"rtprelay-middleware","addr":"localhost:51903","postProcessor":true,"runPostProcessorMiddlewares":true}
2024-06-02 16:17:12.372 [verbose]: (dispatcher) /node_modules/@routr/dispatcher/dist/run_middlewares.js found messageType to be responseType and broke the chain {"ref":"ZciyO4tPU-ijq2G1xF.cmloIKmeX2-8L","middlewareRef":"rtprelay-middleware","addr":"localhost:51903"}

Example of request.

Screenshot 2024-06-18 at 12 18 19 PM

Relevant code.

Screenshot 2024-06-18 at 12 22 53 PM

Steps to reproduce

Attempt to make a peer-to-pstn without the X-Dod-Number header or with an X-Dod-Number without the corresponding resource. Observe the signaling return a 500 error from Routr.returns

Expected behavior

We must validate the input and return the corresponding error if the resource is not found.

Additional context

No response

@psanders psanders added the bug label Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant