Context's, how does it actually work?


I’ve setup freepbx distro, but have a question.
Context’s are not really clear to me.

For example, I made a custom extension for my cellphone, follow me contains my cell phone nr with a # at the end. Now in the custom extension itself, I need to configure the dial string. This has now, SIP/0486xxxxxx@outbound-allroutes (0486…is my cell phone nr). I found an example for this on the net showing that string. But I wonder, where exactly is outbound-allroutes defined?

I’ve been looking in extensions.conf, but I can’t find any links to the context @outbound-allroutes. Also extensions.conf claims I shouldn’t edit it manually, but this needs to be done from the webgui. Ok, where and how do I configure those context’s the right way?

Many thx

I also don’t find any menu items concerning this and all howto’s I find on the internet have a different webinterface then what I have from the freepbx distro.
Can someone please bring some light here?

look in extensions_additional.conf

Yeps,thx, I got i more or less.
Maybe it’s because this is all very new to me, but reading asterisk documentation on the net and trying to apply it in freepbx isn’t always straight forward due to the many derivates of config files. I also always thought that cli wasn’t really needed to configure the whole thing.(not that i care to use the cli)

For this reason, I’ve installed AstLinux on an Alix board this morning and will try to build my configuration on that. I wanted to go embedded anyway.

I got a more or less doing-what-I-want freepbx system now (except for the lack of showing a callerid when a call is transfered to my cell phone, GRRRRR), so I can hopefully take some time to investigate further in Asterisk and apply it in AstLinux at the end.

Thx for your reply,
kind regards

in the uk on traditional land line trunks I dont think you can send out cil other than that of the line that the call is leaving the system on. if we set up call difert at the (BT) exchange then you get the number of the caller but of corse no IVR to filter out the message. I’ve often thought that there should be a little program to monitor the cdr file or cdr output from a traditional system and send you a text with the callers number whenever a call is transfered to you.


Yes, I understand that, but it’s a sip trunk and I can’t even get my own voip nr (which is registered at the trunk provider) sent out when a call is transfered.
I’ve put it already in the extension, in the trunk, in the outbound route (which should override all), no joy. I’m pretty sure I’m doing something wrong, but I don’t seem to figure out what exactly. I can simulate it and post logfiles if necessary.

This thread describes the scenario completely:

kind regards

I do the same sort of thing and I do get the cli but I dont use the follow me bit.

I just set up a custom extension (115) that calls my mobile, I can either dial 115 from a phone on the system or add 115 to an IVR or include it in a hunt group.

It looks like there are a few more options available in the follow me but my way seems simple and it works fine for me.

The cli with asterisk -rvvvvvvvvvvvvvvv would probably enable you to see whats happening differently on the call where you dont get the caller ID. trouble is on the diverted call you’ll get all the information for the outgoing call but you’ll also see the incoming call information.

I think you should be able to turn on debugging just for the outgoing trunk. that may help you obtain a clue.

Hope it helps



Hmm, maybe I could try setting up the custom extension for my mobile like you did?
Can you explain me step by step? A follow me was the only way for me to get it working. If you setup a custom extension without a follow me, where exactly do you put your mobile phone nr?

Kind regards

add new extension, select a custom device, give it a name and a number, in the this device uses custom technology DIAL box I have




Tried this, it works, but still no caller id.
The Local/ in the dialstring, where does this come from? I used to put SIP/ in there.It works with both, but sadly enough no caller id on my mobile again.

I even tried setting it as emergency cid, no joy.
For what it’s worth, here are the logs of the call
CID should be our voip nr +3293956000, and it looks like this gets set. I really don’t understand why it works if I call from a local extension to my mobile, but not on a call transfered (via ivr) to my mobile. I really need a solution to this, it’s unusable for me if I always get private nr on my mobile.

