[OpenSIPS-Users] changing callerids

Diptesh Patel diptesh.patel at ecosmob.com
Fri Jul 10 05:12:13 EST 2020


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:+18736352333 at myopensipsdomain.com
<sip%3A%2B18736352333 at myopensipsdomain.com>"*

*REPLACE BOTH display name and uri*
*uac_replace_from("$avp(display)","$avp(fromuri)");*
*e.g. received From: "Vic" <sip:8736352333 at receiveddomain.com
<sip%3A8736352333 at receiveddomain.com>>;tag=ca4a1348*
*       sent       From: "Jolin" <sip:+18736352333 at myopensipsdomain.com
<sip%3A%2B18736352333 at myopensipsdomain.com>>;tag=ca4a1348*

REPLACE ONLY display name
*uac_replace_from("$avp(display)","");*
*e.g. received From: "Vic" <sip:8736352333 at receiveddomain.com
<sip%3A8736352333 at receiveddomain.com>>;tag=ca4a1348*
*       sent       From: "Jolin" <sip:*8736352333 at receiveddomain.com
*>;tag=ca4a1348*

*REPLACE ONLY uri WITHOUT TOUCHING display name*
*uac_replace_from( ,"$avp(fromuri)");*
*e.g. received From: "Vic" <sip:8736352333 at receiveddomain.com
<sip%3A8736352333 at receiveddomain.com>>;tag=ca4a1348*
*       sent       From: "Vic" <sip:+18736352333 at myopensipsdomain.com
<sip%3A%2B18736352333 at myopensipsdomain.com>>;tag=ca4a1348*

REMOVE display and REPLACE uri
*uac_replace_from("","$avp(fromuri)");*
*e.g. received From: "Vic" <sip:8736352333 at receiveddomain.com
<sip%3A8736352333 at receiveddomain.com>>;tag=ca4a1348*
*       sent       From: <sip:+18736352333 at myopensipsdomain.com
<sip%3A%2B18736352333 at myopensipsdomain.com>>;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 <adjolin at gmail.com> 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
> Users at lists.opensips.org
> 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. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20200710/661bdfc4/attachment-0001.html>


More information about the Users mailing list