SlideShare une entreprise Scribd logo
1  sur  39
Télécharger pour lire hors ligne
Asterisk, Instant Messaging and
        Presence, how?
    Saúl Ibarra Corretgé <saghul@gmail.com>

                  http://www.saghul.net

                  http://www.sipdoc.net

                  saghul



                        http://www.irontec.com
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                                  About me



●   saghul
       – VoIP enthusiast, playing around with Asterisk since 2k5
       – GNU/Linux lover likes everything “Software Libre”
       – Co-founder of http://sipdoc.net
       – Highly involved in spanish VoIP comunities




                                                                                2
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                            This presentation

●   http://www.saghul.net/blog/downloads/astricon2k9/
●   http://www.slideshare.net/saghul/
      –   Slides
      –   Complete configuration files
      –   Database example data




                                                                                  3
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                                       Index

1. Asterisk and presence status
2. SIP SIMPLE or XMPP?
3. The XMPP solution
     1. OpenFire setup
4. The SIMPLE solution
     1. Kamailio + Asterisk setup
5. Conclusions




                                                                               4
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                       What we do have now

●   Asterisk SIP support (chan_sip)
      –   In-dialog MESSAGE :-(
      –   SUBSCRIBE and NOTIFY support
            ●   For Event: dialog
            ●   What about Event: Presence? :-(
      –   No PUBLISH support :-(
●   Asterisk XMPP support
      –   res_jabber
            ●   JabberSend, JABBER_RECEIVE, JABBER_STATUS
      –   chan_gtalk, chan_jingle
●   Am I missing something?


                                                                                    5
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                            Do we need presence and IM?

●   “I want to talk to you, not to your phone”
●   Are you available?
      –   For an audio conference?
      –   Just for IM?
      –   For whom?
●   Where are you?
      –   Mobile
      –   Office
      –   Home
      –   ...

We need to know if a user is available
       and what his status is
                                                                                   6
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                           What we need

●   A presence server
●   Users may publish their status
●   Users may subscribe to other users status
●   Instant Messaging between users

              Is it possible only with Asterisk?



                             NO

                                                                               7
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?




SIMPLE or XMPP?
                                                                   8
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                              SIMPLE vs XMPP

●   Did SIMPLE reinvent the wheel?
●   Large companies started adopting SIMPLE (Microsoft,
    …)
       –   Propietary extensions :-(
●   XMPP does not provide voice capabilities
       –   Well, there is Jingle...
●   If SIP is the VoIP protocol: why not use it also for
    presence and IM?




                                                                                    9
The XMPP solution
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                      The XMPP solution

●   Integrate Asterisk with a XMPP server




                                                                           11
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                                  OpenFire

●   Open Source
●   Java based
●   Multiplatform
●   Asterisk integration plugin
●   SIP softphone plugin
●   Gateways to multiple mi services: MSN, Yahoo, …
●   Easy installation!




                                                                           12
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                                   OpenFire (II)
●   Download deb package
●   dpkg -i openfire_3.6.4_all.deb




                                                                                13
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                               OpenFire (III)

●   Web based configuration
●   Clustering architecture
●   Connection to the Asterisk Manager Interface
      –   Multiple connections
●   Mapping between Asterisk SIP users and OpenFire
    XMPP users
●   Multiplatform Java client: Spark
●   Flash based web client: SparkWeb




                                                                             14
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                              OpenFire (IV)




                                                            15
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                              OpenFire (V)

●   When a user is talking OpenFire puts it “On the phone”




                                                                           16
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                              OpenFire (VI)




                                                            17
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                                OpenFire (VI)

●   What we get
      –   Instant Messaging
      –   Presence
      –   Gateways to other mi services
      –   Text conferencing
●   Problems
      –   Duplicated users (we could partially fix it with LDAP)
      –   Need to handle 2 protocols
      –   Not many softphones support SIP and XMPP
      –   Do any hardphones support XMPP?




                                                                              18
The SIP solution
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                          A complex protocol

●   SIMPLE IETF working group
      –   Presence RFCs
            ●   3856, 3857, 3858, 3863, 4479, 4480, 4482, ...
      –   XCAP
            ●   4825, 4826, 4827, 5025, …
      –   Instant Messaging
            ●   3428, 3994, 4975, …




     SIMPLE is NOT simple!

                                                                                20
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                             The SIP solution

●   Integrate Asterisk and Kamailio to provide IM and
    presence.
●   Users are registered to Kamailio.
●   INVITE requests are routed through the Asterisk server.
      –   Asterisk RealTime user integration with Kamailio's
            subscriber table.
●   PUBLISH, SUBSCRIBE and MESSAGE requests are
    handled by Kamailio.




                                                                              21
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                           Registration




REGISTER



                 Store location            Asterisk does
                                             nothing!



                                                                       22
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                             Kamailio – Asterisk RealTime integration

●   Asterisk peers are Kamailio's subscribers.
●   MySQL view so that Asterisk 'sees' the users as his own.
●   Peers IP → Kamailio IP.
●   Calls between users go through Kamailio and Asterisk.
●   We need to call to alphanumeric users → DB Alias




                                                                            23
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                             Kamailio – Asterisk RealTime integration (2)

CREATE VIEW sip_peers AS
SELECT subscriber.username AS name,
subscriber.username AS defaultuser,
'friend' AS type,
NULL AS secret,
subscriber.domain AS host,
concat(subscriber.rpid,' ','<',subscriber.username,'>') AS callerid,
'from-users' AS context,
subscriber.username AS mailbox,
'yes' AS nat,
'no' AS qualify,
'info' AS dtmfmode,
subscriber.username AS fromuser,

                                                                                24
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                           Kamailio – Asterisk RealTime integration (3)

NULL AS authuser,
subscriber.domain AS fromdomain,
NULL AS insecure,
'no' AS canreinvite,
NULL AS disallow,
'all' AS allow,
NULL AS restrictcid,
subscriber.domain AS defaultip,
subscriber.domain AS ipaddr,
subscriber.domain AS outboundproxy,
'5060' AS port,
NULL AS regseconds
FROM kamailio_1.subscriber;

                                                                              25
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                                       Invitation

                    2. Find numeric Alias                  5. Dial to the X-
                    3. Add X-Subscriber                    Subscriber user
                    header
          1. INVITE
Alice       (Bob)
                                              4. INVITE
                                               (2001)

                                            6. INVITE (Bob)

        8. INVITE          7. Lookup
Bob       (Bob)           user location



                                                                                26
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                              Invitation (2)

# Route all INVITE requests to Asterisk
if (is_method("INVITE")) {
     # Remove X-Subscriber header so that no one sees it...
     remove_hf("X-Subscriber");


     # We don't have to route the requests coming FROM Asterisk
     # back to Asterisk. We would make a loop!
     if (!($si == "AST_IP" && $sp == "AST_PORT")) {
          route(ASTERISK_USERS_ROUTE);
     }
}




                                                                           27
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                                  Invitation (3)

# Send INVITE requests to the Asterisk server
route[ASTERISK_USERS_ROUTE] {
     # Call to the numeric alias
     avp_db_query("SELECT alias_username FROM dbaliases WHERE username
= '$rU' AND domain = '$avp(AVP_ORIGDOMAIN)'LIMIT 1",
"$avp(AVP_NUMALIAS)”);
     if (is_avp_set("$avp(AVP_NUMALIAS)")) {
          # Save the subscriber in a header so we can use it in Asterisk
          append_hf("X-Subscriber: $rUrn");
          $rU = $avp(s:numalias);
     }


     $rd = "AST_IP";
     $rp = "AST_PORT";
     route(RELAY_ROUTE);
}                                                                              28
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                              Invitation (4)


[from-users]
exten => _X.,1,NoOp()
exten => _X.,n,Set(SUBSCRIBER=${SIP_HEADER(X-Subscriber)})
exten => _X.,n,GotoIf($[${LEN(${SUBSCRIBER})} = 0]?hang)
exten => _X.,n,Dial(SIP/${SUBSCRIBER})
exten => _X.,n(hang),Hangup




                                                                           29
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                               SIMPLE presence



        1. SUBSCRIBE
            (Bob)              2. handle_subscribe

Alice

         5. NOTIFY



        3. PUBLISH                4. handle_publish             Asterisk does
Bob                                                               nothing!



                                                                                 30
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                      SIMPLE presence (2)
# Handle presence requests
    if(is_method("PUBLISH|SUBSCRIBE")) {
            route(PRESENCE_ROUTE);
    }


# Handle presence
route[PRESENCE_ROUTE] {
    if (is_method("PUBLISH")) {
            handle_publish();
            t_release();
    } else if (is_method("SUBSCRIBE")) {
            handle_subscribe();
            t_release();
    }
    exit;
}                                                                            31
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                                     Messaging



        1. MESSAGE (Bob)
                                2. Lookup location
Alice




           3. MESSAGE
                                                              Asterisk does
Bob                                                             nothing!



                                                                               32
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                                NAT handling

●   We just need to fix the NAT in signalling.
●   Our Asterisk 'peers' are configured with nat=yes
      –   COMEDIA mode
      –   Audio will go through Asterisk




                                                                              33
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                 Further improvements...




                                                            34
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                          Further improvements... (2)




What about mixing both?
   –   OpenFire's Asterisk plugin still works! (regardless
        of the integration with Kamailio)




                                                                         35
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?




SIMPLE or XMPP?
                                                               36
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                                    Thanks!

BYE sip:astricon@astricon.net SIP/2.0
Via: SIP/2.0/UDP guest.astricon.net:5060;branch=z9hG4bKnashds7
Max-Forwards: 70
From: saghul <sip:saghul@sipdoc.net>;tag=8321234356
To: AstriCon <sip:astricon@astricon.net>;tag=9fxced76sl
Call-ID: 3848276298220188511@astricon.net
CSeq: 1 BYE
Content-Length: 0


    Thanks for watching!


                                                                           37
Any questions?
AstriCon 2009: Asterisk, Instant Messaging and Presence, how?

                                                                 License




  http://creativecommons.org/licenses/by-sa/3.0/




All images are property of their respective authors.
                                                                       39

Contenu connexe

En vedette (8)

операционные системы
операционные системыоперационные системы
операционные системы
 
группа 6
группа 6группа 6
группа 6
 
Squiper
SquiperSquiper
Squiper
 
Lead Generation Ideas
Lead Generation IdeasLead Generation Ideas
Lead Generation Ideas
 
Starting out in PR
Starting out in PRStarting out in PR
Starting out in PR
 
Depth of field
Depth of fieldDepth of field
Depth of field
 
Brasa Fire Catalog lr[1]
Brasa Fire Catalog lr[1]Brasa Fire Catalog lr[1]
Brasa Fire Catalog lr[1]
 
Sin eng-46 - pet rangers (form)
Sin eng-46 - pet rangers (form)Sin eng-46 - pet rangers (form)
Sin eng-46 - pet rangers (form)
 

Similaire à Asterisk presence-im-091015103222-phpapp02

ICE: The ultimate way of beating NAT in SIP
ICE: The ultimate way of beating NAT in SIPICE: The ultimate way of beating NAT in SIP
ICE: The ultimate way of beating NAT in SIPSaúl Ibarra Corretgé
 
Super feats of integration x pages with symphony sharepoint and office
Super feats of integration  x pages with symphony sharepoint and officeSuper feats of integration  x pages with symphony sharepoint and office
Super feats of integration x pages with symphony sharepoint and officeJohn Head
 
Virgo RT from Eclipse Summit Europe 2010
Virgo RT from Eclipse Summit Europe 2010Virgo RT from Eclipse Summit Europe 2010
Virgo RT from Eclipse Summit Europe 2010Christopher Frost
 
Breizhcamp: Créer un bot, pas si simple. Faisons le point.
Breizhcamp: Créer un bot, pas si simple. Faisons le point.Breizhcamp: Créer un bot, pas si simple. Faisons le point.
Breizhcamp: Créer un bot, pas si simple. Faisons le point.Cisco DevNet
 
OpenStack Swiftの最新機能とStorlets
OpenStack Swiftの最新機能とStorletsOpenStack Swiftの最新機能とStorlets
OpenStack Swiftの最新機能とStorletsKota Tsuyuzaki
 
OpenStackユーザ会資料 - Masakari
OpenStackユーザ会資料 - MasakariOpenStackユーザ会資料 - Masakari
OpenStackユーザ会資料 - Masakarimasahito12
 
Astricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installationsAstricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installationsOlle E Johansson
 
Rome 2017: Building advanced voice assistants and chat bots
Rome 2017: Building advanced voice assistants and chat botsRome 2017: Building advanced voice assistants and chat bots
Rome 2017: Building advanced voice assistants and chat botsCisco DevNet
 
S3 Server Hackathon Presented by S3 Server, a Scality Product, Seagate and Ho...
S3 Server Hackathon Presented by S3 Server, a Scality Product, Seagate and Ho...S3 Server Hackathon Presented by S3 Server, a Scality Product, Seagate and Ho...
S3 Server Hackathon Presented by S3 Server, a Scality Product, Seagate and Ho...Scality
 
Hackathon scality holberton seagate 2016 v5
Hackathon scality holberton seagate 2016 v5Hackathon scality holberton seagate 2016 v5
Hackathon scality holberton seagate 2016 v5Scality
 
20110924 kansai kinect_vol1
20110924 kansai kinect_vol120110924 kansai kinect_vol1
20110924 kansai kinect_vol1Kaoru NAKAMURA
 
Mixing reality with mobile AR, Дмитрий Щербина
Mixing reality with mobile AR, Дмитрий ЩербинаMixing reality with mobile AR, Дмитрий Щербина
Mixing reality with mobile AR, Дмитрий ЩербинаSigma Software
 

Similaire à Asterisk presence-im-091015103222-phpapp02 (20)

ICE: The ultimate way of beating NAT in SIP
ICE: The ultimate way of beating NAT in SIPICE: The ultimate way of beating NAT in SIP
ICE: The ultimate way of beating NAT in SIP
 
Super feats of integration x pages with symphony sharepoint and office
Super feats of integration  x pages with symphony sharepoint and officeSuper feats of integration  x pages with symphony sharepoint and office
Super feats of integration x pages with symphony sharepoint and office
 
Virgo RT from Eclipse Summit Europe 2010
Virgo RT from Eclipse Summit Europe 2010Virgo RT from Eclipse Summit Europe 2010
Virgo RT from Eclipse Summit Europe 2010
 
Content-Centric Embedded ~Treasure Hunting Robot~ for LinuxCon Japan 2012
Content-Centric Embedded ~Treasure Hunting Robot~ for LinuxCon Japan 2012Content-Centric Embedded ~Treasure Hunting Robot~ for LinuxCon Japan 2012
Content-Centric Embedded ~Treasure Hunting Robot~ for LinuxCon Japan 2012
 
IoTivity: From Devices to the Cloud
IoTivity: From Devices to the CloudIoTivity: From Devices to the Cloud
IoTivity: From Devices to the Cloud
 
Breizhcamp: Créer un bot, pas si simple. Faisons le point.
Breizhcamp: Créer un bot, pas si simple. Faisons le point.Breizhcamp: Créer un bot, pas si simple. Faisons le point.
Breizhcamp: Créer un bot, pas si simple. Faisons le point.
 
OpenStack Swiftの最新機能とStorlets
OpenStack Swiftの最新機能とStorletsOpenStack Swiftの最新機能とStorlets
OpenStack Swiftの最新機能とStorlets
 
Advanced Topics in IP Multicast Deployment
Advanced Topics in IP Multicast DeploymentAdvanced Topics in IP Multicast Deployment
Advanced Topics in IP Multicast Deployment
 
OpenStackユーザ会資料 - Masakari
OpenStackユーザ会資料 - MasakariOpenStackユーザ会資料 - Masakari
OpenStackユーザ会資料 - Masakari
 
Astricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installationsAstricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installations
 
Ironic - Vietnam OpenStack Technical Meetup #12
Ironic - Vietnam OpenStack Technical Meetup #12Ironic - Vietnam OpenStack Technical Meetup #12
Ironic - Vietnam OpenStack Technical Meetup #12
 
Snappy Kamailio
Snappy KamailioSnappy Kamailio
Snappy Kamailio
 
Rome 2017: Building advanced voice assistants and chat bots
Rome 2017: Building advanced voice assistants and chat botsRome 2017: Building advanced voice assistants and chat bots
Rome 2017: Building advanced voice assistants and chat bots
 
S3 Server Hackathon Presented by S3 Server, a Scality Product, Seagate and Ho...
S3 Server Hackathon Presented by S3 Server, a Scality Product, Seagate and Ho...S3 Server Hackathon Presented by S3 Server, a Scality Product, Seagate and Ho...
S3 Server Hackathon Presented by S3 Server, a Scality Product, Seagate and Ho...
 
Hackathon scality holberton seagate 2016 v5
Hackathon scality holberton seagate 2016 v5Hackathon scality holberton seagate 2016 v5
Hackathon scality holberton seagate 2016 v5
 
20110924 kansai kinect_vol1
20110924 kansai kinect_vol120110924 kansai kinect_vol1
20110924 kansai kinect_vol1
 
Mixing reality with mobile AR, Дмитрий Щербина
Mixing reality with mobile AR, Дмитрий ЩербинаMixing reality with mobile AR, Дмитрий Щербина
Mixing reality with mobile AR, Дмитрий Щербина
 
Connected TIZEN
Connected TIZENConnected TIZEN
Connected TIZEN
 
Tizen Connected with IoTivity
Tizen Connected with IoTivityTizen Connected with IoTivity
Tizen Connected with IoTivity
 
Content-Centric Embedded
Content-Centric EmbeddedContent-Centric Embedded
Content-Centric Embedded
 

Plus de Newlink

Businessmodelgenerationpreview 100125081253-phpapp01
Businessmodelgenerationpreview 100125081253-phpapp01Businessmodelgenerationpreview 100125081253-phpapp01
Businessmodelgenerationpreview 100125081253-phpapp01Newlink
 
Business model-design-and-innovation-for-competitive-advantage-19352
Business model-design-and-innovation-for-competitive-advantage-19352Business model-design-and-innovation-for-competitive-advantage-19352
Business model-design-and-innovation-for-competitive-advantage-19352Newlink
 
Thefutureofwork 091027180703-phpapp01
Thefutureofwork 091027180703-phpapp01Thefutureofwork 091027180703-phpapp01
Thefutureofwork 091027180703-phpapp01Newlink
 
2011 06-29- sp-seminar- cisco cdn solution-1
2011 06-29- sp-seminar- cisco cdn solution-12011 06-29- sp-seminar- cisco cdn solution-1
2011 06-29- sp-seminar- cisco cdn solution-1Newlink
 
Ciscounifiedservicedeliverylaunchmay2009final 090512004229-phpapp01
Ciscounifiedservicedeliverylaunchmay2009final 090512004229-phpapp01Ciscounifiedservicedeliverylaunchmay2009final 090512004229-phpapp01
Ciscounifiedservicedeliverylaunchmay2009final 090512004229-phpapp01Newlink
 
Virtualizationonibmbladecenter 1225792256455769-8
Virtualizationonibmbladecenter 1225792256455769-8Virtualizationonibmbladecenter 1225792256455769-8
Virtualizationonibmbladecenter 1225792256455769-8Newlink
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Newlink
 
Voicecon094distrfinal 090427125221-phpapp01
Voicecon094distrfinal 090427125221-phpapp01Voicecon094distrfinal 090427125221-phpapp01
Voicecon094distrfinal 090427125221-phpapp01Newlink
 
Thenewnetworkforthedatacenter 100519185534-phpapp02
Thenewnetworkforthedatacenter 100519185534-phpapp02Thenewnetworkforthedatacenter 100519185534-phpapp02
Thenewnetworkforthedatacenter 100519185534-phpapp02Newlink
 
Avaya sipwithinyourenterprise-090629022848-phpapp02
Avaya sipwithinyourenterprise-090629022848-phpapp02Avaya sipwithinyourenterprise-090629022848-phpapp02
Avaya sipwithinyourenterprise-090629022848-phpapp02Newlink
 
Curso de-asterisk-everano-2007-1204975330483842-4
Curso de-asterisk-everano-2007-1204975330483842-4Curso de-asterisk-everano-2007-1204975330483842-4
Curso de-asterisk-everano-2007-1204975330483842-4Newlink
 
Asterisk presence-im-091015103222-phpapp02
Asterisk presence-im-091015103222-phpapp02Asterisk presence-im-091015103222-phpapp02
Asterisk presence-im-091015103222-phpapp02Newlink
 
Vnx series-technical-review-110616214632-phpapp02
Vnx series-technical-review-110616214632-phpapp02Vnx series-technical-review-110616214632-phpapp02
Vnx series-technical-review-110616214632-phpapp02Newlink
 
Imentorstevejobspdf 110826082634-phpapp02
Imentorstevejobspdf 110826082634-phpapp02Imentorstevejobspdf 110826082634-phpapp02
Imentorstevejobspdf 110826082634-phpapp02Newlink
 
Qcon 111122082620-phpapp02
Qcon 111122082620-phpapp02Qcon 111122082620-phpapp02
Qcon 111122082620-phpapp02Newlink
 
Awssummit2011nytimesfinal com-110610112751-phpapp01
Awssummit2011nytimesfinal com-110610112751-phpapp01Awssummit2011nytimesfinal com-110610112751-phpapp01
Awssummit2011nytimesfinal com-110610112751-phpapp01Newlink
 
Thenewnetworkforthedatacenter 100519185534-phpapp02 (1)
Thenewnetworkforthedatacenter 100519185534-phpapp02 (1)Thenewnetworkforthedatacenter 100519185534-phpapp02 (1)
Thenewnetworkforthedatacenter 100519185534-phpapp02 (1)Newlink
 
Apc 091016024613-phpapp01
Apc 091016024613-phpapp01Apc 091016024613-phpapp01
Apc 091016024613-phpapp01Newlink
 
Thenewnetworkforthedatacenter 100519185534-phpapp02 (1)
Thenewnetworkforthedatacenter 100519185534-phpapp02 (1)Thenewnetworkforthedatacenter 100519185534-phpapp02 (1)
Thenewnetworkforthedatacenter 100519185534-phpapp02 (1)Newlink
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Newlink
 

Plus de Newlink (20)

Businessmodelgenerationpreview 100125081253-phpapp01
Businessmodelgenerationpreview 100125081253-phpapp01Businessmodelgenerationpreview 100125081253-phpapp01
Businessmodelgenerationpreview 100125081253-phpapp01
 
Business model-design-and-innovation-for-competitive-advantage-19352
Business model-design-and-innovation-for-competitive-advantage-19352Business model-design-and-innovation-for-competitive-advantage-19352
Business model-design-and-innovation-for-competitive-advantage-19352
 
Thefutureofwork 091027180703-phpapp01
Thefutureofwork 091027180703-phpapp01Thefutureofwork 091027180703-phpapp01
Thefutureofwork 091027180703-phpapp01
 
2011 06-29- sp-seminar- cisco cdn solution-1
2011 06-29- sp-seminar- cisco cdn solution-12011 06-29- sp-seminar- cisco cdn solution-1
2011 06-29- sp-seminar- cisco cdn solution-1
 
Ciscounifiedservicedeliverylaunchmay2009final 090512004229-phpapp01
Ciscounifiedservicedeliverylaunchmay2009final 090512004229-phpapp01Ciscounifiedservicedeliverylaunchmay2009final 090512004229-phpapp01
Ciscounifiedservicedeliverylaunchmay2009final 090512004229-phpapp01
 
Virtualizationonibmbladecenter 1225792256455769-8
Virtualizationonibmbladecenter 1225792256455769-8Virtualizationonibmbladecenter 1225792256455769-8
Virtualizationonibmbladecenter 1225792256455769-8
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 
Voicecon094distrfinal 090427125221-phpapp01
Voicecon094distrfinal 090427125221-phpapp01Voicecon094distrfinal 090427125221-phpapp01
Voicecon094distrfinal 090427125221-phpapp01
 
Thenewnetworkforthedatacenter 100519185534-phpapp02
Thenewnetworkforthedatacenter 100519185534-phpapp02Thenewnetworkforthedatacenter 100519185534-phpapp02
Thenewnetworkforthedatacenter 100519185534-phpapp02
 
Avaya sipwithinyourenterprise-090629022848-phpapp02
Avaya sipwithinyourenterprise-090629022848-phpapp02Avaya sipwithinyourenterprise-090629022848-phpapp02
Avaya sipwithinyourenterprise-090629022848-phpapp02
 
Curso de-asterisk-everano-2007-1204975330483842-4
Curso de-asterisk-everano-2007-1204975330483842-4Curso de-asterisk-everano-2007-1204975330483842-4
Curso de-asterisk-everano-2007-1204975330483842-4
 
Asterisk presence-im-091015103222-phpapp02
Asterisk presence-im-091015103222-phpapp02Asterisk presence-im-091015103222-phpapp02
Asterisk presence-im-091015103222-phpapp02
 
Vnx series-technical-review-110616214632-phpapp02
Vnx series-technical-review-110616214632-phpapp02Vnx series-technical-review-110616214632-phpapp02
Vnx series-technical-review-110616214632-phpapp02
 
Imentorstevejobspdf 110826082634-phpapp02
Imentorstevejobspdf 110826082634-phpapp02Imentorstevejobspdf 110826082634-phpapp02
Imentorstevejobspdf 110826082634-phpapp02
 
Qcon 111122082620-phpapp02
Qcon 111122082620-phpapp02Qcon 111122082620-phpapp02
Qcon 111122082620-phpapp02
 
Awssummit2011nytimesfinal com-110610112751-phpapp01
Awssummit2011nytimesfinal com-110610112751-phpapp01Awssummit2011nytimesfinal com-110610112751-phpapp01
Awssummit2011nytimesfinal com-110610112751-phpapp01
 
Thenewnetworkforthedatacenter 100519185534-phpapp02 (1)
Thenewnetworkforthedatacenter 100519185534-phpapp02 (1)Thenewnetworkforthedatacenter 100519185534-phpapp02 (1)
Thenewnetworkforthedatacenter 100519185534-phpapp02 (1)
 
Apc 091016024613-phpapp01
Apc 091016024613-phpapp01Apc 091016024613-phpapp01
Apc 091016024613-phpapp01
 
Thenewnetworkforthedatacenter 100519185534-phpapp02 (1)
Thenewnetworkforthedatacenter 100519185534-phpapp02 (1)Thenewnetworkforthedatacenter 100519185534-phpapp02 (1)
Thenewnetworkforthedatacenter 100519185534-phpapp02 (1)
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 

Dernier

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 

Dernier (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 

Asterisk presence-im-091015103222-phpapp02

  • 1. Asterisk, Instant Messaging and Presence, how? Saúl Ibarra Corretgé <saghul@gmail.com> http://www.saghul.net http://www.sipdoc.net saghul http://www.irontec.com
  • 2. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? About me ● saghul – VoIP enthusiast, playing around with Asterisk since 2k5 – GNU/Linux lover likes everything “Software Libre” – Co-founder of http://sipdoc.net – Highly involved in spanish VoIP comunities 2
  • 3. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? This presentation ● http://www.saghul.net/blog/downloads/astricon2k9/ ● http://www.slideshare.net/saghul/ – Slides – Complete configuration files – Database example data 3
  • 4. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? Index 1. Asterisk and presence status 2. SIP SIMPLE or XMPP? 3. The XMPP solution 1. OpenFire setup 4. The SIMPLE solution 1. Kamailio + Asterisk setup 5. Conclusions 4
  • 5. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? What we do have now ● Asterisk SIP support (chan_sip) – In-dialog MESSAGE :-( – SUBSCRIBE and NOTIFY support ● For Event: dialog ● What about Event: Presence? :-( – No PUBLISH support :-( ● Asterisk XMPP support – res_jabber ● JabberSend, JABBER_RECEIVE, JABBER_STATUS – chan_gtalk, chan_jingle ● Am I missing something? 5
  • 6. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? Do we need presence and IM? ● “I want to talk to you, not to your phone” ● Are you available? – For an audio conference? – Just for IM? – For whom? ● Where are you? – Mobile – Office – Home – ... We need to know if a user is available and what his status is 6
  • 7. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? What we need ● A presence server ● Users may publish their status ● Users may subscribe to other users status ● Instant Messaging between users Is it possible only with Asterisk? NO 7
  • 8. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? SIMPLE or XMPP? 8
  • 9. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? SIMPLE vs XMPP ● Did SIMPLE reinvent the wheel? ● Large companies started adopting SIMPLE (Microsoft, …) – Propietary extensions :-( ● XMPP does not provide voice capabilities – Well, there is Jingle... ● If SIP is the VoIP protocol: why not use it also for presence and IM? 9
  • 11. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? The XMPP solution ● Integrate Asterisk with a XMPP server 11
  • 12. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? OpenFire ● Open Source ● Java based ● Multiplatform ● Asterisk integration plugin ● SIP softphone plugin ● Gateways to multiple mi services: MSN, Yahoo, … ● Easy installation! 12
  • 13. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? OpenFire (II) ● Download deb package ● dpkg -i openfire_3.6.4_all.deb 13
  • 14. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? OpenFire (III) ● Web based configuration ● Clustering architecture ● Connection to the Asterisk Manager Interface – Multiple connections ● Mapping between Asterisk SIP users and OpenFire XMPP users ● Multiplatform Java client: Spark ● Flash based web client: SparkWeb 14
  • 15. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? OpenFire (IV) 15
  • 16. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? OpenFire (V) ● When a user is talking OpenFire puts it “On the phone” 16
  • 17. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? OpenFire (VI) 17
  • 18. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? OpenFire (VI) ● What we get – Instant Messaging – Presence – Gateways to other mi services – Text conferencing ● Problems – Duplicated users (we could partially fix it with LDAP) – Need to handle 2 protocols – Not many softphones support SIP and XMPP – Do any hardphones support XMPP? 18
  • 20. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? A complex protocol ● SIMPLE IETF working group – Presence RFCs ● 3856, 3857, 3858, 3863, 4479, 4480, 4482, ... – XCAP ● 4825, 4826, 4827, 5025, … – Instant Messaging ● 3428, 3994, 4975, … SIMPLE is NOT simple! 20
  • 21. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? The SIP solution ● Integrate Asterisk and Kamailio to provide IM and presence. ● Users are registered to Kamailio. ● INVITE requests are routed through the Asterisk server. – Asterisk RealTime user integration with Kamailio's subscriber table. ● PUBLISH, SUBSCRIBE and MESSAGE requests are handled by Kamailio. 21
  • 22. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? Registration REGISTER Store location Asterisk does nothing! 22
  • 23. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? Kamailio – Asterisk RealTime integration ● Asterisk peers are Kamailio's subscribers. ● MySQL view so that Asterisk 'sees' the users as his own. ● Peers IP → Kamailio IP. ● Calls between users go through Kamailio and Asterisk. ● We need to call to alphanumeric users → DB Alias 23
  • 24. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? Kamailio – Asterisk RealTime integration (2) CREATE VIEW sip_peers AS SELECT subscriber.username AS name, subscriber.username AS defaultuser, 'friend' AS type, NULL AS secret, subscriber.domain AS host, concat(subscriber.rpid,' ','<',subscriber.username,'>') AS callerid, 'from-users' AS context, subscriber.username AS mailbox, 'yes' AS nat, 'no' AS qualify, 'info' AS dtmfmode, subscriber.username AS fromuser, 24
  • 25. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? Kamailio – Asterisk RealTime integration (3) NULL AS authuser, subscriber.domain AS fromdomain, NULL AS insecure, 'no' AS canreinvite, NULL AS disallow, 'all' AS allow, NULL AS restrictcid, subscriber.domain AS defaultip, subscriber.domain AS ipaddr, subscriber.domain AS outboundproxy, '5060' AS port, NULL AS regseconds FROM kamailio_1.subscriber; 25
  • 26. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? Invitation 2. Find numeric Alias 5. Dial to the X- 3. Add X-Subscriber Subscriber user header 1. INVITE Alice (Bob) 4. INVITE (2001) 6. INVITE (Bob) 8. INVITE 7. Lookup Bob (Bob) user location 26
  • 27. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? Invitation (2) # Route all INVITE requests to Asterisk if (is_method("INVITE")) { # Remove X-Subscriber header so that no one sees it... remove_hf("X-Subscriber"); # We don't have to route the requests coming FROM Asterisk # back to Asterisk. We would make a loop! if (!($si == "AST_IP" && $sp == "AST_PORT")) { route(ASTERISK_USERS_ROUTE); } } 27
  • 28. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? Invitation (3) # Send INVITE requests to the Asterisk server route[ASTERISK_USERS_ROUTE] { # Call to the numeric alias avp_db_query("SELECT alias_username FROM dbaliases WHERE username = '$rU' AND domain = '$avp(AVP_ORIGDOMAIN)'LIMIT 1", "$avp(AVP_NUMALIAS)”); if (is_avp_set("$avp(AVP_NUMALIAS)")) { # Save the subscriber in a header so we can use it in Asterisk append_hf("X-Subscriber: $rUrn"); $rU = $avp(s:numalias); } $rd = "AST_IP"; $rp = "AST_PORT"; route(RELAY_ROUTE); } 28
  • 29. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? Invitation (4) [from-users] exten => _X.,1,NoOp() exten => _X.,n,Set(SUBSCRIBER=${SIP_HEADER(X-Subscriber)}) exten => _X.,n,GotoIf($[${LEN(${SUBSCRIBER})} = 0]?hang) exten => _X.,n,Dial(SIP/${SUBSCRIBER}) exten => _X.,n(hang),Hangup 29
  • 30. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? SIMPLE presence 1. SUBSCRIBE (Bob) 2. handle_subscribe Alice 5. NOTIFY 3. PUBLISH 4. handle_publish Asterisk does Bob nothing! 30
  • 31. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? SIMPLE presence (2) # Handle presence requests if(is_method("PUBLISH|SUBSCRIBE")) { route(PRESENCE_ROUTE); } # Handle presence route[PRESENCE_ROUTE] { if (is_method("PUBLISH")) { handle_publish(); t_release(); } else if (is_method("SUBSCRIBE")) { handle_subscribe(); t_release(); } exit; } 31
  • 32. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? Messaging 1. MESSAGE (Bob) 2. Lookup location Alice 3. MESSAGE Asterisk does Bob nothing! 32
  • 33. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? NAT handling ● We just need to fix the NAT in signalling. ● Our Asterisk 'peers' are configured with nat=yes – COMEDIA mode – Audio will go through Asterisk 33
  • 34. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? Further improvements... 34
  • 35. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? Further improvements... (2) What about mixing both? – OpenFire's Asterisk plugin still works! (regardless of the integration with Kamailio) 35
  • 36. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? SIMPLE or XMPP? 36
  • 37. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? Thanks! BYE sip:astricon@astricon.net SIP/2.0 Via: SIP/2.0/UDP guest.astricon.net:5060;branch=z9hG4bKnashds7 Max-Forwards: 70 From: saghul <sip:saghul@sipdoc.net>;tag=8321234356 To: AstriCon <sip:astricon@astricon.net>;tag=9fxced76sl Call-ID: 3848276298220188511@astricon.net CSeq: 1 BYE Content-Length: 0 Thanks for watching! 37
  • 39. AstriCon 2009: Asterisk, Instant Messaging and Presence, how? License http://creativecommons.org/licenses/by-sa/3.0/ All images are property of their respective authors. 39