Re: [asterisk-dev] Asterisk and external SIP subscribtions

2014-03-20 Thread Paul Belanger
On Wed, Mar 19, 2014 at 12:22 PM, Olle E. Johansson o...@edvina.net wrote:

 On 19 Mar 2014, at 16:59, Matthew Jordan mjor...@digium.com wrote:

 On Wed, Mar 19, 2014 at 10:00 AM, Olle E. Johansson o...@edvina.net wrote:

 On 19 Mar 2014, at 15:55, Olle E. Johansson o...@edvina.net wrote:


 On 19 Mar 2014, at 15:41, Matthew Jordan mjor...@digium.com wrote:

 On Wed, Mar 19, 2014 at 9:26 AM, Olle E. Johansson o...@edvina.net 
 wrote:

 snip


 snip


 Fundamentally, I've been thinking about this problem more around
 device states: that is, if all Asterisk instances have the ability to
 share their device states - whatever those device states happen to
 derive from - then every Asterisk instance can build the same
 extension states if they so choose to. Or not - but it ends up being a
 function of the Asterisk dialplan at each instance, as opposed to
 something forced.

 In a world where all Asterisk instances know of the device states for
 any other Asterisk instance, can you explain why publishing extension
 states are needed?

 As I said - to off load NOTIFications to phones for blinking lamps.
 Asterisk PUBLISH extension state to the proxy. The proxy manages
 all the subscriptions. Everyone is happy and do what they do best.

 BTW the PUBLISH is in the good ol' dialog-info XML format.


 That makes sense. Thanks!

 In Asterisk 12/trunk, both the extension state as well as device state
 have a subscription based API in Asterisk, so both should be readily
 doable without any changes in the core.

 I looked in both pinana-initialize-devstate-1.8 as well as
 pinana-initialize-devstate-trunk,
 Those two was just a small patch that I found during that work. It's not the 
 core.
 It's in pinana-publish-1.4
 We got to a state where you could subscribe to the state between asterisk 
 servers.

 I think the dialplan hint was something like:

 exten = 2001,hint,sipds:sip:3...@atlanta.example.com

 This would force a subscription on device states from another server - 
 Kamailio
 or Asterisk.

 /O

 ===

 * sip_presence.conf.sample

 ; Configuration file for SIP presence integration
 ;
 ; This is where you configure
 ;  - presence servers to use
 ;  - which extensions to publish
 ;  - which devices to publish

 [pinana-one]
 type=presenceserver
 ; Domain for presence states published TO this server
 domain=astritech.org
 ; Hostname can be DNS name or device in sip.conf
 host=coreproxy7
 filter=SIP/,meetme:

 [pinana-two]
 type=presenceserver
 domain=devstate.astritech.org
 ;hostname used for this server
 host=coreproxy8

So it sounds like there is no technical document any place, just code
in subversion.  So, we'll get started on something and get it up onto
the wiki, people can chime in on the design side.  Once people are
on-board with the technology and such, we'll fund the development and
aim to get it into Asterisk 13.

-- 
Paul Belanger | PolyBeacon, Inc.
Jabber: paul.belan...@polybeacon.com | IRC: pabelanger (Freenode)
Github: https://github.com/pabelanger | Twitter: https://twitter.com/pabelanger

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev


Re: [asterisk-dev] Asterisk and external SIP subscribtions

2014-03-20 Thread Olle E. Johansson
I published a presentation about Pinana on
http://www.slideshare.net/oej/pinana-old-proposal-for-distributed-sip-states

/O

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev


Re: [asterisk-dev] Asterisk and external SIP subscribtions

2014-03-19 Thread Olle E. Johansson

On 19 Mar 2014, at 14:50, Paul Belanger paul.belan...@polybeacon.com wrote:

 Greetings,
 
 I wanted to ask if there is any sort of design document / work started
 on having Asterisk 13 be able to subscribe to external SIP messages
 for the purpose of presence (device state).
 
 More and more we are trying to come up with a good way to have
 Asterisk be aware of SIP subscriber presence from our proxy (kamailio)
 and propagate that information into Asterisk. Today we are using
 custom device state and some AMI / console scripts to do this, but its
 a pain to maintain / deploy.
 
 So, what we (our company) was planning on doing was funding some
 developer to go out and build us something on top of pjproject to
 handle this.  Some sort of res_pjsip_foo module to handle presence
 from Kamailio.  The question comes up which RFC is should be, but at
 this point in time, that's a discussion point.
