Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pua_dialoginfo fails to publish the caller when not using avps #3838

Open
michelpelletier07 opened this issue May 2, 2024 · 0 comments
Open

Comments

@michelpelletier07
Copy link

michelpelletier07 commented May 2, 2024

Description

What I did: I enabled the pua_dialoginfo module to publish changes for both the caller and the callee.
What I expected: PUBLISH to be generated for the caller and the callee
What actually happened: PUBLISH is only generated for the callee.

Troubleshooting

I troubleshooted the issue by adding LM_ERR messages at various point in the pua_dialoginfo.c

Reproduction

Add a db-url as modparam to pua
Do not add any modparam to pua_dialoginfo.
Then make a phone call while making sure dialog.dlg_manage() is called to track the call.

Debugging Data

Not applicable

Log Messages

pua_dialoginfo [dialog_publish.c:303]: dialog_publish(): failed to parse the PUBLISH R-URI

Possible Solutions

I tracked the issue to line 840 of pua_dialoginfo.c (see enclosed patch file), where dlginfo->pubruris_caller->s.s is set to the value of dlginfo->from_uri but dlginfo->pubruris_caller->s.len is not set to anything (left at zero).
So I added a line to set the len value to the len value of dlginfo->from_uri.len
See patch below:

diff -ru a/src/modules/pua_dialoginfo/pua_dialoginfo.c b/src/modules/pua_dialoginfo/pua_dialoginfo.c
--- a/src/modules/pua_dialoginfo/pua_dialoginfo.c	2024-05-02 11:14:34.150097771 -0600
+++ b/src/modules/pua_dialoginfo/pua_dialoginfo.c	2024-05-02 11:09:30.855960974 -0600
@@ -838,6 +838,8 @@
 		}
 		memset(dlginfo->pubruris_caller, 0, sizeof(struct str_list));
 		dlginfo->pubruris_caller->s.s = shm_str2char_dup(&dlginfo->from_uri);
+		dlginfo->pubruris_caller->s.len = dlginfo->from_uri.len;
+
 		if(!dlginfo->pubruris_caller->s.s) {
 			free_dlginfo_cell(dlginfo);
 			return NULL;

Additional Information

version: kamailio 5.8.1 (x86_64/linux) 384843
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_SEND_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 384843
compiled on 13:45:08 May 2 2024 with gcc 10.2.1

  • Operating System:
    Linux nnnnnnnnnnnn 5.10.0-27-amd64 #1 SMP Debian 5.10.205-2 (2023-12-31) x86_64 GNU/Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant