Dears,
I’m new to Asterisk and I don’t use it professionally, I’m learning because I like it and to use it in my home.
I have a fiber that gives me access to the internet and a telephone line. Internally the ONT has an ATA that provides the telephone line on an FXO port.
I disabled the SIP account on the ONT and configured it on Asterisk.
Everything is working, but I ran into a problem. How to identify collect calls???
I don’t want to permanently block the operator, as I’m thinking about creating a white list of numbers from which I will receive collect calls, but that’s later on. For now, I need to identify that the call that came in is collect and hang up.
I captured the SIP flow and was unable to identify absolutely any parameter that provides this information, below is the INVITE of an incoming collect call:
INVITE sip:0xxxxxxxxxx@192.168.xxx.xxx:5060;line=rzixxxx;ue-addr=10.xxx.xxx.xxx SIP/2.0
Via: SIP/2.0/UDP 10.xxx.xxx.xxx:5060;branch=z9hG4bK26gr170010xxxxxxxxxx.1
Call-ID: LU-1701558408xxxxxx-xxxxxxxx@imsxxx-xxx.mgmpxxxxxx.ims.oi.net.br
To: <sip:+55xxxxxxxxxx@ims.oi.net.br;user=phone>
From: <sip:+55xxxxxxxxxxx;cpc=priority@ims.oi.net.br;user=phone>;tag=62689ffe-656bb888xxxxxxxx-gm-pt-lucentPCSF-xxxxxx
CSeq: 1 INVITE
Allow: INVITE,BYE,REGISTER,ACK,OPTIONS,CANCEL,SUBSCRIBE,NOTIFY,INFO,REFER
Contact: <sip:+55xxxxxxxxx;cpc=priority@10.xxx.xxx.xxx:5060;x-afi=132;encoded-parm=QbkRBthOEgsTXgkTBA0HHiUrKz1CQEJLRkZNNgQVHVQsJW4pNS9qPCg5e35jJyIjxxxxxxxxxxxxxxxxxxxx;transport=udp>
Content-Type: application/sdp
Expires: 155
Max-Forwards: 67
P-Asserted-Identity: <sip:+55xxxxxxxxxxx;cpc=priority@ims.oi.net.br;user=phone>
Request-Disposition: no-fork
Timestamp: 25531
Content-Length: 181
P-Called-Party-ID: "+55xxxxxxxxxx" <sip:+55xxxxxxxxxx@ims.oi.net.br;user=phone>
CondorTrigger: term
v=0
o=LucentPCSF 70012xxxx 70012xxxx IN IP4 10.xxx.xxx.xxx
s=-
c=IN IP4 10.xxx.xxx.xxx
t=0 0
m=audio 12274 RTP/AVP 8 96
a=rtpmap:96 telephone-event/8000
a=ptime:20
a=maxptime:60
After the INVITE, the normal flow follows, nothing that identifies it as a collect call.
There is no point in expecting that the operator that provides the fiber and line will cooperate, nor even using the line directly at Asterisk or any other exchange, they support and make it as difficult as possible.
When I answer the collect call, I hear a characteristic announcement (it’s attached) that is mandatory for all collect calls in my country, so I thought of somehow identifying that audio and that way I would know that the call is collect. But how do I identify that audio?
It would have to be something that would not paralyze the call for analysis, preferably because it takes more than 15 seconds. I thought about using the TONE_DETECT function, but this is already too advanced for me and I didn’t find many examples about it, the documentation is also very superficial, at least for my level of knowledge. I ran some tests but got absolutely no results.
Could anyone help me? It can be using this function or with other ideas.
I’m using pure Asterisk, version 16.30.1, under Debian 10.7. PJSIP 2.12.1. I know that the Asterisk version is outdated, but it is working well and unless it is an impediment to solving this difficulty, I would like to continue with it for a while longer.
I really appreciate anyone who can help.
Best regards,
Vinicius
