### Description
It doesn't look like the "pua_dialoginfo" module has support for the "display" attribute in the identity tag. This tag is used by some phones to update the phone display with caller/callee information for the respective key. I'm wondering how difficult it would be to add this feature. Thanks in advance for anyone who reads this!
### Expected behavior
Kamailio includes display attribute in identity tags in generated publish messages.
<pre> <dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="1" state="full"> <dialog id="as7d900as8" call-id="a84b4c76e66710" local-tag="1928301774" remote-tag="456887766" direction="initiator"> <state>early</state> <local> <identity <b><i>display="Alice"</i></b>>sip:alice@example.com</identity> <target uri="sip:alice@phone11.example.com"/> </local> <remote> <identity <b><i>display="Bob"</i></b>>sip:bob@example.org</identity> <target uri="sip:bobster@phone21.example.org"/> </remote> </dialog> </dialog-info> </pre>
#### Actual observed behavior
Kamailio generates a publish request for dialog events similar to the one below. The display attribute is not included in the "identity" tags. This means that when a notify message is sent to a watcher for this publish, the name is not rendered on the phone display.
<pre> <dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="1" state="full"> <dialog id="as7d900as8" call-id="a84b4c76e66710" local-tag="1928301774" remote-tag="456887766" direction="initiator"> <state>early</state> <local> <b><identity>sip:alice@example.com</identity></b> <target uri="sip:alice@phone11.example.com"/> </local> <remote> <b><identity>sip:bob@example.org</identity></b> <target uri="sip:bobster@phone21.example.org"/> </remote> </dialog> </dialog-info> </pre>
### Possible Solutions
I added a small modification to the module as a POC and it works as expected. With the following modification, the phone display is updated with the string in the “display” attribute. I added line 191-193 below, between lines 190 & 191 on the current master branch. The example below shows the “remote” tag, I also did the same thing for the local tag a few more lines down.
<pre> 184 tag_node = xmlNewChild(remote_node, NULL, BAD_CAST "identity", 185 BAD_CAST buf) ; 186 if( tag_node ==NULL) 187 { 188 LM_ERR("while adding childn"); 189 goto error; 190 } 191 /* Testing - adding display attribute to the identity tag */ 192 xmlNewProp(tag_node, BAD_CAST "display", BAD_CAST "RemoteCallerName"); 193 /* */ 195 196 tag_node = xmlNewChild(remote_node, NULL, BAD_CAST "target", NULL); 197 if( tag_node ==NULL) </pre>
Here is a link to the file in the module I’m referring to: https://github.com/kamailio/kamailio/blob/master/src/modules/pua_dialoginfo/...
I don’t really have any professional experience writing C code, and I was unable to identify a way to grab this string from the “From” header. Unfortunately, because I would have really loved to give this feature back to the community!
### Additional Information
Thank you so much for this amazing software. I absolutely adore Kamailio! If someone is interested in this, please let me know if there is anything I can do to help.
@false-vacuum - thanks for looking also into extending the code to get this feature. Just make a pull request with the changes you tried and seemed to make it work -- it is easier to review and merge.
@miconda I wasn't sure if I should make a pull request since I didn't actually get this to work. I just "hard coded" a string to verify that I was on right track, so to speak.
I couldn't figure out how to update the tag based on the caller identity from the SIP message. Adding "RemoteCallerName" to every request isn't very useful to anyone.
I just want to be clear that my modification is not a finished solution, and a _functionally useless_ proof of concept. _Should I still open a pull request?_
Sorry for the confusion if I'm misunderstanding something. Thank you again for your time!
Sorry, somehow I missed reading parts of your comment, misunderstanding you got sort of working solution.
I think it is still good to make a PR, because there I can assist you easier on how to get the value from From header, commenting on patch lines.
Added in master branch (to be in 5.5 series) -- see the docs for attribute_display parameter.
Testing and feedback would be appreciated, if it works as expected or not.
Closed #2615.
Just testing this out in the latest master branch and it works great! Thank you so much for your help with this.