Playback acting weirdly

I am using playback to play song to the caller.
Asterisk server(using manager ami) is calling a sip and when the sip user answer it,it plays based on extension set by manager AMI.
Initially it worked fine but now when I am calling asterisk,its playing mixture of songs.It starts the song from starting(00 seconds) and the same song from the point where the user hung up the previous time its called.

For example:in the first call user hung up at 30 seconds and if I will call now it will play mixture of two songs one from time 00 seconds and other from time 30 seconds.
If a third call will be placed after the user hung up then it will be a mixture of 3 songs

I am playing a songfile named 23.sln(in /home/atul/Desktop/23)

Here are the necessary details


Asterisk JAVA Code

Public void run() throws AuthenticationFailedException{ OriginateAction originateAction; ManagerResponse originateResponse; managerConnection.login(); String sip="SIP/1000abc";String context="outgoing-call";exten="23" originateAction = new OriginateAction(); originateAction.setChannel(sip); originateAction.setContext(context); originateAction.setExten(exten); originateAction.setPriority(new Integer(1)); originateAction.setTimeout(30000L); originateAction.setAsync(true); originateResponse = managerConnection.sendAction(originateAction,10000); managerConnection.logoff(); }

That is very difficult to understand, as the generator state is tied to the channel and you will create a new channel for each call. You will need debug level logging from the Asterisk sid.

How should I start asterisk?
I guess may be two instances are running.Is it possible?
i use asterisk -rvvv to start asterisk.
Moreover whenever I start Ubuntu asterisk is already started even though its not in my startup file.

And when the user picks up the call asterisk CLI says Playback(“SIP/1000abc-00000005”, “/home/atul/Desktop/23”) in new stack.

What is 0000005 here?Is it normal?

I am using Asterisk 1.8…Should I upgrade?

-r doesn’t start the daemon. It just stars a CLI client for the already running daemon.

the 00000005 is used to create a unique name for the channel instance. In that case, it is a serial number, although older versions of the SIP channel driver created channel names that could be re-used in only a short time.