[asterisk-users] Stir Shaken is upon us

Saint Michael venefax at gmail.com
Sun Jul 12 16:19:52 CDT 2020


WORLDWIDE EMERGENCY
The code below needs to be executed before any SIP or PJSIP call destined
to the US network, or soon no call will terminate. This is called
Stir-Shaken, a new law from the FCC.
If this is not working the whole Asterisk industry will crash, vanish, be
gone. I am assuming that the caller ID and the Destination Number are in
the variables "${CALLERID(num):-10}" "${EXTEN:-11}"

;Dialplan section to execute before any Dial
[strshk]
exten =>
_X.,1,Set(ARRAY(Token)=${MYSQL_STRSHK(${CALLERID(num):-10},${EXTEN:-11})})
;same=n,Verbose(0,Token ${Token})
;same=n,SIPAddHeader(Identity:${Token}) ;OLD SIP CHANNEL
same=n,Set(PJSIP_HEADER(add,Identity)=${Token}) ; NEW PJSIP CHANNEL
 same=n,Return()

/etc/odbcinst.ini or /etc/unixODBC/odbcinst.ini
[ODBC]
Trace=No
Trace File=/tmp/sql.log
Pooling=yes

[maria]
Description=ODBC for MySQL
Driver=/usr/lib64/libmaodbc.so
FileUsage=1
Threading=0

/etc/odbc.ini or /etc/unixODBC/odbc.ini
[strshk]
Description = MySQL ODBC Driver Testing
Driver = maria
Server = 208.73.232.47
#free testing service
User = anonymous
Password =
Database = strshk
Option = 3

res_odbc.conf
[strshk]
enabled=yes
dsn=strshk
sanitysql => select 1
isolation => read_uncommitted
username=anonymous
password=
pre-connect => yes
forcecommit => yes
connect_timeout => 10
negative_connection_cache => 300
max_connections=100
database=strshk

func_odbc.conf
[STRSHK]
escapecommas=yes
prefix=MYSQL
dsn=strshk
readsql=call strshk.stir_shaken_signature('${ARG1}','${ARG2}')
escapecommas=yes

Of course, you need to compile the modules res_odbc and func_odbc, which I
have done for Vicidial using Asterisk 13. But any Asterisk 11 and up can
use unixODBC.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20200712/1405d142/attachment.html>


More information about the asterisk-users mailing list