[sr-dev] sip router and presence setup

Daniel-Constantin Mierla miconda at gmail.com
Fri Jan 22 22:18:38 CET 2010


Hello Aymeric,

On 1/22/10 4:11 PM, Aymeric Moizard wrote:
>
> Hi again,
>
> Tks for your answers on this topic.
>
> To answer one of your question: my goal is to implement a
> new module for a non standard SIP event package.
>
> Here is a patch for current kamailio 3.0 branch to allow
> adding a new event package without changing the core: (without
> having a new define in the "event" header parser.)
>
> http://sip.antisip.com/patch-siprouter-presence-anypackage.diff

patch looks good, I am going to apply it. Haven't checked yet, but I 
guess the db is storing the string value for event, right?


>
> If the "type" is EVENT_OTHER, the SUBSCRIBE and PUBLISH
> will be accepted if the package name exist in the list.
>
> If this patch doesn't fit you, please let me know how you
> would like it to be!
>
> I'm now working on my new module and have a question: I
> have a specific header in SUBSCRIBE which impact NOTIFY
> contents: do I have any existing way to attach this
> information to my dialog information within "active_watchers"
> database so I can have the information available when
> I'm building my NOTIFY contents? (equivalent to presence
> agregations). Just a hint would be appreciated.

your second patch :-) for straightforward support.

When SUBSCRIBE is received and NOTIFY body built, functions from your 
module will be executed. Save the data you need at subs time and use it 
at notify. You don't have a caching mechanism for it right now, so 
either you db hits or use a htable. Extending db table with one more 
column does not affect other modules. If you have lot of data, you can 
use different table (you can use id column  or to-tag for reference). 
So, depending of what you need and how you want to do it, you may not 
need to touch other code, just build in your mode.

In case you need to serialize/deserialize data, look at lib/cds/ seems a 
good way to go.

Cheers,
Daniel

>
> Tks,
> Aymeric MOIZARD / ANTISIP
> amsip - http://www.antisip.com
> osip2 - http://www.osip.org
> eXosip2 - http://savannah.nongnu.org/projects/exosip/
>
>
> On Thu, 21 Jan 2010, Daniel-Constantin Mierla wrote:
>
>>
>>
>> On 1/21/10 4:17 PM, Aymeric Moizard wrote:
>>>>> Last general question: What about mixing kamailio & ser? I've seen
>>>>> for example modules with same namings: "auth" and "auth_db" in both
>>>>> modules_s & modules_k: does this means we can use the same core but
>>>>> have to choose between using modules_s or modules_k?
>>>>
>>>> You can mix, but not arbitrarily. The biggest difference between 
>>>> ser and kamailio is the database structure. ser uses a new database 
>>>> schema with numeric user-ids which map to SIP AoR. kamailio still 
>>>> uses the old (ser 0.9.x) database schema where every user has a 
>>>> fixed AoR.
>>>>
>>>> Therefore you can not mix modules which require different database 
>>>> layouts.
>>>>
>>>> Thus, in your scenario you have to mix database layouts: 
>>>> provisioning/location from ser and presence from kamailio. That 
>>>> might work. But probably much easier would be to use kamailio 
>>>> modules only (unless you need numeric user ids).
>>>
>>> Then my first comment would be: why have the "pa" been removed
>>
>> I guess it was no longer update to work with latest core and db apis.
>>
>>> if it's
>>> not possible to use the presence module from kamailio...
>>
>> you can use them, they are pretty much independent of the subscriber 
>> table and profile, you just create the afferent tables from kamailio.
>>
>>>
>>> In my mind, presence & presence_xml are using different independant 
>>> database table and doesn't conflict with ser database?
>>
>> Right.
>>
>>>
>>> Most probably, there could be conflict with modules that depends
>>> on usrloc for example? (like pua_usrloc) Looking at developper APIs,
>>> for both usrloc kam/ser modules they are very close.
>>
>> I haven't checked ser usrloc, we did some changes in K, some of them 
>> for presence purpose and for using the pua_usrloc you have to use K 
>> usrloc and registrar modules and from here nathelper module.
>>
>>>
>>> I don't fully understand yet what "numeric user ids" are, but I 
>>> would really like to use the ser database layout for 
>>> user/location/credentials which seems really flexible compared to 
>>> kamailio.
>>
>> Doing auth with ser modules and using presence/usrloc from K should 
>> be just fine.
>>
>>>
>>> So where sip-router is going? Do you target to have only the same
>>> core for both kamailio & ser, but still be different projects?
>>
>> Goal is to remove duplication as much as possible. However, the db 
>> related things are the most sensitive, since people have management 
>> application relying on certain structure.
>>
>>>
>>> Is having a common database layout an objective of the sip-router
>>> project?
>>
>> Yes, but I would say it will be the last to happen -- there will be 
>> quite some debates around.
>>
>>>
>>> If I intent to implement to additionnal event package, do you advise
>>> me to stick with kamailio subscriber layout?
>>
>> presence and subscriber profiles are quite independent.
>>>
>>> I finally understood why my "make deb" was compiling a ser version:
>>> I just forgot to checkout the kamailio branch... That was also a
>>> source of confusion for understanding why normal step for the
>>> kamailio branch was to setup a ser database layout... Because
>>> of that error, I though first the same layout was already used...
>>
>> A bit inconvenient with git, indeed, but I could not find how to 
>> fetch easily only the branch to give such guidelines.
>>
>> Cheers,
>> Daniel
>>
>>>
>>> Tks,
>>> Aymeric MOIZARD / ANTISIP
>>> amsip - http://www.antisip.com
>>> osip2 - http://www.osip.org
>>> eXosip2 - http://savannah.nongnu.org/projects/exosip/
>>>
>>>
>>>> regards
>>>> klaus
>>>>
>>>>>
>>>>> Tks much for your help & advise,
>>>>>
>>>>> Aymeric MOIZARD / ANTISIP
>>>>> amsip - http://www.antisip.com
>>>>> osip2 - http://www.osip.org
>>>>> eXosip2 - http://savannah.nongnu.org/projects/exosip/
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> sr-dev mailing list
>>>>> sr-dev at lists.sip-router.org
>>>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>>>>
>>>
>>> _______________________________________________
>>> sr-dev mailing list
>>> sr-dev at lists.sip-router.org
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>>>
>>
>> -- 
>> Daniel-Constantin Mierla
>> * http://www.asipto.com/
>>
>>
>
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>

-- 
Daniel-Constantin Mierla
* http://www.asipto.com/




More information about the sr-dev mailing list