Sorry if I’m bringing up an old post, but I ran into this problem and made a python script to solve this, I run it on a cron to enable superfecta automatically for all inbound routes.
#!/usr/bin/python
import MySQLdb
db = MySQLdb.connect(host="localhost",
db="asterisk")
# Create a Cursor object to execute queries.
cur = db.cursor()
# Select inbound route extension that don't exist in the superfecta table
cur.execute("select extension from incoming where extension not in (select extension from superfecta_to_incoming);")
# Loop over and insert them
for row in cur.fetchall() :
#print row[0], " ", row[1]
sql = "INSERT INTO superfecta_to_incoming (extension, cidnum, scheme) VALUES (%s, %s, %s)"
val = (row[0], "", "ALL|ALL")
cur.execute(sql, val)
db.commit()
2 Likes