[asterisk-dev] [Code Review] 2934: PJSIP: when identify by user doesn't match anything, add a debug log. When registration is received against an unidentifiable endpoint, add a notice log.

Mark Michelson reviewboard at asterisk.org
Mon Oct 21 12:00:36 CDT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2934/#review9962
-----------------------------------------------------------



/branches/12/res/res_pjsip/pjsip_distributor.c
<https://reviewboard.asterisk.org/r/2934/#comment19203>

    These should not be necessary. If rdata->msg_info.msg is NULL, there are some MAJOR problems. Endpoint lookup is only performed on SIP requests, so the msg_type will always be PJSIP_REQUEST_MSG.



/branches/12/res/res_pjsip/pjsip_distributor.c
<https://reviewboard.asterisk.org/r/2934/#comment19202>

    1) There's no good reason to have this block indented like this.
    
    2) I don't think printing the host portion of the From URI is especially useful in this message. The biggest reason is that this hostname doesn't necessarily correspond to where the message actually came from. If I were debugging an issue where an endpoint were not identified, I'd want three pieces of information in the notice message:
        a) Full From URI
        b) Source IP address and port (this can be retrieved from rdata->pkt_info.src_name and rdata->pkt_info.src_port).
        c) SIP Call-ID of the request (rdata->msg_info.cid)



/branches/12/res/res_pjsip/pjsip_distributor.c
<https://reviewboard.asterisk.org/r/2934/#comment19204>

    Does this compile? I can't find where "name" is declared.


- Mark Michelson


On Oct. 18, 2013, 7:04 p.m., jrose wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2934/
> -----------------------------------------------------------
> 
> (Updated Oct. 18, 2013, 7:04 p.m.)
> 
> 
> Review request for Asterisk Developers, Matt Jordan and Mark Michelson.
> 
> 
> Bugs: ASTERISK-22552
>     https://issues.asterisk.org/jira/browse/ASTERISK-22552
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> So currently, Asterisk displays nothing when a failed register happens against pjsip due to no endpoint matching the requesting user. That could be frustrating for people setting up new connections and chan_sip does issue messages of this nature.
> 
> This patch adds that along with some debug logging a specific endpoint identification method.
> 
> 
> Diffs
> -----
> 
>   /branches/12/res/res_pjsip/pjsip_distributor.c 401221 
>   /branches/12/res/res_pjsip_endpoint_identifier_user.c 401221 
> 
> Diff: https://reviewboard.asterisk.org/r/2934/diff/
> 
> 
> Testing
> -------
> 
> Checked that information from failed registers would be received and that the debug messages would be written. Here's an example
> 
> res_pjsip_endpoint_identifier_user.c:106 username_identify: Could not identify endpoint by username '123'
> res_pjsip/pjsip_distributor.c:258 log_unidentified_register: Registration from '10.24.18.246' failed for '123' - No matching endpoint found
> 
> 
> Thanks,
> 
> jrose
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20131021/d63a92cf/attachment.html>


More information about the asterisk-dev mailing list