Hello Vic, Can you tell me from which route are you trying this function? It only allows on request route, branch route and failure route. I think you misunderstood how to use the exported function, let me guide you. It will not update only the user part of the 'from' uri but works on uri. So you need to create a custom string like below to fulfill your requirements and the first argument is for display part not for uri part.
$avp(fromuri) = "sip:" + *$avp(650)* + "@" + $fd; It should be called only once at initial requests and the subsequent requests(if you loaded the dialog module and created module or used forced_dialog in the uri module) and responses(using tm module) will be automatically updated your 'from uri'. Refer the below example which helps you to guide how you can use this function in different use cases. *$avp(display) = "Jolin";* *$avp(fromuri) = "sip:[email protected] <sip%3a%[email protected]>"* *REPLACE BOTH display name and uri* *uac_replace_from("$avp(display)","$avp(fromuri)");* *e.g. received From: "Vic" <sip:[email protected] <sip%[email protected]>>;tag=ca4a1348* * sent From: "Jolin" <sip:[email protected] <sip%3a%[email protected]>>;tag=ca4a1348* REPLACE ONLY display name *uac_replace_from("$avp(display)","");* *e.g. received From: "Vic" <sip:[email protected] <sip%[email protected]>>;tag=ca4a1348* * sent From: "Jolin" <sip:*[email protected] *>;tag=ca4a1348* *REPLACE ONLY uri WITHOUT TOUCHING display name* *uac_replace_from( ,"$avp(fromuri)");* *e.g. received From: "Vic" <sip:[email protected] <sip%[email protected]>>;tag=ca4a1348* * sent From: "Vic" <sip:[email protected] <sip%3a%[email protected]>>;tag=ca4a1348* REMOVE display and REPLACE uri *uac_replace_from("","$avp(fromuri)");* *e.g. received From: "Vic" <sip:[email protected] <sip%[email protected]>>;tag=ca4a1348* * sent From: <sip:[email protected] <sip%3a%[email protected]>>;tag=ca4a1348* For more information you can read the uri module documentation here. <https://opensips.org/html/docs/modules/devel/uac.html#func_uac_replace_from> *NOTE:* If you're using *3.X.X* version then avoid double quotes for avp variables. *e.g. **uac_replace_from($avp(display),$avp(fromuri));* Thanks & Regards *Diptesh Patel* Software Developer Ecosmob Technologies Ltd, Ahmedabad Mo:*+919898962659* On Fri, Jul 10, 2020 at 12:29 AM Vic Jolin <[email protected]> wrote: > Hi, > > Are there other ways of "changing" callerids for a certain call aside from > uac_replace_from? > > And what is the correct way of doing this? > > I have uac_replace_from("$avp(650)", ""); > > I find it giving errors when I try to update the uri with > > sip:$avp(650)@ipadddress:poprt > _______________________________________________ > Users mailing list > [email protected] > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > -- *Disclaimer* In addition to generic Disclaimer which you have agreed on our website, any views or opinions presented in this email are solely those of the originator and do not necessarily represent those of the Company or its sister concerns. Any liability (in negligence, contract or otherwise) arising from any third party taking any action, or refraining from taking any action on the basis of any of the information contained in this email is hereby excluded. *Confidentiality* This communication (including any attachment/s) is intended only for the use of the addressee(s) and contains information that is PRIVILEGED AND CONFIDENTIAL. Unauthorized reading, dissemination, distribution, or copying of this communication is prohibited. Please inform originator if you have received it in error. *Caution for viruses, malware etc.* This communication, including any attachments, may not be free of viruses, trojans, similar or new contaminants/malware, interceptions or interference, and may not be compatible with your systems. You shall carry out virus/malware scanning on your own before opening any attachment to this e-mail. The sender of this e-mail and Company including its sister concerns shall not be liable for any damage that may incur to you as a result of viruses, incompleteness of this message, a delay in receipt of this message or any other computer problems.
_______________________________________________ Users mailing list [email protected] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