Set(“Local/0486082333@outbound-allroutes-deae;2”, “TRUNKOUTCID=+3293956000”) in new stack
[2012-04-15 18:41:54] VERBOSE[1873] pbx.c: – Executing [s@macro-outbound-callerid:9] GotoIf(“Local/0486082333@outbound-allroutes-deae;2”, “1?trunkcid”) in new stack
[2012-04-15 18:41:54] VERBOSE[1873] pbx.c: – Goto (macro-outbound-callerid,s,12)
[2012-04-15 18:41:54] VERBOSE[1873] pbx.c: – Executing [s@macro-outbound-callerid:12] ExecIf(“Local/0486082333@outbound-allroutes-deae;2”, “1?Set(CALLERID(all)=+3293956000)”) in new stack
[2012-04-15 18:41:54] VERBOSE[1873] pbx.c: – Executing [s@macro-outbound-callerid:13] ExecIf(“Local/0486082333@outbound-allroutes-deae;2”, “1?Set(CALLERID(all)=0487488923)”) in new stack
[2012-04-15 18:41:54] VERBOSE[1873] pbx.c: – Executing [s@macro-outbound-callerid:14] ExecIf(“Local/0486082333@outbound-allroutes-deae;2”, “0?Set(CALLERID(all)=)”) in new stack
[2012-04-15 18:41:54] VERBOSE[1873] pbx.c: – Executing [s@macro-outbound-callerid:15] ExecIf(“Local/0486082333@outbound-allroutes-deae;2”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
[2012-04-15 18:41:54] VERBOSE[1873] pbx.c: – Executing [s@macro-dialout-trunk:12] GosubIf(“Local/0486082333@outbound-allroutes-deae;2”, “0?sub-flp-3,s,1()”) in new stack
[2012-04-15 18:41:54] VERBOSE[1873] pbx.c: – Executing [s@macro-dialout-trunk:13] Set(“Local/0486082333@outbound-allroutes-deae;2”, “OUTNUM=0486082333”) in new stack
[2012-04-15 18:41:54] VERBOSE[1873] pbx.c: – Executing [s@macro-dialout-trunk:14] Set(“Local/0486082333@outbound-allroutes-deae;2”, “custom=SIP/Internetcalls”) in new stack

Have you called your provider? They might not have your trunk set to send any CID except your own DID’s. Or they could be picky on the format of foreign called ID’s.

Hi SkykingOH,

Well, I thought that also, but when I call from an internal sip client to my mobile it works, it shows our voip nr, so where is the difference with a transfered call?

Internal sip phone call --> pbx --> outside (gsm, landline, doesn’t matter): our voip nr is always shown at the callee

Call from the outside --> pbx --> cell phone, landline,… : Never a caller id.

All using the same trunk, so if the problem is at the trunk, why is callerid shown when a sip client calls the outside?

To be clear, I don’t expect to see the transfered caller id on my cell phone, i’m already happy with our own voip nr, then I can at least seperate people calling me privately from normal transfered calls out of our pbx.

I use outbound for now and I have them verified my voip nr, it’s linked to my account. Tried playing with the format as well already, still out of luck.

I’ll be happy to provide any info necessary or even temporary access to the machine, I really need this solved.

Many thx,

Specifying "fromuser=+329xxxxxx (our voip nr) made the callerid appear on calls transfered to gsm. GREAT :slight_smile:


I am glad you got this working. The “fromuser” authenticates you to send the foreign callerID. This is what I have been referencing. You were “hung up” on the fact that another scenario worked.

This thread is a teachable moment to illustrate just how hard it is to troubleshoot problems in a forum.

Contrary to popular opinion nobody is withholding solutions or ignoring posts. Solutions can be evasive.


Thx for the heads up Scott.
I’ve been using OSS for many years now, and when trying something new there has been as good as always a few weeks of frustration first :slight_smile: I remember going through the same “hell” in my starter days with mysql, php, freeradius, drupal, etc etc. It’s just a matter of reading documentation and spending time to learn how it all works. Forums are great, but additional. They should not be looked at as the primary source of information/documentation. People who start to use OSS simply need to learn that. And like you said, as we all have different needs and configurations, I sure understand it can be hard to analyze a problem via a forum post.

Kind regards,