[sr-dev] [kamailio/kamailio] Add display name support to "pua_dialoginfo" (#2615)

Jake Greene notifications at github.com
Mon Feb 1 18:14:01 CET 2021


### 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 at example.com</identity>
            <target uri="sip:alice at phone11.example.com"/>
        </local>
        <remote>
            <identity <b><i>display="Bob"</i></b>>sip:bob at example.org</identity>
            <target uri="sip:bobster at 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 at example.com</identity></b>
            <target uri="sip:alice at phone11.example.com"/>
        </local>
        <remote>
            <b><identity>sip:bob at example.org</identity></b>
            <target uri="sip:bobster at 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/dialog_publish.c


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. 



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2615
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20210201/66106728/attachment-0001.htm>


More information about the sr-dev mailing list