Hello All, Is there any way to write a custom context, where first it checks internally to see if the SIP User exist with same DID number, if it does route the call internally like calling from one extension to another extension, else pass the call to A2Billing to do the billing and use the default outbound trunks to terminate the call. Reason for this is because I have generated my SIP User with real US DID and I would like to keep the cost minimum by not sending the local calls out on Trunk and receive it back... For example, [custom-a2billing] exten => _XXXXXXXXXX,1,Answer exten => _XXXXXXXXXX,2,Wait,2 exten => _XXXXXXXXXX,3,_ _ _ _ _ _ _ ; What to fill here to check for local calls and it not found send to A2Billing.php exten => _XXXXXXXXXX,4,DeadAGI(a2billing.php|1) exten => _XXXXXXXXXX,5,Wait,2 exten => _XXXXXXXXXX,6,Hangup Any suggestions...? Cheers, Nitesh
If I understand your question correctly... You can use the context= directive in sip.conf to land inbound calls from any SIP peer into whatever dialplan context you like, after which you can pass it to other contexts using the Goto() statement. The only thing is that you will need to include those contexts in your custom context with something like include => some-other-context ... because by default the scope of all contexts is hermetically sealed. Does that help, or did I miss the point? Thanks, -- Alex Balashov Evariste Systems Web : http://www.evaristesys.com/ Tel : +1-678-954-0670 Direct : +1-678-954-0671
Antonio José dos Santos Brandão
2007-Jun-24 19:56 UTC
[asterisk-users] How to Create Custom Context
Why don?t create tariffs on your a2billing with full numbers of your SIP users? You can point it to a trunk that dials sip/%diallingnumber% -- Antonio Jos? dos Santos Brand?o On 6/20/07, Nitesh Divecha <nitesh at vipernetworks.com> wrote:> Hello All, > > Is there any way to write a custom context, where first it checks > internally to see if the SIP User exist with same DID number, if it does > route the call internally like calling from one extension to another > extension, else pass the call to A2Billing to do the billing and use the > default outbound trunks to terminate the call. > > Reason for this is because I have generated my SIP User with real US DID > and I would like to keep the cost minimum by not sending the local calls > out on Trunk and receive it back... > > For example, > > [custom-a2billing] > exten => _XXXXXXXXXX,1,Answer > exten => _XXXXXXXXXX,2,Wait,2 > exten => _XXXXXXXXXX,3,_ _ _ _ _ _ _ ; What to fill here to check for > local calls and it not found send to A2Billing.php > exten => _XXXXXXXXXX,4,DeadAGI(a2billing.php|1) > exten => _XXXXXXXXXX,5,Wait,2 > exten => _XXXXXXXXXX,6,Hangup > > Any suggestions...? > > Cheers, > Nitesh > > > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >