What I have tried is :

register => user1:pass...@server/yocan
register => user2:pass...@server/itcenter 

extensions.conf :

[default]
exten => yocan,1,GoTo(user1,s,1)
exten => itcenter,1,GoTo(user2,s,1)

[user1]
...
[user2]
...

But the CLI shows :

[Oct  9 09:28:52]     -- Executing [...@macro-getiaxaccount:5]
MYSQL("SIP/ITCENTER-3starsnet-076e4700", "...
[Oct  9 09:28:52]     -- Executing [...@macro-getiaxaccount:6]
MacroExit("SIP/ITCENTER-3starsnet-076e4700",...
[Oct  9 09:28:52]     -- Executing [...@user1:9]
NoOp("SIP/ITCENTER-3starsnet-076e4700", "...
[Oct  9 09:28:52]     -- Executing [...@user1:10]
Dial("SIP/ITCENTER-3starsnet-076e4700", "...

So the call comes into the right context... that's not the problem.

But my CDR is messed up. The accountcode that I have set for user1 is
always replaced for the accountcode I've set for user 2.

[YOCAN-3starsnet]
type=peer 
accountcode=user1_in 

[ITCENTER-3starsnet]
type=peer
accountcode=user2_in

Is there yet another workaround ?!

Is it not meant to host several SIP-accounts on 1 Asterisk-box that
register to a SIP- provider ???

Jonas.


On Thu, 2009-10-08 at 23:21 +0200, Dovid Bender wrote:

>  
> 
>  
>  
>         ----- Original Message ----- 
>         From: jonas kellens 
>         To: Asterisk Mailing 
>         Sent: Thursday, October 08, 2009 15:20
>         Subject: [asterisk-users] How to keep difference between 2
>         SIP-accounts/trunks from same server ??
>         
>         
>         
>         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:pass...@server/user1
>         register => user2:pass...@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 [...@macro-getiaxaccount:5]
>         MYSQL("SIP/ITCENTER-3starsnet-0764cdb0", ...
>         [Oct  8 15:06:03]     -- Executing [...@macro-getiaxaccount:6]
>         MacroExit("SIP/ITCENTER-3starsnet-0764cdb0", ...
>         [Oct  8 15:06:03]     -- Executing [...@092:9]
>         NoOp("SIP/ITCENTER-3starsnet-0764cdb0", "...
>         [Oct  8 15:06:03]     -- Executing [...@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 [...@macro-getiaxaccount:5]
>         MYSQL("SIP/YOCAN-3starsnet-0764e7b0", "...
>         [Oct  8 15:16:08]     -- Executing [...@macro-getiaxaccount:6]
>         MacroExit("SIP/YOCAN-3starsnet-0764e7b0", "...
>         [Oct  8 15:16:08]     -- Executing [...@092779077:9]
>         NoOp("SIP/YOCAN-3starsnet-0764e7b0", "...
>         [Oct  8 15:16:08]     -- Executing [...@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. 
>         
>  
> Jonas,
> How about breaking it up in extensions.conf. The /user1 at the end of
> the registration tells the device on the other end to send the call to
> us...@your_ip_address. You may want to try:
> sip.conf
> register => user1:pass...@server/line1
> register => user2:pass...@server/line2
>  
> extensions.conf
> Exten => line1,1,Playback(hello)
> Exten => line2,1,Playback(tt-monkeys)
>  
> 
> _______________________________________________
> -- 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
_______________________________________________
-- 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

Reply via email to