The To header has no relevance in routing, only the address in the first line of the request (r-uri) really matters for initial requests.

On the other hand, the error message you pasted below is related to nathelper.

Cheers,
Daniel

On 25.12.20 22:46, Syed Shahryar wrote:
My use case is such that I want to be able to send a SIP MESSAGE destined for a single username to multiple users. In order to be able to map that target username to multiple usernames, I tried using rtjson and evapi/http (to generate the routing json), but none of them worked.

Is it the right approach? Is there any other way to programmatically generate multiple targets for SIP request? I am familiar with dynamic routing but I need more flexibility.

Initially, I tried sending the request to a different username but that didn't work and got the following message in the http async result route.

kamailio    | 19(25) ERROR: nathelper [nathelper.c:1461]: sdp_1918(): Unable to parse sdp body
kamailio    | 19(25) NOTICE: <core> [core/kemi.c:124]: sr_kemi_core_notice(): In evapi msg branch
kamailio    | 28(34) NOTICE: {2 6661 MESSAGE q6hikd6tumsr1dh35kvj} <core> [core/kemi.c:124]: sr_kemi_core_notice(): In evapi reply branch 


The message was received on the originally requested to user and also $tu still points to the original user instead of the new user even after executing the following code.

KSR.rtjson.init_routes(response);
KSR.rtjson.push_routes();
KSR.nathelper.fix_nated_contact(); 

In http response, I receive the following and don't see any rtjson errors when init_routes is executed on it.

{"version":"1.0","routing":"parallel","routes":[{"headers":{"from":{"display":"test_1","uri":"sip:test_1@test.com:9908"},"to":{"display":"test_4","uri":"sip:test_4@test.com:9908"},"extra":""},"branch_flags":8,"fr_timer":5000,"fr_inv_timer":30000}]}

Please note that the request was sent to test_2@test.com. I have tried other combinations of above but nothing works.

I have already searched on Google and read relevant articles and blog posts. 

Thanks
--
--
This message contains confidential information and is intended only for the individual named. If you are not the named addressee, you should not disseminate, distribute or copy this email. Please notify the sender immediately by email if you have received this email by mistake and delete this email from your system. Email transmission cannot be guaranteed to be secure or error-free, as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender, therefore, does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission. If verification is required, please request a hard-copy version.

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla