[asterisk-dev] [svn-commits] qwell: branch qwell/hold_events r389611 - /team/qwell/hold_events/channels/

Richard Mudgett rmudgett at digium.com
Thu May 23 15:51:23 CDT 2013


> Author: qwell
> Date: Thu May 23 15:31:00 2013
> New Revision: 389611
> 
> URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=389611
> Log:
> Missed chan_iax2 and sig_pri
> 
> Modified:
>     team/qwell/hold_events/channels/chan_iax2.c
>     team/qwell/hold_events/channels/sig_pri.c
> 

... snip ...

----- Original Message -----
> Modified: team/qwell/hold_events/channels/sig_pri.c
> URL:
> http://svnview.digium.com/svn/asterisk/team/qwell/hold_events/channels/sig_pri.c?view=diff&rev=389611&r1=389610&r2=389611
> ==============================================================================
> --- team/qwell/hold_events/channels/sig_pri.c (original)
> +++ team/qwell/hold_events/channels/sig_pri.c Thu May 23 15:31:00
> 2013
> @@ -1241,6 +1241,50 @@
>  	sig_pri_lock_owner(pri, chanpos);
>  	if (pri->pvts[chanpos]->owner) {
>  		ast_queue_frame(pri->pvts[chanpos]->owner, frame);
> +		ast_channel_unlock(pri->pvts[chanpos]->owner);
> +	}
> +}
> +
> +/*!
> + * \internal
> + * \brief Queue a hold frame onto the owner channel.
> + * \since 12
> + *
> + * \param pri PRI span control structure.
> + * \param chanpos Channel position in the span.
> + *
> + * \note Assumes the pri->lock is already obtained.
> + * \note Assumes the sig_pri_lock_private(pri->pvts[chanpos]) is
> already obtained.
> + *
> + * \return Nothing
> + */
> +static void pri_queue_hold(struct sig_pri_span *pri, int chanpos)

Should be sig_pri_queue_hold() for new functions.  Just pri_ is what libpri uses.

> +{
> +	sig_pri_lock_owner(pri, chanpos);
> +	if (pri->pvts[chanpos]->owner) {
> +		ast_queue_hold(pri->pvts[chanpos]->owner, NULL);
> +		ast_channel_unlock(pri->pvts[chanpos]->owner);
> +	}
> +}
> +
> +/*!
> + * \internal
> + * \brief Queue an unhold frame onto the owner channel.
> + * \since 12
> + *
> + * \param pri PRI span control structure.
> + * \param chanpos Channel position in the span.
> + *
> + * \note Assumes the pri->lock is already obtained.
> + * \note Assumes the sig_pri_lock_private(pri->pvts[chanpos]) is
> already obtained.
> + *
> + * \return Nothing
> + */
> +static void pri_queue_unhold(struct sig_pri_span *pri, int chanpos)

Should be sig_pri_queue_unhold().

> +{
> +	sig_pri_lock_owner(pri, chanpos);
> +	if (pri->pvts[chanpos]->owner) {
> +		ast_queue_unhold(pri->pvts[chanpos]->owner);
>  		ast_channel_unlock(pri->pvts[chanpos]->owner);
>  	}
>  }
> @@ -5177,42 +5221,6 @@
>  		(orig_state == next_state) ? "$" :
>  		sig_pri_moh_state_str(next_state));
>  }
>  
> -#if defined(HAVE_PRI_CALL_HOLD)
> -/*!
> - * \internal
> - * \brief Post an AMI hold event.
> - * \since 10.0
> - *
> - * \param chan Channel to post event to
> - * \param is_held TRUE if the call was placed on hold.
> - *
> - * \return Nothing
> - */
> -static void sig_pri_ami_hold_event(struct ast_channel *chan, int
> is_held)
> -{
> -	/*** DOCUMENTATION
> -		<managerEventInstance>
> -			<synopsis>Raised when a PRI channel is put on Hold.</synopsis>
> -			<syntax>
> -				<parameter name="Status">
> -					<enumlist>
> -						<enum name="On"/>
> -						<enum name="Off"/>
> -					</enumlist>
> -				</parameter>
> -			</syntax>
> -		</managerEventInstance>
> -	***/
> -	ast_manager_event(chan, EVENT_FLAG_CALL, "Hold",
> -		"Status: %s\r\n"
> -		"Channel: %s\r\n"
> -		"Uniqueid: %s\r\n",
> -		is_held ? "On" : "Off",
> -		ast_channel_name(chan),
> -		ast_channel_uniqueid(chan));
> -}
> -#endif	/* defined(HAVE_PRI_CALL_HOLD) */
> -
>  /*!
>   * \internal
>   * \brief Set callid threadstorage for the pri_dchannel thread when
>   a new call is created
> @@ -5327,13 +5335,11 @@
>  		goto done_with_owner;
>  	}
>  	sig_pri_handle_subcmds(pri, chanpos_old, ev->e, ev->hold.subcmds,
>  	ev->hold.call);
> -	pri_queue_control(pri, chanpos_old, AST_CONTROL_HOLD);
> +	pri_queue_hold(pri, chanpos_old);
>  	chanpos_new = pri_fixup_principle(pri, chanpos_new, ev->hold.call);
>  	if (chanpos_new < 0) {
>  		/* Should never happen. */
> -		pri_queue_control(pri, chanpos_old, AST_CONTROL_UNHOLD);
> -	} else {
> -		sig_pri_ami_hold_event(owner, 1);
> +		pri_queue_unhold(pri, chanpos_old);
>  	}
>  
>  done_with_owner:;
> @@ -5522,9 +5528,8 @@
>  	callid = func_pri_dchannel_chanpos_callid(pri, chanpos);
>  	sig_pri_handle_subcmds(pri, chanpos, ev->e, ev->retrieve.subcmds,
>  	ev->retrieve.call);


>  	sig_pri_lock_owner(pri, chanpos);
> -	pri_queue_control(pri, chanpos, AST_CONTROL_UNHOLD);
> +	pri_queue_unhold(pri, chanpos);
>  	if (pri->pvts[chanpos]->owner) {
> -		sig_pri_ami_hold_event(pri->pvts[chanpos]->owner, 0);
>  		ast_channel_unlock(pri->pvts[chanpos]->owner);
>  	}

The above code should just be sig_pri_queue_unhold().

>  	pri_retrieve_ack(pri->pri, ev->retrieve.call,
> @@ -7428,12 +7433,12 @@
>  				switch (e->notify.info) {
>  				case PRI_NOTIFY_REMOTE_HOLD:
>  					if (!pri->discardremoteholdretrieval) {
> -						pri_queue_control(pri, chanpos, AST_CONTROL_HOLD);
> +						pri_queue_hold(pri, chanpos);
>  					}
>  					break;
>  				case PRI_NOTIFY_REMOTE_RETRIEVAL:
>  					if (!pri->discardremoteholdretrieval) {
> -						pri_queue_control(pri, chanpos, AST_CONTROL_UNHOLD);
> +						pri_queue_unhold(pri, chanpos);
>  					}
>  					break;
>  				}

Mini review completed. :)

Richard



More information about the asterisk-dev mailing list