SOLVED Call forwarding to preset number

virshu

New Member
Joined
May 22, 2013
Messages
27
Reaction score
2
Consider the following situation:

User set up unconditional forwarding number in ARI. She wants to dial *740 and toggle call forwarding on and off (SPA942 even has a soft key for this). The problem is that the system still asks to enter the forwarding number.

Is it possible? I looked around and it seems that the number itself isn't stored in any of config files. Probably, PIAF stores it in MySQL... but this is pure speculation!

Thanks
 

virshu

New Member
Joined
May 22, 2013
Messages
27
Reaction score
2
*740 is the feature code to toggle call forwarding o_O

The problem is that when it toggles ON, it asks for destination number (probably, because Asterisk doesn't have a concept of saved destination number). I want to automatically pick the number that the user saved in ARI...
 

sukasem

Guru
Joined
Sep 13, 2008
Messages
142
Reaction score
26
Hmm...I never use CF before. I prefer follow me.
I just tried it. It look like when Deactivate, I saw log file saying "Deleting: CF/7260 XXXXXXXX"
Well, it shouldn't delete it if using *740 toggle, Maybe OK to delete if use *73.
 

virshu

New Member
Joined
May 22, 2013
Messages
27
Reaction score
2
This is an awesome answer. In fact, I wish it was a little less perfect; so that something was left as an exercise for the reader :sweatdrop:

Now, more of educational question... I made these changes in extensions_custom; so FreePBX doesn't know anything about new feature codes, right? Even if I add new feature code to ext-featurecodes-custom context, it won't show up in MySQL database... I can see that these feature codes exist in featurecodes table, and PHP code pulls it from there - but what does it take to integrate what asterisk knows (from corresponding contexts) and what FreePBX knows (from MySQL database)?

Is the question even appropriate in PIAF forum? Or should it be asked in FreePBX? Or it doesn't make sense in any context?
 

virshu

New Member
Joined
May 22, 2013
Messages
27
Reaction score
2
They don't need to be the MySQL database in order to work, they just need to be in a conf file. Do you have a specific reason for wanting this code in the database?
No - as I said in my post, "it's an educational question". Kinda goes to my fundamental gripe: Asterisk documentation is oblivious to what FreePBX is doing (not surprisingly); and FreePBX documentation doesn't go beyond basic setup.

Some additional notes for my own use. An enterprising enthusiast could take the existing FreePBX Call Forward module "/modules/callforward" and use as the basis of a new 3rd party module called Persistent CF. Remove all but the CF toggle feature code, rename it to [app-pcf-toggle], change the default feature code, edit the new context as above and add a second feature code for [app-pcf-define], also add a new hint to existing context [ext-cf-hints] of the form $pcf_toggle_featurecode+$ext so that users can use the same button to toggle PCF and to monitor the hint. That's it, two new feature codes and one new hint, no config page required.
I was actually thinking of creating something like that just as an exercise... You make it sound simple and very tempting :clown:
 

virshu

New Member
Joined
May 22, 2013
Messages
27
Reaction score
2
The educational question wasn't as much in regards to how it works from user perspective (that part was pretty much clear for me); the education that I am missing is from the perspective of an enterprising enthusiast! Hopefully, reading your code will help in that regard!
 

virshu

New Member
Joined
May 22, 2013
Messages
27
Reaction score
2
I downloaded the module from github as zip; repackaged as tar.gz; named it as Simple_Call_Forward-0.0.2.tar.gz; uploaded into FreePBX. Upload was successful, however, status page tells me that the module is broken. I can't find where I can see the specifics of what is broken, though. freepbx_dbug shows a lot of PHP errors in library functions - but it seems that they are coming from regular operations; not from installing the new module.
 

virshu

New Member
Joined
May 22, 2013
Messages
27
Reaction score
2
Yes, I didn't realize this correlation between directory name and module rawname. Reading the code was very helpful to understand the fundamentals that I was struggling with. I'll try to add "toggle breaks if destination is not defined first"; probably over the weekend.
Unfortunately (or fortunately, but unfortunately for the purposes of this effort) the system is becoming more and more "production"; and the only other system I have is Raspberry Pi, which may not be suitable for development...
 

virshu

New Member
Joined
May 22, 2013
Messages
27
Reaction score
2
Looks even easier than I thought. Quick question... if I make changes in PHP, that change conf files - what is the best way to "run" them and generate new conf files? Currently, I uninstall - install the module; but there is probably a simpler way
 

virshu

New Member
Joined
May 22, 2013
Messages
27
Reaction score
2
Kinda OT...
  • I've had github credentials for awhile; but I haven't used it. Last time I worked on OSS, it was still in SourceForge. It looks quite different, but not really that more complicated.
  • Last time I wanted to change the icon of the thread (from question to something more appropriate), I edited the first post. It wasn't obvious, but it was there... Now I absolutely don't see how to do it. Did it disappear or I am going blind?
 

Members online

Forum statistics

Threads
25,812
Messages
167,763
Members
19,241
Latest member
bellabos
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top