• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[Tasker Help] - Call Forwarding Profile

Search This thread

stormvector256

New member
Jul 13, 2018
4
0
Hi

I was hoping i could get some help from someone with a profile i'd like to setup to forward my calls when conntected to my home wifi

This i can setup, but i also need to make sure tasker only runs the call forward dial code **21*+44.... after 5 minutes of connecting to the wifi and doesn't run the cancel code ##21# unless the wifi has been disconnected for more than 5 mins.
If call forwading was active and the wifi was disconnected i want to make sure the cancel option is stopped if wifi is restored within the 5 mins and vice versa.

Has anyone setup something like this before that i could replicate?
 

ktmom

Retired Forum Moderator
Apr 22, 2015
5,186
3,378
Deep Space Station K7
The basic idea would be a profile context, WiFi connected.

Enter task has a 5 minute wait action then the call action with the forward code and then a variable set %Forward to true. The call action should have an if statement set such; %Forward does not match true. This will prevent a second forward code being sent if the cancel code has not been sent.

Exit task has a 5 minute wait action then a call action with the cancel code and finally a clear variable for %FORWARD. In the call action, use an if statement; %WIFII does not match *CONNECTION*xxxxx* (where xxxxx is the SSID of the WiFi network that is in the profile context) around the final 2 actions so they don't run if the WiFi is reconnected.

If you flash the %WIFII variable, when connected you see information stating that WiFi is connected (CONNECTION) and what network it's connected to. If WiFi is not connected the %WIFII variable will return SCAN and all of the networks available. So the exit task will only run if the WiFi had not reconnected.

"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
 
Last edited:
  • Like
Reactions: stormvector256

stormvector256

New member
Jul 13, 2018
4
0
Wifi Call Forwarding

Hi,

Thanks for your help, based on your instructions i created the following profile but i may have made a mistake because even if the wifi is reconnected (i set it to 20 secs for testing) before 20 seconds the erasure code for call forwarding still runs and then the call forward code runs along with it if the wifi was restored.

Can you please have a look and let me know what i did wrong.


<TaskerData sr="" dvi="1" tv="5.2.bf1">
<Profile sr="prof29" ve="2">
<cdate>1531430225115</cdate>
<edate>1532630932692</edate>
<flags>16</flags>
<id>29</id>
<limit>true</limit>
<mid0>27</mid0>
<mid1>28</mid1>
<nme>Call Forward</nme>
<State sr="con0" ve="2">
<code>160</code>
<Str sr="arg0" ve="3">wg-OFFICE</Str>
<Str sr="arg1" ve="3"/>
<Str sr="arg2" ve="3"/>
<Int sr="arg3" val="0"/>
</State>
</Profile>
<Task sr="task27">
<cdate>1531429517251</cdate>
<edate>1532623660702</edate>
<id>27</id>
<nme>1</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="20"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act1" ve="7">
<code>90</code>
<Str sr="arg0" ve="3">**21*+447953222222#</Str>
<Int sr="arg1" val="1"/>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%Forward</lhs>
<op>3</op>
<rhs>%TRUE</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act2" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%Forward</Str>
<Str sr="arg1" ve="3">%TRUE</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
</Task>
<Task sr="task28">
<cdate>1531429582522</cdate>
<edate>1532623613278</edate>
<id>28</id>
<nme>2</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="20"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act1" ve="7">
<code>90</code>
<Str sr="arg0" ve="3">##21#</Str>
<Int sr="arg1" val="1"/>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%WIFII</lhs>
<op>3</op>
<rhs>wg-OFFICE</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act2" ve="7">
<code>549</code>
<Str sr="arg0" ve="3">%Forward</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
</Action>
</Task>
</TaskerData>



The basic idea would be a profile context, WiFi connected.

Enter task has a 5 minute wait action then the call action with the forward code and then a variable set %Forward to true. The call lactose should have an if statement set such; %Forward does not match true. This will prevent a second forward code being sent if the cancel code has not been sent.

