What can I use in a context to get the extension Outbound CID

I have a custom context that I want to route some internal calls based on the Outbound CID of the extension making the call.
Is there a simple solution in place for this already?



DumpChan is better as DumpChan(minimum verbosity)


I don’t need more than a simple dump. I don’t need the dump at all in fact. I had that there to see is said information was already output. It is not.

So I asked the question.

If I was trying to get a complex channel dumped out I would do more/different.

Either way you should be usoing even if empty the parenthetical DumpChan().

outboundcid is an asteriskdb sqlite3 database value.

${DB(AMPUSER/${AMPUSER}/outboundcid)} will extract it

the Channel Variables will look like CallerID(name) and CallerID(number)

Exacty what I needed.


The purpose:
When the user dials ‘0’, route the call to the operator ring group based on the user’s DID area code.
Default to ring group 1201.

exten => s,1,NoOp()
exten => s,n,Set(outboundcid=${DB(AMPUSER/${AMPUSER}/outboundcid)})
exten => s,n,GotoIf($["${outboundcid:0:3}" == ""]?nooper:myoper)
exten => s,n,Hangup()
exten => s,n(nooper),Goto(from-internal,1201,1)
exten => s,n,Hangup()
exten => s,n(myoper),Goto(from-internal,${outboundcid:0:3},1)
exten => s,n,Hangup()

Yes I should probably put more validation in there.

I’ve done this in the past for offices with multiple branches, but always based on the extension. because those were clean setups and the extensions were grouped easily in a way to make that possible.


1 Like

If you want to make an outbound call, you can directly set the CallerID(name and number) variables on the channel, then goto the outbound route you want to use,

Does the context


always exist in your system?

Obviously. Or I wouldn’t set it up.

Who said anything about an outbound call. In fact, it is very clearing an internal call.

Then you have all the needed info apart from the Warning about ‘my-operator,s,1’ you posted

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.