File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Submodule
cc updated from 4f0d548 to 3cf29b5
Original file line number Diff line number Diff line change @@ -2231,10 +2231,21 @@ impl SipSession {
22312231 }
22322232
22332233 fn session_hook_ctx ( & self ) -> crate :: proxy:: proxy_call:: session_hooks:: CallSessionContext {
2234- // Pre-populate routing metadata (X-CRM-* / X-CC-*) into extensions.
2234+ // Merge routing metadata (X-CRM-* / X-CC-*) into extensions.
2235+ // Use entry() to avoid overwriting keys already set by addons (e.g.
2236+ // CcCallSessionHook writes agent_id/agent_name here).
22352237 if let Some ( ref m) = self . context . metadata {
22362238 if !m. is_empty ( ) {
2237- self . extensions . write ( ) . insert ( m. clone ( ) ) ;
2239+ let mut ext = self . extensions . write ( ) ;
2240+ if let Some ( existing) =
2241+ ext. get_mut :: < std:: collections:: HashMap < String , String > > ( )
2242+ {
2243+ for ( k, v) in m {
2244+ existing. entry ( k. clone ( ) ) . or_insert ( v. clone ( ) ) ;
2245+ }
2246+ } else {
2247+ ext. insert ( m. clone ( ) ) ;
2248+ }
22382249 }
22392250 }
22402251 crate :: proxy:: proxy_call:: session_hooks:: CallSessionContext {
You can’t perform that action at this time.
0 commit comments