FreePBX | Register | Issues | Wiki | Portal | Support

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


(Jared Busch) #1

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?

image

image


#2

DumpChan is better as DumpChan(minimum verbosity)

http://www.asteriskdocs.org/en/2nd_Edition/asterisk-book-html-chunk/asterisk-APP-B-59.html


(Jared Busch) #3

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.


#4

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)


(Jared Busch) #5

Exacty what I needed.

Thanks.


(Jared Busch) #6

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.

[my-operator]
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.

image
image


#7

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

from-internal,${outboundcid:0:3},1

always exist in your system?


(Jared Busch) #8

Obviously. Or I wouldn’t set it up.

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


#9

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


(system) closed #10

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