Hi,
I have to try changing the To and From URI like below:
At the moment: To: sip:test1@test.com;tag=..... To be like: To: "test1"sip:test1@test.com;tag=...
What would be the easiest way for doing this for presence NOTIFY SIP message ? Or if this can not be done with configuration system, then from where in the code the SIP message header is generated ?
Thanks a lot, -Mika
I guess in notify.c. But AFAIK the display name portion is not saved in the database - only the to-URI and the to-tag. Thus, you can't restore the Original Username without saving the whole To header into database.
regards klaus
mika.saari@wipsl.com wrote:
Hi,
I have to try changing the To and From URI like below:
At the moment: To: sip:test1@test.com;tag=..... To be like: To: "test1"sip:test1@test.com;tag=...
What would be the easiest way for doing this for presence NOTIFY SIP message ? Or if this can not be done with configuration system, then from where in the code the SIP message header is generated ?
Thanks a lot, -Mika
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Mika,
At the moment: To: sip:test1@test.com;tag=..... To be like: To: "test1"sip:test1@test.com;tag=...
Do you actually mean that the user part of the URI needs to be duplicated into the display name? Something like the following?
subst('/^To:(.*)sip:([^@]*)@([^;]*)(.*)$/To:\1"\2"sip:\2@\3\4/ig')
Or that the To: display name needs to be rewritten based on content pre-stored in a database (for example because the users have to pre-register via a web GUI)? In that case you could combine a line like avp_db_load( "$to/username", "$avp(label)" ) with a subst (for example replacing the first \2 in the example above with $avp(label), I guess).
Finally, if the username/display-name pairs aren't pre-registered, you could store them in the AVP database (using the username or username+domain as a key) at the time the user registers/subscribes, and then retrieve them when processing NOTIFYs (using the avp_db_load() + subst() combination).
HTH, S.
PS: I haven't tested any of this, although I do use a subst() on To: similar to the one I showed.