Ok, now for something maybe a little bit dodgy. How do I alter the callerid for an incoming call? Example, the SIP provider I use provides callerid in the format 613XXXXXXXX, however some of the analogue phones have fixed width displays and cannot display this long number correctly, as such, I would like to change that to 03XXXXXXXX - compatible with what the local telephone company uses. Is this possible? In asterisk I used: exten => number/_61NXXXXXXXX,1,Set(CALLERID(num)=0${CALLERID(num):2}) exten => number/_X.,1,Set(CALLERID(num)=+${CALLERID(num)}) (disclaimer - 2nd line not tested with analogue phones) -- Brian May <brian@microcomaustralia.com.au>
On 22 February 2010 14:39, Brian West <brian@freeswitch.org> wrote:
effective_caller_id_* origination_caller_id_*
How do I generate the new number? I need to be able to test if it starts with '61', and if so, replace the first two digits with '0', otherwise just prefix the number with '+'. -- Brian May <brian@microcomaustralia.com.au>
Brian May asked:
How do I generate the new number? I need to be able to test if it starts with '61', and if so, replace the first two digits with '0', otherwise just prefix the number with '+'.
http://wiki.freeswitch.org/wiki/Regular_Expression http://wiki.freeswitch.org/wiki/Dialplan_XML -- Russell Mosemann
Brian May asked:
How do I generate the new number? I need to be able to test if it starts with '61', and if so, replace the first two digits with '0', otherwise just prefix the number with '+'.
http://wiki.freeswitch.org/wiki/Regular_Expression http://wiki.freeswitch.org/wiki/Dialplan_XML
And http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_set -- Russell Mosemann
Russell Mosemann <Russell.Mosemann@cune.org> wrote:
http://wiki.freeswitch.org/wiki/Regular_Expression http://wiki.freeswitch.org/wiki/Dialplan_XML
And
And as a further hint, regular expressions and variable substitutions ($1 $2 etc.).
On 22 February 2010 15:05, Russell Mosemann >>
http://wiki.freeswitch.org/wiki/Regular_Expression http://wiki.freeswitch.org/wiki/Dialplan_XML
And
So would something like this work? <extension name="oztel_cid" continue="true"> <condition field="destination_number" expression="^(12345678)$"/> <condition field="caller_id_number" expression="^61([2-9]\d\d\d\d\d\d\d\d)$" break="on-true"> <action application="set" data="effective_caller_id_number=0$1"/> </condition> <condition field="caller_id_number" expression="^(\d+)$" break="on-true"> <action application="set" data="effective_caller_id_number=$1"/> </condition> </extension> <extension name="oztel_cid"> <condition field="destination_number" expression="^(12345678)$"> <action application="set" data="domain_name=$${domain}"/> <action application="transfer" data="2000 XML default"/> </condition> </extension> -- Brian May <brian@microcomaustralia.com.au>
caller_id is slightly tricky. Use the dptool set_profile_var http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_set_profile_var. Though that is under documented. But really, if you are just bridging then do what Brian said. That is the "appropriate" method in most cases. On Sun, Feb 21, 2010 at 9:34 PM, Brian May <brian@microcomaustralia.com.au>wrote:
On 22 February 2010 13:58, Brian West <brian@freeswitch.org> wrote:
read the variables page ;)
Which variables? For caller_id_number it says "Practically it is read only." What does this mean? -- Brian May <brian@microcomaustralia.com.au>
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- -Rupa
As a note, this method overwrites what is in the caller profile. The vars are really the right way to do this. If you ever find yourself actually using set profile var you are almost definitely doing the wrong thing unless you are 100% sure you are not. This function was originally left completely undocumented because you should not be using it. If any documentation is added for this other than completely removing documentation, it should be a bold warning that says you should not under any circumstances use this. Mike On Feb 21, 2010, at 10:46 PM, Rupa Schomaker wrote:
caller_id is slightly tricky. Use the dptool set_profile_var http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_set_profile_var. Though that is under documented.
But really, if you are just bridging then do what Brian said. That is the "appropriate" method in most cases.
participants (6)
-
Brian May
-
Brian West
-
Jason White
-
Michael Jerris
-
Rupa Schomaker
-
Russell Mosemann