[Home]

Summary:ASTERISK-07954: [feature request] No Uniqueid generated on Async Originate AMI request
Reporter:Anton Fedorov (datacompboy)Labels:
Date Opened:2006-10-18 11:22:06Date Closed:2011-06-07 14:02:37
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/ManagerInterface
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 8173.patch.txt
( 1) 8173.patch-1.2
( 2) patch2.8173
( 3) patch3.8173
Description:Async Originate AMI request should allocate Uniqueid, and report it in Response, so it will be possible to run from parrallel AMI managers async Originations and correctly separate messages and events for that originations.
Comments:By: Steve Murphy (murf) 2006-10-20 16:32:52

datacompboy--

I've attached patches for 1.2 and trunk. Give them a spin and let me know if they work/crash/embarrass/whatever. They compile, but I haven't tested them, figured you'd do that?


By: Anton Fedorov (datacompboy) 2006-10-21 02:35:25

Have tried only 1.2 version, no success:

<<0.230.0>> Send packet: [["Action",": ","Originate","\r\n"],                
                         ["Channel",": ","Local/1@ps_out","\r\n"],          
                         ["CallerID",": ","Call2Ru service","\r\n"],        
                         ["Async",": ","yes","\r\n"],                      
                         ["Variable",": ",["gate","=","voip"],"\r\n"],      
                         ["Variable",": ",["session","=","278!adv"],"\r\n"],
                         ["Variable",": ",["tio","=","60000"],"\r\n"],      
                         ["Variable",": ",["number","=","120001"],"\r\n"],  
                         ["Application",": ","AGI","\r\n"],                
                         ["Data",                                          
                          ": ",                                            
                          "agi://localhost:4573/ps_call/outgoing",          
                          "\r\n"],                                          
                         ["\r\n"]]
<<0.230.0>> Got packet: [<<"Message: Originate successfully queued\r\n">>,  
                        <<"Response: Success\r\n">>]

By: jmls (jmls) 2006-11-18 14:38:54.000-0600

ping: housekeeping

By: Steve Murphy (murf) 2006-11-24 20:26:39.000-0600

OK, I've attached patch2.8173; apply it, and it will log some notices. Attach the log results. It shouldn't behave any differently than last time, but this time I'll know why.


By: Steve Murphy (murf) 2006-12-21 15:28:26.000-0600

Don't you want this fixed? All you have to do is run the test, and attach the log entries!

murf

By: Anton Fedorov (datacompboy) 2006-12-22 01:42:31.000-0600

