How do I modify outbound caller id without using freepbx?

I am trying to modify the outbound caller id without using freepbx’s web administration. I have tried modifying the outboundcid section in the users table on MySql, and that did not change the caller id, but it did change what Freepbx web administration showed as the outbound caller id. The only way it would take effect though was if I submitted it through the web browser and applied the changes. I also tried modifying the sip_additional.conf where callerid=device and that had no effect either. What I want to know is where is it getting this data and is there anyway I can modify it?

Executing Set(“SIP/7077-0910f2a8”, “USEROUTCID=<1112221111>”) in new stack
– Executing Set(“SIP/7077-0910f2a8”, “EMERGENCYCID=”) in new stack
– Executing Set(“SIP/7077-0910f2a8”, “TRUNKOUTCID=<2221112222>”) in new stack
– Executing GotoIf(“SIP/7077-0910f2a8”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,16)
– Executing GotoIf(“SIP/7077-0910f2a8”, “0?usercid”) in new stack
– Executing Set(“SIP/7077-0910f2a8”, “CALLERID(all)=<2221112222>”) in new stack
– Executing GotoIf(“SIP/7077-0910f2a8”, “0?report”) in new stack
– Executing Set(“SIP/7077-0910f2a8”, “CALLERID(all)=<1112221111>”) in new stack
– Executing GotoIf(“SIP/7077-0910f2a8”, “1?report:hidecid”) in new stack
– Goto (macro-outbound-callerid,s,22)
– Executing NoOp(“SIP/7077-0910f2a8”, “CallerID set to “” <1112221111>”) in new stack

What exactly is callerid=device referencing? I saw that it was located in the sip table as well, but I want to know where it gets the outboundcid for it?

go read some of the articles in the Technical Corner, it touches on this. Or wait a week or so, I’ve got an draft of an article that goes into the different CallerID settings through FreePBX.

Philippe Lindheimer - FreePBX Project Lead
http//freepbx.org - IRC #freepbx

I read the articles I could find relating to devices, users, caller id, etc. I understand how the callerid=device works now. However it doesn’t help me solve my need. Could you tell me, is it possible to adjust the outbound caller id outside of the asterisk cli? I had tinkered with the idea of modifying extensions.conf to get outbound caller id from the mysql database instead of this line:
exten => s,n(normcid),Set(USEROUTCID=${DB(AMPUSER/${REALCALLERIDNUM}/outboundcid)})
Would that idea work or mess something else up? Any opinions or ideas to help me would be greatly appreciated.

I modified extensions.conf and now outbound callerid is from the MySql database. This allows me to modify only the MySql database and it change the outbound caller id. If you know a better way to do it, then what I just did, please let me know. Thanks for your help.

exten => s,n,MYSQL(Connect connid localhost dbuser dbpassword dbname)
exten => s,n,MYSQL(Query resultid ${connid} SELECT\ outboundcid\ FROM\ users\ where\ extension=${REALCALLERIDNUM})
exten => s,n,MYSQL(Fetch fetchid ${resultid} number)
exten => s,n,Set(USEROUTCID=${number})
exten => s,n,MYSQL(Clear ${resultid})
exten => s,n,MYSQL(Disconnect ${connid}