callaccounting.ws forum
Welcome, Guest. Please login or register.
September 08, 2010, 09:39:40 PM

Login with username, password and session length
Search:     Advanced search
Call Accounting mate now integrates with popular promperty management software from RezStream.
438 Posts in 223 Topics by 1237 Members
Latest Member: nreubenmasseyj
* Home Help Search Login Register
+  callaccounting.ws forum
|-+  General Category
| |-+  Asterisk Integration
| | |-+  Determining Call Direction for Asterisk
« previous next »
Pages: [1] Print
Author Topic: Determining Call Direction for Asterisk  (Read 7761 times)
sergey
Sr. Member
****
Offline Offline

Posts: 48


View Profile
« on: May 12, 2005, 05:03:02 AM »

By default CAM uses fuzzy rules to determine direction of a call.
To allow the CAM exactly determine the direction from SMDR record you need configure Asterisk in a special way.

You should mark every Asterisk section entry that can make call with account code set to "OUTCOMING" and section that can accept call with account code set to "INCOMING".

Generally add following line

accountcode=OUTCOMING

to entries of type 'user' of 'friend' in sip.conf and iax.conf and add following line

accountcode=INCOMING

to entries of type 'peer' in sip.conf and iax.conf files and to channels in zapata.conf file.

For example, sif.conf:

[sip-phone]
type=user
;type=friend
accountcode=OUTCOMING
...

[sip-provider]
type=peer
accountcode=INCOMING
...


But in some cases for incoming calls Asterisk does not use accountcode from configuration file. You must set accountcode in your dial plan. For example, you have such entry for incoming calls (the calls is routed to 'router' context):

[sip-provider]
type=peer
accountcode=INCOMING
context=router
...

To adopt such dialplan for CAM make new intermediate context for the 'router':

[router-intermediate]
exten => _X.,1,SetAccount(INCOMING)
exten => _X.,2,Goto(router,${EXTEN},1)

[router]
exten => 2001,1,Dial(SIP/2001,20)
exten => 2001,2,Hangup
.....

and change context for 'sip-provider' from 'router' to 'router-intermediate'

[sip-provider]
type=peer
accountcode=INCOMING
context=router-intermediate
...

In intermidiate context first line force accountcode to be 'INCOMING' and the second line jump to original context as if there is no additional context exists.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.1 | SMF © 2006, Simple Machines LLC Valid XHTML 1.0! Valid CSS!