Exit task has a 5 minute wait action then a call action with the cancel code and finally a clear variable for %FORWARD. In the call action, use an if statement; %WIFII does not match *CONNECTION*xxxxx* (where xxxxx is the SSID of the WiFi network that is in the profile context) around the final 2 actions so they don't run if the WiFi is reconnected.

If you flash the %WIFII variable, when connected you see information stating that WiFi is connected (CONNECTION) and what network it's connected to. If WiFi is not connected the %WIFII variable will return SCAN and all of the networks available. So the exit task will only run if the WiFi had not reconnected.

"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
 

ktmom

Retired Forum Moderator
Apr 22, 2015
5,186
3,378
Deep Space Station K7
Go to the 3-dot menu and select export -> Description to Clipboard (not XML). Then you'll be able to paste it.

Be aware, it easier to use pastebin then link to a post here. If you paste in a post here, the forum software will convert all semicolons with characters after, typically "on" and "off" to emoticons making it very hard to read.

"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
 

stormvector256

New member
Jul 13, 2018
4
0
Wifi Call Forwarding

Sure, please see below. Since I havn't posted 10 times yet i can't post urls
pastebin/p4Ne08bu

Thanks!

Go to the 3-dot menu and select export -> Description to Clipboard (not XML). Then you'll be able to paste it.

Be aware, it easier to use pastebin then link to a post here. If you paste in a post here, the forum software will convert all semicolons with characters after, typically "on" and "off" to emoticons making it very hard to read.

"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
 

ktmom

Retired Forum Moderator
Apr 22, 2015
5,186
3,378
Deep Space Station K7
There are three things that need to be addressed.



Long press the profile name so it’s highlighted, then tap the gear icon at the top. Check the box for “enforce order”. That is checked by default so somewhere along the line it was toggled off. The “i” next to the box will explain what it does.



In the entry task, action 3 sets the variable “%Forward” to another variable “%TRUE” (which is probably uninitialized e.g. not set) . Remove the % from the “TRUE” so “%Forward” is set to a value. Then fix the same problem in action 2.



In the exit task, action 2 the If statement for dialing the cancel code you have as “%WIFII !~ wg-OFFICE”. If you look at %WIFII when connected and disconnected but proximate to the AP, you’ll see that the SSID “wg-OFFICE” is present in both cases. To view the value of %WIFII, in a blank task, create an alert->flash with %WIFII as the text. Then just play the task when connected to the wifi network and again when disconnected.

There is also other text in the variable “%WIFII” in both cases. Since matches (~) or does not match (! ~) is not the same as contains, you have to allow for the additional text plus, ensure that it matches only when actually connected. That’s why my original post recommended the comparison be to “*CONNECTION*xxxxx* (where xxxxx is the SSID of the WiFi network”. So, in your case, this should be “*CONNECTION*wg-OFFICE*”. The asterisks are wildcards so this pattern ensures the match occurs only when there is a connection to the wg-Office AP.



"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    The basic idea would be a profile context, WiFi connected.

    Enter task has a 5 minute wait action then the call action with the forward code and then a variable set %Forward to true. The call action should have an if statement set such; %Forward does not match true. This will prevent a second forward code being sent if the cancel code has not been sent.

    Exit task has a 5 minute wait action then a call action with the cancel code and finally a clear variable for %FORWARD. In the call action, use an if statement; %WIFII does not match *CONNECTION*xxxxx* (where xxxxx is the SSID of the WiFi network that is in the profile context) around the final 2 actions so they don't run if the WiFi is reconnected.

    If you flash the %WIFII variable, when connected you see information stating that WiFi is connected (CONNECTION) and what network it's connected to. If WiFi is not connected the %WIFII variable will return SCAN and all of the networks available. So the exit task will only run if the WiFi had not reconnected.

    "Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers