Hi Daniel

As always thanks for the quick response.  

I’ll have a dig through the presence module and try and see if my assumption on the usage of fields is correct. (watch presently_uri, send as to_user to watcher contact ).  If they do behave like that it should be a simple enough change to manage_subscribe

Thanks
Mark


On 12 Feb 2020, at 20:21, Daniel-Constantin Mierla <miconda@gmail.com> wrote:

Hello,

the presence specs are quite rigid about user identities, in many cases
the user id appears in sip headers as well as in the xml body. If you
mangle identities for subscription, you may have to do changes in the
content of the notifies.

I haven't analyzed in detail this case to be able to prose a solution,
but you can try updating the headers and then use msg_apply_changes()
before calling the handle_subscribe(). Or if you have some developer
expertise, add the option to specify the presentity id via function
parameter, right now it support given the watcher id as parameter. But
then, again, you have to see if NOTIFY request need to be updated as well.

Cheers,
Daniel

On 12.02.20 14:49, Mark Boyce wrote:
Hi All

Looking for the best way to achieve mapping from requested uri to actual uri in presence subscription.

The scenario I’ve been presented with is that there is a direct relation between extension number and sip user but they are not the same thing.

So for example;

Extension 10 is mapped to SIP user sip-SomethingLong
Extension 11 is mapped to SIP user sip-SomethingEvenLonger

When extension 10 subscribes to 11 we end up with something like this;

From: “Extension 10" <sip:sip-SomethingLong@ourpbx.com:5060>;tag=12345678
To: <sip:11@ourpbx.com:5060>;tag=987654321-c8bd

I *think* what I need to end up with in presence db is;
presently_uri = sip:sip-SomethingEvenLonger@ourpbx.com
to_user = 10

(Is that right?)

However I can’t see a standard way to achieve this.  Manage_subscribe will let me override the watcher uri but not the watched.


Anyone see a simple way to achieve this?

Thanks
Mark


_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

--
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - March 9-11, 2020, Berlin - www.asipto.com
Kamailio World Conference - April 27-29, 2020, in Berlin -- www.kamailioworld.com


Mark
-- 
Mark Boyce
Dark Origins Ltd
e: mark@darkorigins.com
t: 0345 0043 043
f: 0345 0043 044