[asterisk-dev] [Code Review] 2944: PJSIP messaging: send message to URI.
Mark Michelson
reviewboard at asterisk.org
Thu Nov 7 14:35:19 CST 2013
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2944/#review10143
-----------------------------------------------------------
The changes in res_pjsip.c have the potential to cause crashes.
First, if the call to pjsip_endpt_send_request() in send_out_of_dialog_request() fails, you're going to crash because the log message is going to try to print the sorcery ID of a NULL pointer.
Second, if our outgoing request receives a 401/407 response, then our attempts to get authentication credentials is going to crash, again because of trying to get data from a NULL pointer.
I've been giving this some thought, and I think that the way this will have to be done is to have some sort of default endpoint used when sending a MESSAGE (or other type of request) directly to a URI instead of specifying an endpoint. I can think of a couple of ways to do this:
1) Use a specially-named endpoint (maybe called "default_outbound"). This endpoint can be automatically created when res_pjsip is loaded and contain nothing but the default values for the endpoint. If people want to tweak default behavior, then they can create an endpoint called "default_outbound" in their pjsip.conf file and set appropriate values on it. This approach has the advantage of "just working" out of the box and allowing for overriding of the default behavior if desired.
2) Create a new option for PJSIP global configuration (maybe called "default_outbound_endpoint") that indicates an endpoint to be used when sending an outbound request to a URI. This approach has the advantage of not creating any "secret" endpoints that the user did not explicitly place in the configuration file.
- Mark Michelson
On Nov. 1, 2013, 8:53 p.m., Kevin Harwell wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2944/
> -----------------------------------------------------------
>
> (Updated Nov. 1, 2013, 8:53 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> Added the ability to send messages to a URI (an associated endpoint is no longer needed).
>
>
> Diffs
> -----
>
> branches/12/res/res_pjsip_messaging.c 402380
> branches/12/res/res_pjsip.c 402380
>
> Diff: https://reviewboard.asterisk.org/r/2944/diff/
>
>
> Testing
> -------
>
> Had the PJSIP message module send a SIP message to a specified IP address.
>
>
> Thanks,
>
> Kevin Harwell
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20131107/937d68a0/attachment-0001.html>
More information about the asterisk-dev
mailing list