Sorry, was very busy on going other things work in system :(

Have recompiled asterisk, and run again same. Here is log of manager.c messages:
^@^M^[[Kcall2ru*CLI> ^MDec 22 07:39:56 NOTICE[30017]: manager.c:1075 action_originate: ^@Debug: async was set, firing a pthread
^@^M^[[Kcall2ru*CLI> ^MDec 22 07:39:56 NOTICE[30017]: manager.c:1122 action_originate: ^@Debug: res-success, Chan=0, uniq=Null.

Nothing more messages...

By: Steve Murphy (murf) 2007-02-09 20:56:39.000-0600

OK, I think I understand what's going on. Looks like the channel is hung up and gone before the manager Response: header is sent, which is kind of an impediment to displaying the uniqueid, which was stored in the now-gone channel. Now, I squirrel away the uniqueid while it's there, and use if the real thing is gone.

Try the patch3.8173 I've included, and see if this works. Let me know!

By: Steve Murphy (murf) 2007-03-05 22:23:49.000-0600

datacompboy-- any progress on 8173?


By: Steve Murphy (murf) 2007-03-23 17:55:02

datacompboy-- Any news? If no response, I'll close this bug, and no code updates.

By: Steve Murphy (murf) 2007-06-08 15:24:29

datacompboy dropped out on this one. I had done the work to fix this, I think, but no reply in several weeks. I'm closing this. Re-open if you have some results to report.

By: Anton Fedorov (datacompboy) 2008-04-17 06:26:39

Got planned upgrade of system to 1.4, so I have again test polygon.
Checked current state of Asterisk 1.4.13-BRIstuffed-0.4.0-test4 (debian pkg).
that version set "Uniqueid: asterisk-4616-1208430784.48\r\n" on Originate message, but that Uniqueid doesn't match the originated channel.

By: Anton Fedorov (datacompboy) 2008-04-17 06:27:17

Message log with comments below.

  * Send async origination request
<<0.298.0>> Send packet: [["Action",": ","Originate","\r\n"],
                         ["Channel",": ","Local/1@ps_out","\r\n"],
                         ["Async",": ","yes","\r\n"],
                         ["Timeout",": ","120000","\r\n"],
                         ["Variable",": ",["number","=","0079139257974"],
                          "\r\n"],
                         ["\r\n"]]
 * got reply with uniqueid
<<0.298.0>> Got packet: [<<"Uniqueid: asterisk-4616-1208430784.48\r\n">>,
                        <<"Message: Originate successfully queued\r\n">>,
                        <<"Response: Success\r\n">>]
 * dialout start, created new channel. it have its own uniqueid! but should have same as origination ID, to have possibility of matching
<<0.298.0>> Got packet: [<<"Uniqueid: asterisk-4616-1208430785.49\r\n">>,
                        <<"CallerIDName: <unknown>\r\n">>,
                        <<"CallerIDNum: <unknown>\r\n">>,
                        <<"State: Down\r\n">>,
                        <<"Channel: Local/1@ps_out-47e2,1\r\n">>,
                        <<"Privilege: call,all\r\n">>,
                        <<"Event: Newchannel\r\n">>]
 * created second part of local channel, it also have its own uniqueid:
<<0.298.0>> Got packet: [<<"Uniqueid: asterisk-4616-1208430785.50\r\n">>,
                        <<"CallerIDName: <unknown>\r\n">>,
                        <<"CallerIDNum: <unknown>\r\n">>,
                        <<"State: Ring\r\n">>,
                        <<"Channel: Local/1@ps_out-47e2,2\r\n">>,
                        <<"Privilege: call,all\r\n">>,
                        <<"Event: Newchannel\r\n">>]

By: Anton Fedorov (datacompboy) 2008-04-17 06:28:42

* 1st local leg get cid, unique id match leg created
<<0.298.0>> Got packet: [<<"CID-CallingPres: 0 (Presentation Allowed, Not Screened)\r\n">>,
                        <<"Uniqueid: asterisk-4616-1208430785.49\r\n">>,
                        <<"CallerIDName: Call2Ru service\r\n">>,
                        <<"CallerID: <Unknown>\r\n">>,
                        <<"Channel: Local/1@ps_out-47e2,1\r\n">>,                                
                        <<"Privilege: call,all\r\n">>,                                          
                        <<"Event: Newcallerid\r\n">>]                                            
 * 2nd local leg start running over dialplan, uniqueid match leg creation
<<0.298.0>> Got packet: [<<"Uniqueid: asterisk-4616-1208430785.50\r\n">>,                        
                        <<"AppData: 2?ps_out_pstn|1|1\r\n">>,                                    
                        <<"Application: GotoIf\r\n">>,                                          
                        <<"Priority: 1\r\n">>,                                                  
                        <<"Extension: 1\r\n">>,                                                  
                        <<"Context: ps_out\r\n">>,                                              
                        <<"Channel: Local/1@ps_out-47e2,2\r\n">>,                                
                        <<"Privilege: call,all\r\n">>,                                          
                        <<"Event: Newexten\r\n">>]
   * start dialout on 2nd leg via dialplan:
<<0.298.0>> Got packet: [<<"Uniqueid: asterisk-4616-1208430785.50\r\n">>,                        
                        <<"AppData: SIP/0079139257974@vf-out|60\r\n">>,                          
                        <<"Application: Dial\r\n">>,                                            
                        <<"Priority: 1\r\n">>,                                                  
                        <<"Extension: 1\r\n">>,                                                  
                        <<"Context: ps_out_pstn\r\n">>,                                          
                        <<"Channel: Local/1@ps_out-47e2,2\r\n">>,                                
                        <<"Privilege: call,all\r\n">>,                                          
                        <<"Event: Newexten\r\n">>]                                              
 * created new channel for dialout, it also have his own uniqueid:
<<0.298.0>> Got packet: [<<"Uniqueid: asterisk-4616-1208430786.51\r\n">>,
                        <<"CallerIDName: <unknown>\r\n">>,
                        <<"CallerIDNum: <unknown>\r\n">>,
                        <<"State: Down\r\n">>,
                        <<"Channel: SIP/vf-out-08299e50\r\n">>,
                        <<"Privilege: call,all\r\n">>,
                        <<"Event: Newchannel\r\n">>]

By: Anton Fedorov (datacompboy) 2008-04-17 06:29:16

* and 2nd local leg and new dialed out connected:
<<0.298.0>> Got packet: [<<"DestUniqueID: asterisk-4616-1208430786.51\r\n">>,
                        <<"SrcUniqueID: asterisk-4616-1208430785.50\r\n">>,
                        <<"CallerIDName: Call2Ru service\r\n">>,
                        <<"CallerID: <unknown>\r\n">>,
                        <<"Destination: SIP/vf-out-08299e50\r\n">>,
                        <<"Source: Local/1@ps_out-47e2,2\r\n">>,
                        <<"Privilege: call,all\r\n">>,
                        <<"Event: Dial\r\n">>]
 * rest of dial, also have no uniqueid of origination message:
<<0.298.0>> Got packet: [<<"CID-CallingPres: 0 (Presentation Allowed, Not Screened)\r\n">>,
                        <<"Uniqueid: asterisk-4616-1208430786.51\r\n">>,
                        <<"CallerIDName: <Unknown>\r\n">>,
                        <<"CallerID: 1\r\n">>,
                        <<"Channel: SIP/vf-out-08299e50\r\n">>,
                        <<"Privilege: call,all\r\n">>,
                        <<"Event: Newcallerid\r\n">>]
<<0.298.0>> Got packet: [<<"Cause-txt: Call Rejected\r\n">>,
                        <<"Cause: 21\r\n">>,
                        <<"Uniqueid: asterisk-4616-1208430786.51\r\n">>,
                        <<"Channel: SIP/vf-out-08299e50\r\n">>,
                        <<"Privilege: call,all\r\n">>,
                        <<"Event: Hangup\r\n">>]
<<0.298.0>> Got packet: [<<"Uniqueid: asterisk-4616-1208430785.50\r\n">>,
                        <<"CallerIDName: Call2Ru service\r\n">>,
                        <<"CallerID: <unknown>\r\n">>,
                        <<"State: Busy\r\n">>,
                        <<"Channel: Local/1@ps_out-47e2,2\r\n">>,
                        <<"Privilege: call,all\r\n">>,
                        <<"Event: Newstate\r\n">>]
<<0.298.0>> Got packet: [<<"Uniqueid: asterisk-4616-1208430785.50\r\n">>,
                        <<"AppData: ps_out_map|1|1\r\n">>,
                        <<"Application: Goto\r\n">>,
                        <<"Priority: 1\r\n">>,
                        <<"Extension: h\r\n">>,
                        <<"Context: ps_out_pstn\r\n">>,
                        <<"Channel: Local/1@ps_out-47e2,2\r\n">>,
                        <<"Privilege: call,all\r\n">>,
                        <<"Event: Newexten\r\n">>]
<<0.298.0>> Got packet: [<<"Uniqueid: asterisk-4616-1208430785.50\r\n">>,
                        <<"AppData: 1?100\r\n">>,
                        <<"Application: GotoIf\r\n">>,
                        <<"Priority: 1\r\n">>,
                        <<"Extension: 1\r\n">>,
                        <<"Context: ps_out_map\r\n">>,
                        <<"Channel: Local/1@ps_out-47e2,2\r\n">>,
                        <<"Privilege: call,all\r\n">>,
                        <<"Event: Newexten\r\n">>]
<<0.298.0>> Got packet: [<<"Uniqueid: asterisk-4616-1208430785.50\r\n">>,
                        <<"AppData: agi://localhost:4573/ps_call/outgoingbusy\r\n">>,
                        <<"Application: DeadAGI\r\n">>,
                        <<"Priority: 100\r\n">>,
                        <<"Extension: 1\r\n">>,
                        <<"Context: ps_out_map\r\n">>,
                        <<"Channel: Local/1@ps_out-47e2,2\r\n">>,
                        <<"Privilege: call,all\r\n">>,
                        <<"Event: Newexten\r\n">>]
<<0.298.0>> Got packet: [<<"Cause-txt: Unknown\r\n">>,
                        <<"Cause: 0\r\n">>,
                        <<"Uniqueid: asterisk-4616-1208430785.49\r\n">>,
                        <<"Channel: Local/1@ps_out-47e2,1\r\n">>,
                        <<"Privilege: call,all\r\n">>,
                        <<"Event: Hangup\r\n">>]
<<0.298.0>> Got packet: [<<"CallerIDName: Call2Ru service\r\n">>,
                        <<"CallerIDNum: <unknown>\r\n">>,
                        <<"CallerID: <unknown>\r\n">>,
                        <<"Uniqueid: <null>\r\n">>,
                        <<"Reason: 8\r\n">>,
                        <<"Exten: \r\n">>,
                        <<"Context: \r\n">>,
                        <<"Channel: Local/1@ps_out\r\n">>,
                        <<"Response: Failure\r\n">>,
                        <<"Privilege: call,all\r\n">>,
                        <<"Event: OriginateResponse\r\n">>]
<<0.298.0>> Got packet: [<<"Cause-txt: Call Rejected\r\n">>,
                        <<"Cause: 21\r\n">>,
                        <<"Uniqueid: asterisk-4616-1208430785.50\r\n">>,
                        <<"Channel: Local/1@ps_out-47e2,2\r\n">>,
                        <<"Privilege: call,all\r\n">>,
                        <<"Event: Hangup\r\n">>]

By: Tilghman Lesher (tilghman) 2008-04-17 13:08:35

I'm not really sure I agree with the basis of this request.  This appears to be a feature request masquerading as a bug report.  I don't think it's a candidate for anything but trunk.

By: Tilghman Lesher (tilghman) 2008-04-21 16:46:40

We're going to suggest an alternative method for accomplishing this:  Pass a variable to set on each channel that you're going to start asynchronously, and query the value from the channel with an AMI query of Getvar.

At this time, we are not willing to generate unique IDs ahead of the time the call is actually started, as it breaks a basic assumption around the generation of the unique ID.