[asterisk-users] How to keep difference between 2 SIP-accounts/trunks from same server ??

Ioan Indreias indreias at gmail.com
Thu Oct 8 09:32:56 CDT 2009


Hello Jonas,

I had the same problem and from my own "research" I found that you
could not made a distinction.

The "problem" is that the peer is identified based on the IP (or
IP+PORT) information found in INVITE. And you (and me) have same IP
(in my case same port as well) for several SIP accounts.

Extract from http://www.voip-info.org/wiki/view/Asterisk+SIP+channels:

Incoming SIP Connections
When Asterisk receives an incoming SIP call, the SIP Channel Module
# first tries to find a [user] section matching the caller name (From:
username),
# then tries to find a [peer] section matching the caller's IP address.
# If no matching user or peer is found, the call is sent to the
context defined in the [general] section of sip.conf.

I'll be happy to find I am not right because I could deal with
dialplan distinctions between SIP accounts (based on DID info) but I
need (like you) special sip configuration to be taken into account
(eg. codecs allowed).

HTH,
Ioan (Nini) Indreias
www.modulo.ro

On Thu, Oct 8, 2009 at 4:20 PM, jonas kellens <jonas.kellens at telenet.be> wrote:
> Hey list,
>
> I have a problem when I host 2 SIP-accounts on the same Asterisk-server.
> Asterisk picks out the SIP-account on alphabetic order A --> Z.
>
> In my sip.conf :
>
> register => user1:passwd1 at server/user1
> register => user2:passwd2 at server/user2
>
> [YOCAN-3starsnet]
> type=peer
> host=server
> username=user1
> secret=passwd1
> fromuser=user1
> accountcode=user1_in
>
> [ITCENTER-3starsnet]
> type=peer
> host=server
> username=user2
> secret=passwd2
> fromuser=user2
> accountcode=ITCin
>
> The Asterisk CLI shows :
>
> [Oct  8 15:06:03]     -- Executing [s at macro-getiaxaccount:5]
> MYSQL("SIP/ITCENTER-3starsnet-0764cdb0", ...
> [Oct  8 15:06:03]     -- Executing [s at macro-getiaxaccount:6]
> MacroExit("SIP/ITCENTER-3starsnet-0764cdb0", ...
> [Oct  8 15:06:03]     -- Executing [s at 092:9]
> NoOp("SIP/ITCENTER-3starsnet-0764cdb0", "...
> [Oct  8 15:06:03]     -- Executing [s at 09:10]
> Dial("SIP/ITCENTER-3starsnet-0764cdb0", "...
>
> Notice the SIP/ITCENTER-3starsnet.
>
> Now when I put [ITCENTER-3starsnet] in comment in sip.conf, the CLI shows :
>
> [Oct  8 15:16:08]     -- Executing [s at macro-getiaxaccount:5]
> MYSQL("SIP/YOCAN-3starsnet-0764e7b0", "...
> [Oct  8 15:16:08]     -- Executing [s at macro-getiaxaccount:6]
> MacroExit("SIP/YOCAN-3starsnet-0764e7b0", "...
> [Oct  8 15:16:08]     -- Executing [s at 092779077:9]
> NoOp("SIP/YOCAN-3starsnet-0764e7b0", "...
> [Oct  8 15:16:08]     -- Executing [s at 092779077:10]
> Dial("SIP/YOCAN-3starsnet-0764e7b0", "...
>
> Notice the SIP/YOCAN-3starsnet.
>
> How can I keep the SIP-connection for user1 apart from the SIP-connection of
> user2 ???
>
> When I activate the SIP-account for user2, an incoming call always goes via
> this second SIP-account !!
>
>
> Thanks for the feedback.
>
> Jonas.
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> AstriCon 2009 - October 13 - 15 Phoenix, Arizona
> Register Now: http://www.astricon.net
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>



More information about the asterisk-users mailing list