Member
Last active 14 years ago
I don't have freepbx but got this to work with asterisk 1.6.0.26
Create a file called build_buttons.pl and paste following code.
#!/usr/bin/env perl # # Extensions # while (<>) { if (m/\[\d/) { chomp $_; s/\[([0-9]+)\]/\1/; print("[SIP/$_]\n"); print("type=extension\n"); print("extension=$_\n"); while (<>) { if (m/^$/) { last } if (m/^(context|label|vmexten=[0-9]|callerid|mailbox|\[[0-9])/) { s/\<([0-9]+)\]/\1/; s/callerid=/label=/; s/ <\d+>//; if ( m/context/ ) { $context=$_; $context=~ s/context=//; chomp $context; } s/(mailbox=\d+)/\1\@default/; s/vmexten=(\d+)/extenvoicemail=*\1\@$context/; print } } } } #The rest of this is just hardcoded buttons. # # Conference # print("[CONFERENCE/1600]\n"); print("type=conference\n"); print("label=User\n"); print("extension=1600\n"); print("context=from-internal-redir\n"); print("\n"); print("[PARK/default]\n"); print("extension=700\n"); print("context=parkedcalls\n"); print("type=park\n"); print("Label=Parked \n"); print("\n"); print("[SIP/VoicePulse]\n"); print("type=trunk\n"); print("label=VoicePulse\n"); print("[G1]\n"); print("type=trunk\n"); print("label=PRI\n"); print("channel=DAHDI/1\n"); print("channel=DAHDI/2\n"); print("channel=DAHDI/3\n"); print("channel=DAHDI/4\n"); print("channel=DAHDI/5\n"); print("channel=DAHDI/6\n"); print("channel=DAHDI/7\n"); print("channel=DAHDI/8\n"); print("channel=DAHDI/9\n"); print("channel=DAHDI/10\n"); print("channel=DAHDI/11\n"); print("channel=DAHDI/12\n"); print("channel=DAHDI/13\n"); print("channel=DAHDI/14\n"); print("channel=DAHDI/15\n"); print("channel=DAHDI/16\n"); print("channel=DAHDI/17\n"); print("channel=DAHDI/18\n"); print("channel=DAHDI/19\n"); print("channel=DAHDI/20\n"); print("channel=DAHDI/21\n"); print("channel=DAHDI/22\n"); print("channel=DAHDI/23\n");
buttons.cfg only has this line
#exec build_buttons.pl < /etc/asterisk/sip.conf
I tried changing font size to 50% in operator.css, restarted fop2 and httpd and font size doesn't change. What am I missing?
.extenbutton {
width:17.4em;
font-size:50%;
color:#000;
float:left;
border:2px outset #000;
margin:3px;
padding:2px;
}
also tried to change overflow:hidden to overflow:visible for body with no affect.
Does anyone parse the sip.conf to build the buttons? I have users that have both soft and hard phones. Soft phones do not have voicemail and/or are the softphone is setup to leave voicemail at the primary (hard phone) mailbox. Hard phones that are in conference rooms, lobbies, server room, etc do not have mailboxes either so I don't see them in fop2.
Has anyone written a script to parse the sip.conf file instead?