Re: [asterisk-users] Getting 'username' of sip peer
Yes, setting a fullname=xxx in peer definition sets the CALLERID(name) But if the peer sets it own callerid then will it override this value? On Wed, May 26, 2010 at 10:52 PM, Danny Nicholas da...@debsinc.com wrote: I might be wrong, but I think that adding fullname=xxx to the context will populate CALLERID(name) -Original Message- From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Deepesh D Sent: Wednesday, May 26, 2010 12:18 PM To: asterisk-users@lists.digium.com Subject: [asterisk-users] Getting 'username' of sip peer Hello, I have a few entries for sip peers in sip.conf with different name and username, like [TestSIPUser] type=peer host=dynamic username=testuser secret=1234 context=test_context [TestNewUser] type=peer host=dynamic username=newsipuser secret=3456 context=test_context When a call is made from any of these peers I want to get the username of the peer. for eg:- If a call is being made from 'TestSIPUser' then I want to be able to get the value 'testuser' Is it possible to get the value of 'username' of the peer in the dialplan using some application/function ? Thanks, Deepesh -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello 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 -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello 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 -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Getting 'username' of sip peer
Thanks. Got this working by using setvar=variable=value in the peer definition SIPCHANINFO(peername) is giving me the 'name' of the peer i.e. 'TestSIPUser' and not the 'username'. On Wed, May 26, 2010 at 11:20 PM, Jared Smith jsm...@digium.com wrote: On Wed, 2010-05-26 at 22:48 +0530, Deepesh D wrote: When a call is made from any of these peers I want to get the username of the peer. for eg:- If a call is being made from 'TestSIPUser' then I want to be able to get the value 'testuser' I can think of two ways of doing this. The first is to use the SIPCHANINFO() dialplan function, like this: exten=123,1,Verbose(0,The call came from ${SIPCHANINFO(peername)}) The other option is to use the setvar=variable=value setting in the peer definition in sip.conf. For example, if you add setvar=USERID=jsmith in a user/peer/friend definition, Asterisk would automagically create a channel variable named USERID with a value of jsmith every time this device made a call into Asterisk. -- Jared Smith Sr. Trainer Digium, Inc. -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello 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 -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Getting 'username' of sip peer
I might be wrong, but I think that adding fullname=xxx to the context will populate CALLERID(name) -Original Message- From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Deepesh D Sent: Wednesday, May 26, 2010 12:18 PM To: asterisk-users@lists.digium.com Subject: [asterisk-users] Getting 'username' of sip peer Hello, I have a few entries for sip peers in sip.conf with different name and username, like [TestSIPUser] type=peer host=dynamic username=testuser secret=1234 context=test_context [TestNewUser] type=peer host=dynamic username=newsipuser secret=3456 context=test_context When a call is made from any of these peers I want to get the username of the peer. for eg:- If a call is being made from 'TestSIPUser' then I want to be able to get the value 'testuser' Is it possible to get the value of 'username' of the peer in the dialplan using some application/function ? Thanks, Deepesh -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello 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 -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Getting 'username' of sip peer
On Wed, 2010-05-26 at 22:48 +0530, Deepesh D wrote: When a call is made from any of these peers I want to get the username of the peer. for eg:- If a call is being made from 'TestSIPUser' then I want to be able to get the value 'testuser' I can think of two ways of doing this. The first is to use the SIPCHANINFO() dialplan function, like this: exten=123,1,Verbose(0,The call came from ${SIPCHANINFO(peername)}) The other option is to use the setvar=variable=value setting in the peer definition in sip.conf. For example, if you add setvar=USERID=jsmith in a user/peer/friend definition, Asterisk would automagically create a channel variable named USERID with a value of jsmith every time this device made a call into Asterisk. -- Jared Smith Sr. Trainer Digium, Inc. -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users