[Asterisk-Users] confusion about contexts - SER

Alyed Tzompa alyed.tzompa at simitel.com
Wed Jan 4 11:26:22 MST 2006


Guess I got where your confusiion lies.... you DON'T set up the ALL contexts the users will have acces to in sip.conf, in this file you will only set 1 single context. All other contexts you want the users to have acces to, you will have to add them in the extensions.conf

 So what you have to do is the following: 
 -user 2092, set it the createmenu context in sip .conf
 - in extensions.conf under the "createmenu" context add as many "include" lines as you need the user to have acces to.

 it should look something like:
 ; sip.conf

  [2092]
 type=friend
 username=2092
 canreinvite=no
 context= createmenu 

 ; extensions.conf

[createmenu]
 ...
 ...
 include => outgoing
 include => some other context

 hope this helps

Alyed

----------------------------------------
   Clean DocumentEmail       Hi,     Thanks for the reply.     What happens is that all users are registered with SER (a sip proxy). I have set SER up so when a user dials '0' followed by a pstn number it will be forwarded to asterisk which will forward the call to a third party pstn gateway. I also use asterisk so that when a user who is registered with ser doesn't answer (sending a 408 cancel response) or is busy (sending a 486 busy response) that the call is forwarded to asterisk voicemail. So therefore at the moment I have a user '2092' which registers with ser and uses the 'outgoing' context in asterisk for pstn access and accesses their voicemail mailbox through the default context.   Now I also set it up so that if a user registered with SER dials 20005 it should forwards to asterisk. This should call the context 'createmenu' which creates an IVR menu.     What I'm confused about is this. I created a user 20005 in sip.conf using context=createmenu. This wasn't working. After reading your post I realized my mistake was that the context that is being called is that of the caller i.e. 2092 as opposed to whom the call is directed at i.e. 20005. Therefore when I changed the context of 2092 to 'createmenu' it worked.     BUT how can I set up my sip.conf so that 2092 can use the default, outgoing and createmenu contexts depending on the correct scenario? If someone who is also using SER has any comments, I'd also really appreciate it.     i.e.      [300]
 type=friend
 username=300
 canreinvite=no
 context= WHAT GOES HERE??      //createmenu calls the IVR but then outgoing pstn calls don't work, outgoing allows pstn calls but then I can't create a menu etc etc
 insecure=very
 ;callerid= "voicemail user 1" <300>
 host=dynamic
 nat=yes
 dtmfmode=INFO
 mailbox=300
 disallow=all
 allow=alaw
 allow=ulaw
 allow=g723.1  allow= g729     Many thanks,  Aisling.        -----Original Message-----
 From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Alyed Tzompa
 Sent: 04 January 2006 00:28
 To: asterisk-users at lists.digium.com
 Subject: re: [Asterisk-Users] confusion about contexts     I'm a bit confused on how you get your calls to Asterisk, what I mean is: are you phoning into asterisk via a sip user? in this 
 case, which one?, if not is it iax or though a zap channel?

 anyway, here some tips:

 For your first problem it seems it has to do with what I pointed above, check that the user which is dialing into asterisk has 
 the correct context (context=create-menu) with at least type= peer

 also don't have to retype the allow=codec, disallow=codec, dtmfmode=x for every user, just set it in the general context in 
 sip.conf

 your second problem think it has to do once again with the firts thing above, and regarding the retyping, I'm afaid I don't know 
 any other way than writing those lines again and again for everyuser. Maybe someone else out there knows someting else that can help.

 Don't set many "outgoing" context for every user in sip.conf!!!!! just set one and point all users to that one. If you need your 
 user to have acces to other contexts just add 
 include => your_context
 at the end of whatever context you want (btw can add more than one inlcude's )

 Alyed  
 -------------------------------------------
 Hi,

 Hope someone can help me-Asterisk isn't behaving as I would expect
 and I think it's down to my contexts.

 There are two things I can't fathom.

 Firstly I want to record an IVR and so have created a user 20005 and
 a context called createmenu. I am using SER in front of asterisk so I
 changed the ser.cfg so that if the user dialled this number it
 forwards to asterisk. This works fine. The problem is when the invite
 reaches my asterisk box, asterisk uses the wrong context. It appears
 to call the "outgoing" context which is the context used to route
 calls to my pstn gateway provider. It then trys to execute a "Dial"
 command for 20005 which isn't supposed to happen.

 Secondly SER uses Asterisk for voicemail if a phone doesn't answer
 after a certain period of time or is busy. This works fine but I have
 to create an entry for every user in extensions.conf under the
 [default] context. Can I create a generic entry which would also work
 to shorten the config file?...Also if I change this and out all the
 entries under a context "voicemail" it doesn't work..I have to keep
 it in default.This must obviously be something got to do with
 Asterisk finding the contexts.

 I am confused as to how you apply multiple contexts to one user. At
 the moment nearly each user (besides 20005 and 1234) has a context of
 'outgoing' in sip.conf. This is so that they can make outgoing pstn
 calls.But what if I needed them to use another context in other
 situations?...I'm just confused as to what context should be applied.

 I have included the relevant parts of my sip.conf and extensions.conf
 below. I would appreciate any advice as to why these issues are
 occurring.

 Many thanks,
 Aisling.

 ;sip.conf
 [general]

 bindport=5064
 bindaddr=0.0.0.0
 disallow=all
 allow=ulaw
 allow=alaw
 allow=gsm
 srvlookup=yes
 canreinvite=no;
 autocreatepeer=yes
 nat=yes
 dtmfmode=info
 insecure=very
 registerattempts=0

 register => username:password at sip.blueface.ie/1234

 ;To receive incoming calls specify this and replace
 "yourcontext-pstn" for your dial plan

 [blueface-in]
 type=peer
 host=sip.blueface.ie
 context=pstn

 [1234]
 type=friend
 username=1234
 canreinvite=no
 context=pstn
 insecure=very
 ;callerid= "Ais" <1234>
 host=dynamic
 nat=yes
 dtmfmode=INFO
 mailbox=1234
 disallow=all
 allow=alaw
 allow=ulaw
 allow=g723.1
 allow=g729

 ;added below line(s) for BLUEFACE conf
 ;To make outgoing calls specify this block

 [blueface-out]
 type=peer
 host=sip.blueface.ie
 username=username
 secret=password

 [20005]
 type=friend
 username=20005
 canreinvite=no
 context=createmenu
 insecure=very
 ;callerid= "Ais" <20005>
 host=dynamic
 nat=yes
 dtmfmode=INFO
 mailbox=20005
 disallow=all
 allow=alaw
 allow=ulaw
 allow=g723.1
 allow=g729

 [300]
 type=friend
 username=300
 canreinvite=no
 context=outgoing
 insecure=very
 ;callerid= "voicemail user 1" <300>
 host=dynamic
 nat=yes
 dtmfmode=INFO
 mailbox=300
 disallow=all
 allow=alaw
 allow=ulaw
 allow=g723.1
 allow=g729

 extensions.conf
 [general]
 static=yes
 writeprotect = yes

 [createmenu]
 exten => 20005,1,Wait(2)
 exten => 20005,2,Record(/tmp/asterisk-recording:gsm)
 exten => 20005,3,Wait(2)
 exten => 20005,4,Playback(/tmp/asterisk-recording)
 exten => 20005,5,wait92)
 exten => 20005,6,Hangup

 ;specify context for receiving incoming calls
 [pstn]
 ;Note this is just an example there are infinite different ways to
 handle the incoming call.
 ;exten => 1234, 1,Wait(1)
 ;exten => 1234, 2,Playback(beep)
 ;exten => 1234, 3,Hangup
 exten => 1234, 1, Dial

 (SIP/2092 at seraddress) ; 1234 is the contact extension, default
 contact extension is "s"

 ;exten => 2092,1,Answer()
 ;exten => 2092,2,Playback(welcome)
 ;exten => 2092,3,Background(menu)
 ;exten => 1,1,Dial($316)
 ;exten => 2,1,Dial($314)

 [outgoing]
 ; Dial the Blue Face Speaking Clock
 exten => 300,1,Dial(SIP/300 at blueface-out)
 exten => 300,2,Hangup

 ;Send PSTN calls to Blue Face
 exten => _X.,1,Dial(SIP/${EXTEN}@blueface-out)
 exten => _X.,2,Hangup

 [default]

 exten => 300, 1,Dial(SIP/300,20)
 exten => 300, 2,Voicemail(u300)
 exten => 300, 102,Voicemail(b300)
 exten => 300, 103,Hangup

 exten => 301, 1,Dial(SIP/301,20)
 exten => 301, 2,Voicemail(u301)
 exten => 301, 102,Voicemail(b301)
 exten => 301, 103,Hangup 

 etc etc

 -------------------Legal Disclaimer---------------------------------------

 The above electronic mail transmission is confidential and intended only for the person to whom it is addressed. Its contents may be protected by legal and/or professional privilege. Should it be received by you in error please contact the sender at the above quoted email address. Any unauthorised form of reproduction of this message is strictly prohibited. The Institute does not guarantee the security of any information electronically transmitted and is not liable if the information contained in this communication is not a proper and complete record of the message as transmitted by the sender nor for any delay in its receipt.

 _______________________________________________
 --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

 -------------------Legal Disclaimer--------------------------------------- The above electronic mail transmission is confidential and intended only for the person to whom it is addressed. Its contents may be protected by legal and/or professional privilege. Should it be received by you in error please contact the sender at the above quoted email address. Any unauthorised form of reproduction of this message is strictly prohibited. The Institute does not guarantee the security of any information electronically transmitted and is not liable if the information contained in this communication is not a proper and complete record of the message as transmitted by the sender nor for any delay in its receipt.  -------------------Legal Disclaimer--------------------------------------- The above electronic mail transmission is confidential and intended only for the person to whom it is addressed. Its contents may be protected by legal and/or professional privilege. Should it be received by you in error please contact the sender at the above quoted email address. Any unauthorised form of reproduction of this message is strictly prohibited. The Institute does not guarantee the security of any information electronically transmitted and is not liable if the information contained in this communication is not a proper and complete record of the message as transmitted by the sender nor for any delay in its receipt.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060104/a0270ea5/attachment.htm


More information about the asterisk-users mailing list