Trying to add DID to CDR record

davinman

New Member
Joined
May 27, 2010
Messages
3
Reaction score
0
Hello,

I have a box running PIAF 1.7.5.7 (Asterisk 1.8.7.1) and I am trying to add the incoming DID to the CDR record.

I have successfully used this link http://michigantelephone.wordpress....he-source-did-in-freepbx-call-detail-reports/

On a PIAF 1.7.5.6 (Asterisk 1.8.4.1) box for a few months now but on this new box it is like the custom context does not exists.

in extensions_custom.conf I have

[custom-from-trunk-did]
exten => _X!,1,Set(CDR(did)=${EXTEN})
exten => _X!,n,Goto(from-trunk,${EXTEN},1)
exten => h,1,Macro(hangupcall,)


For the trunk I have the following configured

canreinvite=yes
context=custom-from-trunk-did
dtmfmode=RFC2833
fromdomain=216.82.224.202
host=216.82.224.202
insecure=very
nat=yes
port=5060
type=peer
disallow=all
allow=ulaw

With this configuration I get a message from the provider that the number is not in services. However I know that the trunk works because if I set the context to from-trunk the call comes in.
 
Joined
Jun 29, 2009
Messages
258
Reaction score
0
My first thought is to say check the custom context for typos, missing or added characters (particularly non-printing added characters), etc. And, also check the permissions and ownership on your extensions_custom.conf file to make sure those did not get changed somehow. It's not unheard of for ownership to get changed to something other than asterisk|asterisk and that can cause the entire file to be ignored.
 

davinman

New Member
Joined
May 27, 2010
Messages
3
Reaction score
0
Well I check the file permissions and they are all asterisk:asterisk. I have deleted the context and typed it in again and checked the trunk context. Below is the log message that I get when the call comes in so it looks like it sees the custom-from-trunk-did


[2011-12-15 07:44:18] NOTICE[5940] chan_sip.c: Call from 'BW-INBOUND-P' (216.82.224.202:5060) to extension '+19198425960' rejected because extension not found in context 'custom-from-trunk-did'.


Just to recap this is the details in extension_custom.conf

[custom-from-trunk-did]
exten => _X!,1,Set(CDR(did)=${EXTEN})
exten => _X!,n,Goto(from-trunk,${EXTEN},1)
exten => h,1,Macro(hanfupcall,)


Here is my trunk config


canreinvite=yes
context=custom-from-trunk-did
dtmfmode=RFC2833
fromdomain=216.82.224.202
host=216.82.224.202
insecure=very
nat=yes
port=5060
type=peer
disallow=all
allow=ulaw
 

davinman

New Member
Joined
May 27, 2010
Messages
3
Reaction score
0
Well I finally figured this one out. SIP provider is sending +1XXXXXXXXXX as the DID so the _X! was not matching. modified it to _+X! on both lines and it works.
 
Joined
Jun 29, 2009
Messages
258
Reaction score
0
Well I finally figured this one out. SIP provider is sending +1XXXXXXXXXX as the DID so the _X! was not matching. modified it to _+X! on both lines and it works.

That will only work if all your DIDs (that utilize the context) have the + prepend. To make it work with DIDs that do or do not have the + at the start, try changing both occurrences of _X! to _[+X]!
 

Members online

Forum statistics

Threads
25,812
Messages
167,767
Members
19,241
Latest member
bellabos
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top