powered by Jive Software

What do I use for phone and extension?

I managed to connect to our astrisk manager but not sure how to do the Phone Mappings. My sip number is “raffi@198.245.16.148:5060”. How does this translate to phone/extension?

It looks like are trying to access your sip device directly. You want to have your phone connecting to asterisk. Your device name will be something like SIP/401, in the asterisk console you can see the other devices by running the command sip show peers[/i].

You need to use the device name that is specified in /etc/asterisk/sip.conf inside of the Asterisk-IM admin tool.

The fields in the admin tool are as follows:

username: andrew (node name from andrew@jivesoftware.com JID)

device: SIP/4001 (device name from sip.conf with SIP/ appended to it)

extension: 5035554001 (A number you can be dialed back at)

caller id: “Andrew Wright” <503-555-4001> (What should show up in the callerid on people you are calling)

If you don’'t have a entry in the sip.conf for your device you need to configure it. Here is a quick example below. Note that some steps such as voicemail setup are left out.

First of all create an account in /etc/asterisk/sip.conf for you sip phone:

type=friend

username=4001

secret=password

host=dynamic

context=from-sip

mailbox=4001

callerid=“Andrew Wright” <503-555-4001>

insecure=very

/i

You have now created the sip device SIP/4001.

After adding the entry in the sip.conf, reload the asterisk sip configuration:

(as root)

asterisk -r

sip reload

quit

/i

Configure your phone to connect to your asterisk server using the username and password provided above. Your phone may refer to the server as a sip proxy.

When your phone is able to register properly add an /etc/asterisk/extensions.conf entry:

; zap devices (external) would use this extension mapping

;or whatever your externally exposed context is

exten => 5035554001,1,Macro(stdexten,4001,SIP/4001)

; other internal sip devices would use this mapping

exten => 4001,1,Macro(stdexten,4001,SIP/4001)

; you may have something like this already

;

; Standard extension macro:

; $ - Extension (we could have used $ here as well
; $ - Device(s) to ring
;
exten => s,1,Dial($,20) ; Ring the interface, 20 seconds maximum
exten => s,2,Goto(s-$,1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER) exten => s-NOANSWER,1,Voicemail(u$) ; If unavailable, send to voicemail w/ unavail announce

exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start

exten => s-BUSY,1,Voicemail(b$) ; If busy, send to voicemail w/ busy announce
exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start
exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer
exten => a,1,VoicemailMain($)

/i

You have now created an extension 5035554001 and local extension 4001. You must reload the extensions in asterisk.

(as root)

asterisk -r

extensions reload

quit

/i

Also http://www.voip-info.org is a very good resource for all things VOIP, including asterisk and sip device conifguration.

Andrew, a f/u for this thread. I have followed all the steps for installation and creating phone mappings and users. When my phone registers correctly I do not see any presence change in my IM. I am using Trillian/Pro and Jive Messenger server. Does it not work with trillian? What am I missing here?

Thanks.

You won’'t see a presence change in your own IM client, this is because presence packets are sent to yourself. Other people should be able to see your presence change though.

You can test this by checking to see if you presence changes in the jive messenger admin tools session tab.

Andrew, thanks for your clarification. My confusion was that when my phone registered with my Asterisk server I expected my presence in the messenger server to reflect that. But, what I really need is an IM client with a softphone integrated into it, right?

I am not sure about the the use case you have in mind…

Presence setting of Asterisk-IM is done according to your call status (i.e. on call or not on call) and is unrelated to the SIP registration of your phone device.

I also was able to connect asterisk.im with my asterisk server but I could not get it to change the presence of the user.

I’'m using asterisk 1.0.5, messenger 2.2.0 and asterisk-im 1.0 beta 2

My configuration is as follows:

Username: luis

Phone: SIP/191 (choosed from combo)

Extension: 191

Callerid: “Luis” <191>

Primary: set (what is this for?)

My sip.conf is:

type = friend

context=local

username=191

secret=xxx

callerid=“IPContact” <191>

callgroup=3

pickupgroup=3

disallow=all

allow=g729

allow=ulaw

dtmfmode=info

canreinvite = no

host = dynamic

default = 192.168.3.191

What am I doing wrong?

First note that you will not see a presence change on your own client. Presence packets aren’'t sent to the JID whose presence changed. You can check to see if your presence changed by looking at the session tab in the admin tool.

Otherwise your configuration looks OK. You could also try restarting the server if you have not done so.

P.S. “primary” is used when you have multiple mappings. It determines things which device to use when dialing out, and which caller ID to show the caller when dialing.

I know that the plugin does not change the presence in the client’'s own program, but I also do not see any changes in the admin console page after restarting the server.

Moreover I sniffed the network activity in ports 5222 y 5223 and I don’'t see any presence packets when the phone rings or when I answer. (I also sniffed the connection with the asterisk server and that is working fine)

Looking at the log files I see some lines like this:

2005.08.31 14:38:22 No event class registered for event type ‘‘usereventnote’’, attributes: {uniqueid=1125509855.66, event=UserEventNote, note=Timeout en mainmenu, channel=H323/ip$192.168.3.1:36517/20219}

2005.08.31 14:38:22 buildEvent returned null

2005.08.31 14:39:07 buffer contains neither response nor event

We are using some user defined events in asterisk with another application that also connects to the manager interface. Could this unrecognized events break the plugin and prevent it from working?

We are using some user defined events in asterisk

with another application that also connects to the

manager interface. Could this unrecognized events

break the plugin and prevent it from working?

I don’'t know, I have frankly have never tried this.

2005.08.31 14:38:22 buildEvent returned null

2005.08.31 14:39:07 buffer contains neither response

This could be a problem with the asterisk-java api. I am not sure this message represents an error or not.

I do need to update asterisk-java jar in the next beta release of Asterisk-IM, I am starting to get pretty far out of date. Hopefully this will fix the issue, otherwise we need to investigate more. We could try disabling the custom events and disconnecting other manager apps and see what happens.

The warning indicates that Asterisk-Java has no corresponding Java class for your event.

As Asterisk-IM doesn’‘t depend on your user events it doesn’'t hurt.

You should be able to get rid of the warnings by changing your manager.conf and removing the user permission from the asterisk-im user. Unfortunately Asterisk currently sends those events with EVENT_FLAG_CALL instead of EVENT_FLAG_USER so that won’'t work.

I submitted a patch for Asterisk to fix this - we’'ll see what happens

http://bugs.digium.com/view.php?id=5200

Besides that the next version of Asterisk-Java will reduce the log level for those messages and only log the root cause (i.e. the missing mapping to a Java class)

http://jira.reucon.org/browse/AJ-13

For now just ignore the warning.

Stefan,

Thanks for the info.