powered by Jive Software

Can't call phone through spark?

I insert asterisk-1.4.15 in CentOS ,the ip address is 192.168.0.121,insert spark-2.5.8 and asterisk-im1.4.0 in WinXP, IP address is 192.168.0.122

asterisk: sip.conf

type=friend

username=test1

secret=6666

host=dynamic

nat=yes

canreinvite=no

context=incoming

disallow=all

allow=gsm

allow=ulaw

allow=alaw

type=friend

username=test2

secret=8888

host=dynamic

nat=yes

canreinvite=no

context=incoming

disallow=all

allow=gsm

allow=ulaw

allow=alaw

extension.conf

exten => _ZXXX,1,Answer

exten => _ZXXX,2,Dial(SIP/$,40,Ttr)

exten => _ZXXX,Hangup

manager.conf

secret = spark

deny=0.0.0.0/0.0.0.0

permit=192.168.0.122/255.255.255.0

writetimeout = 100

read = system,call,log,verbose,command,agent,user,config

write = system,call,log,verbose,command,agent,user,config

in spark admin asterisk-im page add server:

name address port username

asterisk 192.168.0.121 5038 spark

the phone mappins:

username device extension

test1 SIP/6666 test1

test2 SIP/8888 test2

the config is ok, I started the asterisk and openfire, the openfire console show "asterisk Successfully logged in and Initializing done ".the asterisk console show "Manager spark logged on from 192.168.0.122 " . I login 6666 and 8888 use X-lite,login teste1 and test2 use spark,next I use "test1 " call 8888,the x-lite 6666 show incoming call ,but after i clicked dial answer the call,the call immediately hangup. the asterisk console show “SIP/6666-09374b98 sent into invalid extension ‘s’ in context 'default ,but no invalid hander '” so I use spark user test1 can’t called to 8888 why??? thanks.

please help me,thanks

this is my spark log:

2008.01.04 11:51:04 [org.jivesoftware.database.SchemaManager.checkSchema(SchemaManager.java:206)

]

java.sql.SQLException: ??? ‘phoneServer’ ???

at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)

at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)

at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)

at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)

at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)

at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)

at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:723)

at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:1157)

at org.jivesoftware.database.SchemaManager.executeSQLScript(SchemaManager.java:348 )

at org.jivesoftware.database.SchemaManager.checkSchema(SchemaManager.java:203)

at org.jivesoftware.database.SchemaManager.checkPluginSchema(SchemaManager.java:11 1)

at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java :416)

at org.jivesoftware.openfire.container.PluginManager.access$300(PluginManager.java :46)

at org.jivesoftware.openfire.container.PluginManager$PluginMonitor.run(PluginManag er.java:1013)

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)

at java.util.concurrent.FutureTask.runAndReset(Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101 (Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodi c(Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknow n Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

2008.01.04 11:51:04 [org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.jav a:418)

] asterisk-im - ???

2008.01.04 11:51:06 [org.jivesoftware.openfire.http.HttpBindManager.start(HttpBindManager.java:95)

] Error starting HTTP bind service

java.net.BindException: Address already in use: bind

at sun.nio.ch.Net.bind(Native Method)

at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)

at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)

at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:2 11)

at org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.jav a:309)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)

at org.mortbay.jetty.Server.doStart(Server.java:228)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)

at org.jivesoftware.openfire.http.HttpBindManager.start(HttpBindManager.java:92)

at org.jivesoftware.openfire.spi.ConnectionManagerImpl.startHTTPBindListeners(Conn ectionManagerImpl.java:505)

at org.jivesoftware.openfire.spi.ConnectionManagerImpl.startListeners(ConnectionMa nagerImpl.java:134)

at org.jivesoftware.openfire.spi.ConnectionManagerImpl.access$000(ConnectionManage rImpl.java:52)

at org.jivesoftware.openfire.spi.ConnectionManagerImpl$1.pluginsMonitored(Connecti onManagerImpl.java:106)

at org.jivesoftware.openfire.container.PluginManager.firePluginsMonitored(PluginMa nager.java:532)

at org.jivesoftware.openfire.container.PluginManager.access$800(PluginManager.java :46)

at org.jivesoftware.openfire.container.PluginManager$PluginMonitor.run(PluginManag er.java:1023)

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)

at java.util.concurrent.FutureTask.runAndReset(Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101 (Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodi c(Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknow n Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

Now. I can call test1 to test2.I think, when I call test2 the 8888(x-lite) will receive,but now 6666(x-lite) receive,and hangup immediate.why???

my log:

Connected via Asterisk Call Manager/1.0

Successfully logged in

Determined Asterisk version: Asterisk 1.4

Initializing done

Adding channel SIP/6666-09d1d7b0(1199519758.0)

OnPhoneTask called for user PhoneUser{id=1, username=‘test1’}

Removing channel SIP/6666-09d1d7b0 due to hangup (NORMAL)

To me this sounds like a pure Astersik issue that is unrelated to Asterisk-IM.

yes,the sound introduce about asterisk not asterisk-im.

my asterisk console info

channel SIP/6666-085d7408 was answered.

== Starting SIP/6666-085d7408 at test,test2,1 failed so falling back to exten ‘s’

== Starting SIP/6666-085d7408 at test,s,1 still failed so falling back to context ‘default’

– Executing s@default:1 Wait(“SIP/6666-085d7408”, “1”) in new stack

– Executing s@default:2 Answer(“SIP/6666-085d7408”, “”) in new stack

– Executing s@default:3 Set(“SIP/6666-085d7408”, “TIMEOUT(digit)=5”) in new stack

– Digit timeout set to 5

– Executing s@default:4 Set(“SIP/6666-085d7408”, “TIMEOUT(response)=10”) in new stack

– Response timeout set to 10

– Executing s@default:5 BackGround(“SIP/6666-085d7408”, “demo-congrats”) in new stack

– <SIP/6666-085d7408> Playing ‘demo-congrats’ (language ‘en’)

– Executing s@default:6 BackGround(“SIP/6666-085d7408”, “demo-instruct”) in new stack

– <SIP/6666-085d7408> Playing ‘demo-instruct’ (language ‘en’)

== Spawn extension (default, s, 6) exited non-zero on ‘SIP/6666-085d7408’

Hi srt.whether my asterisk-im configure is right?Now I don’t know how to do next step.thanks