I have an old design and some code for chan_sip, but the design should
be working for chan_pjsip as well. Google for project pinana.
I presented it at a astridevcon years ago.
The important thing is to have a generic design so we can publish
states of non-sip extensions too.

 
 Talking to matt, I think we want to use the res_pjsip_pubsub.c module,
 but need to confirm. And the reason for having this email. So, is
 anybody interested in helping us build it?  Both from a design apsect,
 so we can get it into Asterisk and / or help find a developer to do
 the work / funding?
 
 I see said module having some config file that will allow you to
 specific your source, and the domains you which to subscribe too.
 Then, when asterisk starts, it sets up the subscriptions and then
 listens for the publish and stores them as local (internal) device
 states.  I don't really care about adding publish support at this
 point in time, simply because everything SIP related is outside
 asterisk.
 
 EG:
 
 [example.org]
 server = 192.168.1.1
 users = *
 
 So, thoughts?  Interested in helping? Want to also fund this venture?
Start with reviewing my design.

/O

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev


Re: [asterisk-dev] Asterisk and external SIP subscribtions

2014-03-19 Thread Paul Belanger
On Wed, Mar 19, 2014 at 9:56 AM, Olle E. Johansson o...@edvina.net wrote:

 On 19 Mar 2014, at 14:50, Paul Belanger paul.belan...@polybeacon.com wrote:

 Greetings,

 I wanted to ask if there is any sort of design document / work started
 on having Asterisk 13 be able to subscribe to external SIP messages
 for the purpose of presence (device state).

 More and more we are trying to come up with a good way to have
 Asterisk be aware of SIP subscriber presence from our proxy (kamailio)
 and propagate that information into Asterisk. Today we are using
 custom device state and some AMI / console scripts to do this, but its
 a pain to maintain / deploy.

 So, what we (our company) was planning on doing was funding some
 developer to go out and build us something on top of pjproject to
 handle this.  Some sort of res_pjsip_foo module to handle presence
 from Kamailio.  The question comes up which RFC is should be, but at
 this point in time, that's a discussion point.
 I have an old design and some code for chan_sip, but the design should
 be working for chan_pjsip as well. Google for project pinana.
 I presented it at a astridevcon years ago.
 The important thing is to have a generic design so we can publish
 states of non-sip extensions too.


 Talking to matt, I think we want to use the res_pjsip_pubsub.c module,
 but need to confirm. And the reason for having this email. So, is
 anybody interested in helping us build it?  Both from a design apsect,
 so we can get it into Asterisk and / or help find a developer to do
 the work / funding?

 I see said module having some config file that will allow you to
 specific your source, and the domains you which to subscribe too.
 Then, when asterisk starts, it sets up the subscriptions and then
 listens for the publish and stores them as local (internal) device
 states.  I don't really care about adding publish support at this
 point in time, simply because everything SIP related is outside
 asterisk.

 EG:

 [example.org]
 server = 192.168.1.1
 users = *

 So, thoughts?  Interested in helping? Want to also fund this venture?
 Start with reviewing my design.

So the MVP for my concept is pretty simple, subscribe to external
source and update asterisk device states. The reason for this, like
everybody, is I have multiple asterisk boxes behind a proxy. So, if I
dial the same SIP subscriber from two different boxes, I want asterisk
to know the states.

I think this fits well with the res_pjsip_foo module design, but I
might be wrong.

And I want this to be simple, I don't want to depend on XMPP servers,
res_corsync, python scripts, etc.  That's why I asked if anybody else
seen value in this, which I think people do.

-- 
Paul Belanger | PolyBeacon, Inc.
Jabber: paul.belan...@polybeacon.com | IRC: pabelanger (Freenode)
Github: https://github.com/pabelanger | Twitter: https://twitter.com/pabelanger

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev


Re: [asterisk-dev] Asterisk and external SIP subscribtions

2014-03-19 Thread Olle E. Johansson

