[asterisk-dev] [Code Review] 3780: res_pjsip_outbound_publish / res_pjsip_publish_asterisk: Add outbound PUBLISH support with 'asterisk' event type.

Joshua Colp reviewboard at asterisk.org
Mon Jul 21 07:14:12 CDT 2014



> On July 17, 2014, 9:49 p.m., Mark Michelson wrote:
> > /trunk/res/res_pjsip_outbound_publish.c, lines 530-568
> > <https://reviewboard.asterisk.org/r/3780/diff/1/?file=63302#file63302line530>
> >
> >     None of this is necessary. pjsip_publishc_init() parses URIs and will return PJSIP_EINVALIDURI if any URIs are invalid. You won't have the granularity that you currently have here, but you'll save on the repeated parsing of URIs.

This actually came up when doing the outbound registration work. People want the granularity so they can see, in more detail, what part of their configuration is incorrect.


> On July 17, 2014, 9:49 p.m., Mark Michelson wrote:
> > /trunk/res/res_pjsip_outbound_publish.c, lines 71-75
> > <https://reviewboard.asterisk.org/r/3780/diff/1/?file=63302#file63302line71>
> >
> >     This seems like an odd default behavior. I would suspect that by default we would actually magic up a From URI of our own based instead of telling the server that the message is coming from itself.
> >     
> >     Doing this when no to_uri is provided makes good sense though.

It's a PJSIPism, and it actually makes sense (imo). In the case of PUBLISH you are publishing information about yourself usually. It makes sense that it should be coming from you.


> On July 17, 2014, 9:49 p.m., Mark Michelson wrote:
> > /trunk/res/res_pjsip_publish_asterisk.c, lines 428-430
> > <https://reviewboard.asterisk.org/r/3780/diff/1/?file=63304#file63304line428>
> >
> >     Is there some sort of stasis cache removal you could perform here?

So the best I could do is:

1. For device state do a full cache dump, run the regex against, and set everything it matches to unknown.
2. For mailbox state do a full cache dump, run the regex against, and set every mailbox to 0/0

I would also need to extend things to store a bit of state information about the publisher we are receiving updates from (specifically the eid).

Thoughts?


- Joshua


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


On July 14, 2014, 3:25 p.m., Joshua Colp wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3780/
> -----------------------------------------------------------
> 
> (Updated July 14, 2014, 3:25 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> This adds two PJSIP modules which add outbound PUBLISH support and an 'asterisk' event type.
> 
> The res_pjsip_outbound_publish module is a common module which provides basic logic for setting up outbound PUBLISH clients, handling authentication requests, handling configuration, and lifetime. Extra modules implement specific event types which are registered with res_pjsip_outbound_publish. Since it takes care of configuration when an outbound PUBLISH is configured extra configuration can be passed to the event type implementation to further configure itself.
> 
> The res_pjsip_publish_asterisk module implements inbound and outbound support for an 'asterisk' event type. This event type conveys device and mailbox state between Asterisk instances using a JSON content body. As internal device or mailbox state changes the module sends a PUBLISH message to other configured instances. When a PUBLISH is received the contents are examined and a device or mailbox state change queued up within Asterisk. To restrict what is sent and received filtering is available using regular expressions which can reduce SIP traffic.
> 
> A wiki page is available at https://wiki.asterisk.org/wiki/display/~jcolp/Exchanging+Device+and+Mailbox+State+Using+PJSIP which has some configuration details with some examples. This should also be reviewed.
> 
> 
> Diffs
> -----
> 
>   /trunk/res/res_pjsip_pubsub.exports.in 418582 
>   /trunk/res/res_pjsip_pubsub.c 418582 
>   /trunk/res/res_pjsip_publish_asterisk.c PRE-CREATION 
>   /trunk/res/res_pjsip_outbound_publish.exports.in PRE-CREATION 
>   /trunk/res/res_pjsip_outbound_publish.c PRE-CREATION 
>   /trunk/include/asterisk/res_pjsip_pubsub.h 418582 
>   /trunk/include/asterisk/res_pjsip_outbound_publish.h PRE-CREATION 
>   /trunk/configs/pjsip.conf.sample 418582 
> 
> Diff: https://reviewboard.asterisk.org/r/3780/diff/
> 
> 
> Testing
> -------
> 
> Set up two Asterisk instances, configured both sides to publish to eachother, made calls and manipulated voicemail. Watched PUBLISH messages go between them and state change.
> 
> 
> Thanks,
> 
> Joshua Colp
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140721/4e624e5b/attachment-0001.html>


More information about the asterisk-dev mailing list