[asterisk-bugs] [JIRA] (ASTERISK-28928) message proxy changes when client login with different IP

Joshua C. Colp (JIRA) noreply at issues.asterisk.org
Tue Jun 2 03:49:25 CDT 2020


     [ https://issues.asterisk.org/jira/browse/ASTERISK-28928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joshua C. Colp updated ASTERISK-28928:
--------------------------------------

    Reference Notes: 
my approach:

<inline patch removed>

  was:
my approach:

diff --git a/res/res_pjsip_messaging.c b/res/res_pjsip_messaging.c
index 930cf84a53..2e7e443a65 100644
--- a/res/res_pjsip_messaging.c
+++ b/res/res_pjsip_messaging.c
@@ -236,6 +236,17 @@ static void update_to(pjsip_tx_data *tdata, char *to)
                        pj_strdup(tdata->pool, &name_addr->display, &parsed_name_addr->display);
                }
        }
+ /* assume it is 'sip:user[@domain]' format */
+ char *domain = strchr(to, '@');
+ pjsip_name_addr *name_addr;
+ pjsip_sip_uri *uri;
+ name_addr = (pjsip_name_addr *) PJSIP_MSG_TO_HDR(tdata->msg)->uri;
+ uri = pjsip_uri_get_uri(name_addr);
+ if(domain) {
+         pj_str_t pj_to;
+         pj_strset3(&pj_to, to, domain);
+         pj_strdup2(tdata->pool, &uri->host, domain + 1);
+ }
 }
and in extension.conf:
same => n,MessageSend(${CUT(MESSAGE(to),@,1)}@mydomain.com,${MESSAGE(from)})


> message proxy changes when client login with different IP
> ---------------------------------------------------------
>
>                 Key: ASTERISK-28928
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28928
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_pjsip_messaging
>    Affects Versions: 16.0.0
>         Environment: centos 7 x64; ubuntu 18.04; archlinux x64
>            Reporter: y
>
> This issue happens when some sip client like linphone support multiple sip account, while the client IP address changed like from wifi to 4G.
> suppose I sign in a sip account myid at mydomain.com on linphone. When someone send me a text message, I got the message send to myid at ip1; then I switch my network from wifi to 4G, the guy send me a text message again, I got the second message sent to myid at ip2; while both of these two message should be to myid at mydomain.com



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list