On 19 Mar 2014, at 15:20, Paul Belanger paul.belan...@polybeacon.com wrote:

 On Wed, Mar 19, 2014 at 9:56 AM, Olle E. Johansson o...@edvina.net wrote:
 
 On 19 Mar 2014, at 14:50, Paul Belanger paul.belan...@polybeacon.com wrote:
 
 Greetings,
 
 I wanted to ask if there is any sort of design document / work started
 on having Asterisk 13 be able to subscribe to external SIP messages
 for the purpose of presence (device state).
 
 More and more we are trying to come up with a good way to have
 Asterisk be aware of SIP subscriber presence from our proxy (kamailio)
 and propagate that information into Asterisk. Today we are using
 custom device state and some AMI / console scripts to do this, but its
 a pain to maintain / deploy.
 
 So, what we (our company) was planning on doing was funding some
 developer to go out and build us something on top of pjproject to
 handle this.  Some sort of res_pjsip_foo module to handle presence
 from Kamailio.  The question comes up which RFC is should be, but at
 this point in time, that's a discussion point.
 I have an old design and some code for chan_sip, but the design should
 be working for chan_pjsip as well. Google for project pinana.
 I presented it at a astridevcon years ago.
 The important thing is to have a generic design so we can publish
 states of non-sip extensions too.
 
 
 Talking to matt, I think we want to use the res_pjsip_pubsub.c module,
 but need to confirm. And the reason for having this email. So, is
 anybody interested in helping us build it?  Both from a design apsect,
 so we can get it into Asterisk and / or help find a developer to do
 the work / funding?
 
 I see said module having some config file that will allow you to
 specific your source, and the domains you which to subscribe too.
 Then, when asterisk starts, it sets up the subscriptions and then
 listens for the publish and stores them as local (internal) device
 states.  I don't really care about adding publish support at this
 point in time, simply because everything SIP related is outside
 asterisk.
 
 EG:
 
 [example.org]
 server = 192.168.1.1
 users = *
 
 So, thoughts?  Interested in helping? Want to also fund this venture?
 Start with reviewing my design.
 
 So the MVP for my concept is pretty simple, subscribe to external
 source and update asterisk device states.
Or extension states? Which one do you want to propagate? Which
one should users subscribing to a state in the kamailio server get?
Remember that extension states != device state!

 The reason for this, like
 everybody, is I have multiple asterisk boxes behind a proxy. So, if I
 dial the same SIP subscriber from two different boxes, I want asterisk
 to know the states.
Right. And to be able to move phones to the proxy so that all blinking
lamps notifications are happening there, not on Asterisk.
 
 I think this fits well with the res_pjsip_foo module design, but I
 might be wrong.
If not, then we have to have a serious talk with Mr Colp. I expect
it to be ready for it. 
 
 And I want this to be simple, I don't want to depend on XMPP servers,
 res_corsync, python scripts, etc.  That's why I asked if anybody else
Yes! There's value in this.

- We can have call queues on one server getting states from others.
- We can offload the NOTIFY handling.
- We can scale, scale, scale.

While working on Pinana we realized that th XMPP stuff was not
handling device/extension states correctly - I worked with the
developer of the XMPP state distribution in my design and we
realized that he had missed the distinction.

We need to be able to publish device states for aggregation into
extension states, but also publish extension states for blinking
lamps. IE, a hint would be based on a device state subscription.

The device state event states could be simple JSON attachments,
preferably with a host name, the channel name and the device name.

/O


-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev


Re: [asterisk-dev] Asterisk and external SIP subscribtions

2014-03-19 Thread Matthew Jordan
On Wed, Mar 19, 2014 at 9:26 AM, Olle E. Johansson o...@edvina.net wrote:

snip

 While working on Pinana we realized that th XMPP stuff was not
 handling device/extension states correctly - I worked with the
 developer of the XMPP state distribution in my design and we
 realized that he had missed the distinction.

 We need to be able to publish device states for aggregation into
 extension states, but also publish extension states for blinking
 lamps. IE, a hint would be based on a device state subscription.


Fundamentally, I've been thinking about this problem more around
device states: that is, if all Asterisk instances have the ability to
share their device states - whatever those device states happen to
derive from - then every Asterisk instance can build the same
extension states if they so choose to. Or not - but it ends up being a
function of the Asterisk dialplan at each instance, as opposed to
something forced.

In a world where all Asterisk instances know of the device states for
any other Asterisk instance, can you explain why publishing extension
states are needed?

-- 
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com  http://asterisk.org

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev


Re: [asterisk-dev] Asterisk and external SIP subscribtions

2014-03-19 Thread Olle E. Johansson

On 19 Mar 2014, at 15:41, Matthew Jordan mjor...@digium.com wrote:

 On Wed, Mar 19, 2014 at 9:26 AM, Olle E. Johansson o...@edvina.net wrote:
 
 snip
 
 While working on Pinana we realized that th XMPP stuff was not
 handling device/extension states correctly - I worked with the
 developer of the XMPP state distribution in my design and we
 realized that he had missed the distinction.
 
 We need to be able to publish device states for aggregation into
 extension states, but also publish extension states for blinking
 lamps. IE, a hint would be based on a device state subscription.
 
 
 Fundamentally, I've been thinking about this problem more around
 device states: that is, if all Asterisk instances have the ability to
 share their device states - whatever those device states happen to
 derive from - then every Asterisk instance can build the same
 extension states if they so choose to. Or not - but it ends up being a
 function of the Asterisk dialplan at each instance, as opposed to
 something forced.
 
 In a world where all Asterisk instances know of the device states for
 any other Asterisk instance, can you explain why publishing extension
 states are needed?

As I said - to off load NOTIFications to phones for blinking lamps.
Asterisk PUBLISH extension state to the proxy. The proxy manages 
all the subscriptions. Everyone is happy and do what they do best.

/O

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev


Re: [asterisk-dev] Asterisk and external SIP subscribtions

2014-03-19 Thread Matthew Jordan
On Wed, Mar 19, 2014 at 10:00 AM, Olle E. Johansson o...@edvina.net wrote:

 On 19 Mar 2014, at 15:55, Olle E. Johansson o...@edvina.net wrote:


 On 19 Mar 2014, at 15:41, Matthew Jordan mjor...@digium.com wrote:

 On Wed, Mar 19, 2014 at 9:26 AM, Olle E. Johansson o...@edvina.net wrote:

 snip


snip


 Fundamentally, I've been thinking about this problem more around
 device states: that is, if all Asterisk instances have the ability to
 share their device states - whatever those device states happen to
 derive from - then every Asterisk instance can build the same
 extension states if they so choose to. Or not - but it ends up being a
 function of the Asterisk dialplan at each instance, as opposed to
 something forced.

 In a world where all Asterisk instances know of the device states for
 any other Asterisk instance, can you explain why publishing extension
 states are needed?

 As I said - to off load NOTIFications to phones for blinking lamps.
 Asterisk PUBLISH extension state to the proxy. The proxy manages
 all the subscriptions. Everyone is happy and do what they do best.

 BTW the PUBLISH is in the good ol' dialog-info XML format.


That makes sense. Thanks!

In Asterisk 12/trunk, both the extension state as well as device state
have a subscription based API in Asterisk, so both should be readily
doable without any changes in the core.

I looked in both pinana-initialize-devstate-1.8 as well as
pinana-initialize-devstate-trunk, but I didn't find where the
configuration for publishing device state/extension state was
documented. Admittedly, I was looking at sip.conf.sample - should I be
looking elsewhere?

-- 
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com  http://asterisk.org

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev


Re: [asterisk-dev] Asterisk and external SIP subscribtions

2014-03-19 Thread Olle E. Johansson

On 19 Mar 2014, at 16:59, Matthew Jordan mjor...@digium.com wrote:

 On Wed, Mar 19, 2014 at 10:00 AM, Olle E. Johansson o...@edvina.net wrote:
 
 On 19 Mar 2014, at 15:55, Olle E. Johansson o...@edvina.net wrote:
 
 
 On 19 Mar 2014, at 15:41, Matthew Jordan mjor...@digium.com wrote:
 
 On Wed, Mar 19, 2014 at 9:26 AM, Olle E. Johansson o...@edvina.net wrote:
 
 snip
 
 
 snip
 
 
 Fundamentally, I've been thinking about this problem more around
 device states: that is, if all Asterisk instances have the ability to
 share their device states - whatever those device states happen to
 derive from - then every Asterisk instance can build the same
 extension states if they so choose to. Or not - but it ends up being a
 function of the Asterisk dialplan at each instance, as opposed to
 something forced.
 
 In a world where all Asterisk instances know of the device states for
 any other Asterisk instance, can you explain why publishing extension
 states are needed?
 
 As I said - to off load NOTIFications to phones for blinking lamps.
 Asterisk PUBLISH extension state to the proxy. The proxy manages
 all the subscriptions. Everyone is happy and do what they do best.
 
 BTW the PUBLISH is in the good ol' dialog-info XML format.
 
 
 That makes sense. Thanks!
 
 In Asterisk 12/trunk, both the extension state as well as device state
 have a subscription based API in Asterisk, so both should be readily
 doable without any changes in the core.
 
 I looked in both pinana-initialize-devstate-1.8 as well as
 pinana-initialize-devstate-trunk,
Those two was just a small patch that I found during that work. It's not the 
core.
It's in pinana-publish-1.4
We got to a state where you could subscribe to the state between asterisk 
servers.

I think the dialplan hint was something like:

exten = 2001,hint,sipds:sip:3...@atlanta.example.com

This would force a subscription on device states from another server - Kamailio
or Asterisk.

/O

===

* sip_presence.conf.sample

; Configuration file for SIP presence integration
;
; This is where you configure
;  - presence servers to use
;  - which extensions to publish
;  - which devices to publish

[pinana-one]
type=presenceserver
; Domain for presence states published TO this server
domain=astritech.org
; Hostname can be DNS name or device in sip.conf
host=coreproxy7
filter=SIP/,meetme:

[pinana-two]
type=presenceserver
domain=devstate.astritech.org
;hostname used for this server
host=coreproxy8




-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev