Skip to content

Instantly share code, notes, and snippets.

@rijnhard
Last active May 23, 2019 10:03
Show Gist options
  • Save rijnhard/ffd30a9a408aa662ba86c8b65ceffc6d to your computer and use it in GitHub Desktop.
Save rijnhard/ffd30a9a408aa662ba86c8b65ceffc6d to your computer and use it in GitHub Desktop.
[finding calls for extensions] #freepbx
SET NAMES 'UTF8';
SET CHARACTER SET 'UTF8';
SET @EXT = 7443;
SET @EXTV = concat('vmu', @EXT);
SET @CHANNEL = concat('%/', @EXT, '-%');
SELECT * FROM asteriskcdrdb.cdr
where (
dstchannel LIKE @CHANNEL
OR channel LIKE @CHANNEL
OR src = @EXT
OR dst = @EXT
OR src = @EXTV
OR dst = @EXTV
OR cnum = @EXT
OR cnum = @EXTV
)
order by calldate desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment