[Asterisk-Users] Called number (Destination Number)

Francesco Peeters Francesco at FamPeeters.com
Fri Nov 4 04:10:03 MST 2005


On Fri, November 4, 2005 11:27, David Acacio said:
> Hi,
>
> I have E1 PRI, When I have an incoming call, how can I know the called
> number (or the destination number) before answer the call?
>
> My provider say that he send it.
>
>                                                                       E1
> PRI
> 900XXXXXX ------------> 9XXXXXXX ----------> Asterisk
>
>  It appears in some event under the Asterisk Manager API?
>
> Thanks,
>
> David
>

Log in to the CLI (if not on your main system, use 'asterisk -vvvvvr') and
watch for the incoming call.

If you want to do DID's you may have to put 'immediate=no' and
'overlapdial=yes' in the zap channel definition (zapata.conf) to ensure
that it waits to receive the DID info and put it in the appropriate
variable.

Do not forget to restart after changing zapata.conf. An 'asterisk -rx
reload' does NOT reload zapata conf!

Once it works, you should see something like this in the CLI:
    -- Extension '0793429193' in context 'from-pstn' from '0174287114'
does not exist.  Rejecting call on channel 0/1, span 1

After that all you need to do is define an incoming extension with the
correct DID data, like:
[ext-did]
exten => 0123456788,1,SetVar(FROM_DID=0123456788)       ;
exten => 0123456788,2,Goto(ext-local,200,1)     ;
exten => 0123456789,1,SetVar(FROM_DID=0123456789)       ;
exten => 0123456789,2,Goto(aa_1,s,1)    ;

HTH!

-- 
Francesco Peeters
----
GPG Key = AA69 E7C6 1D8A F148 160C  D5C4 9943 6E38 D5E3 7704
If your program doesn't recognize my signature, please visit
http://www.CAcert.org/index.php?id=3 to retrieve the Root CA certificate.



More information about the asterisk-users mailing list