[asterisk-users] Two phone numbers, one SIP provider

Benjamin Stocker bstocker at gmail.com
Fri Jul 21 05:47:22 MST 2006


2006/7/21, Filip Drągowski <f.dragowski at ontp.net>:
>
>
>  Diffrent context:
>  [default]
>  1111 => goto(1111|s|1)
>  2222 => goto(2222|s|1)
>  then You can hadle incoming calls in diffrent contexts

Thanks for the solution. This would be really a way to solve the
problem. Storing number=context pairs in the Asterisk database could
be another solution:

  DBPut(numtocontext/1111=incoming-1111)
  DBPut(numtocontext/2222=incoming-2222)
  ...

and then retrieve the context in the dialplan:

  DBGet(TARGETCONTEXT=numtocontext/${EXTEN})

Anyway, I stil won't give up trying to relay incoming calls *directly*
to a context by defining a sip account similar to this:

[1111]
type=friend ; (or peer or user)
username=1111
...
context=incoming-1111 ; <= <= Go to this context on incoming calls

According to [1], it should work:

context= <context_name> : If type=user, the Context for the inbound
call from this SIP user definition. If type=peer, the Context in the
dialplan for outbound calls from this SIP peer definition. If
type=friend the context used for both inbound and outbound calls
through the SIP entities definition. If no type=user entry matches an
inbound call, then a type=peer or type=friend will match if the
hostname or IP address defined in host= matches.

1. http://www.voip-info.org/wiki-Asterisk+config+sip.conf


More information about the asterisk-users mailing list