[Asterisk-Dev] Identifying associated channel in rtp.c

Alf Thomas Nilsen a-t-n at online.no
Tue Apr 19 12:15:17 MST 2005


I doubt it's necessary to parse the variable for every packet. However, the
variable could potentially be different for each channel/conversation. Would
it cause problems if I decide to store the parsed (parsed when calling
sip_call()) variable as a global variable in rtp.c ? I can't see how it
won't because if I make a new call, the variable would be parsed and stored
globally in rtp.c and if any other channel/conversation accesses that global
variable it may have the "wrong" value.

I'm sorry for the "stupid" questions, but I'm rather new to this kind of
programming.

Thanks a lot for your help so far :)

Best regards,
Alf Thomas Nilsen

-----Original Message-----
From: asterisk-dev-bounces at lists.digium.com
[mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of Kevin P. Fleming
Sent: 19. april 2005 17:58
To: Asterisk Developers Mailing List
Subject: Re: [Asterisk-Dev] Identifying associated channel in rtp.c

Alf Thomas Nilsen wrote:
> So if I'd like to do a quick and dirty modification I could modify the
> ast_rtp_write() method to take a third parameter (the retrieved variable),
> and retrieve the variable from within sip_write() by calling:

If you do this in ast_rtp_write(), you'll be looking up and parsing the 
value of this variable for every single packet that is sent to the peer. 
Is that actually necessary?

More likely you could look it up one time in sip_call() or something 
similar, and then store the value in the rtp internal structure for 
future use during the call.
_______________________________________________
Asterisk-Dev mailing list
Asterisk-Dev at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-dev
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev





More information about the asterisk-dev mailing list